Skip to content

Commit

Permalink
Minor changes so we can examine the assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed May 11, 2019
1 parent 5a711b1 commit 9a4b10a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions 2019/05/03/Dockerfile
Expand Up @@ -8,6 +8,7 @@
FROM gcc:9.1
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN make clean
RUN make
CMD ["./bitmapdecoding", "test"]

1 change: 1 addition & 0 deletions 2019/05/03/Makefile
Expand Up @@ -10,6 +10,7 @@ endif

bitmapdecoding: bitmapdecoding.cpp
$(CXX) --version
$(CXX) -O2 $(arch) -S -fverbose-asm -std=c++14 -o bitmapdecoding.s bitmapdecoding.cpp
$(CXX) -O2 $(arch) -std=c++14 -o bitmapdecoding bitmapdecoding.cpp -Wall -I.
sanibitmapdecoding : bitmapdecoding.cpp
$(CXX) -g3 $(arch) -fsanitize=address -fno-omit-frame-pointer -std=c++14 -o sanibitmapdecoding bitmapdecoding.cpp -Wall -I.
Expand Down
2 changes: 1 addition & 1 deletion 2019/05/03/bitmapdecoding.cpp
Expand Up @@ -81,7 +81,7 @@ uint64_t *build_bitmap(const char *filename, char target, size_t *wordcount) {
return data;
}

static inline void basic_decoder(uint32_t *base_ptr, uint32_t &base,
void basic_decoder(uint32_t *base_ptr, uint32_t &base,
uint32_t idx, uint64_t bits) {
while (bits != 0) {
base_ptr[base] = static_cast<uint32_t>(idx) + trailingzeroes(bits);
Expand Down
3 changes: 2 additions & 1 deletion 2019/05/03/dockerscript.sh
@@ -1,2 +1,3 @@
make clean && docker build -t my-gcc-app . && docker run --privileged my-gcc-app
make clean && docker build -t my-gcc-app . && docker run --privileged my-gcc-app && docker run -t my-gcc-app cat /usr/src/myapp/bitmapdecoding.s > bitmapdecoding.s


0 comments on commit 9a4b10a

Please sign in to comment.