Open Quuxplusone opened 14 years ago
build script:
#!/bin/bash
export dragonegg_disable_version_check=1
for opt in O1 O2 O3 Os ; do
gcc-4.4 -$opt crc32.c crc32test.c -march=native -lm -o crc32_64_44_$opt
gcc-4.5 -$opt crc32.c crc32test.c -march=native -lm -o crc32_64_45_$opt
~/llvm2.6/obj/Release/bin/clang -w -$opt crc32.c crc32test.c -march=core2 -lm -o crc32_64_clang26_$opt
~/llvm-git/obj/Release/bin/clang -w -$opt crc32.c crc32test.c -march=native -lm -o crc32_64_clang27_$opt
llvm-gcc -$opt crc32.c crc32test.c -march=native -lm -o crc32_64_dragonegg_$opt
gcc-4.4 -$opt crc32.c crc32test.c -march=native -lm -o crc32_32_44_$opt -DCRC32_32bit
gcc-4.5 -$opt crc32.c crc32test.c -march=native -lm -o crc32_32_45_$opt -DCRC32_32bit
~/llvm2.6/obj/Release/bin/clang -w -$opt crc32.c crc32test.c -march=core2 -lm -o crc32_32_clang26_$opt -DCRC32_32bit
~/llvm-git/obj/Release/bin/clang -w -$opt crc32.c crc32test.c -march=native -lm -o crc32_32_clang27_$opt -DCRC32_32bit
llvm-gcc -$opt crc32.c crc32test.c -march=native -lm -o crc32_32_dragonegg_$opt -DCRC32_32bit
done
for compiler in 44 45 clang26 clang27 dragonegg; do
for bit in 64 32 ; do
for opt in O1 O2 O3 Os ; do
./crc32_"$bit"_"$compiler"_"$opt"
done
done
echo
done
Attached crc32test.c
(1289 bytes, text/plain): crc32test.c
Attached crc32.c
(13721 bytes, text/plain): crc32.c
Attached crc32.h
(30667 bytes, text/x-chdr): crc32.h
Attached clang26.ll
(64135 bytes, application/octet-stream): the fastest code: clang 2.6 -O1 (.ll)
Attached clang27.ll
(77307 bytes, application/octet-stream): clang 2.7 -O2 code
Attached clang26.s
(47147 bytes, text/plain): clang 2.6 -O1 -S
Attached clang27.s
(47162 bytes, text/plain): clang 2.7 -O2 -S
At -O2, GCC 5.3 and 6.1 generate binaries 7% faster than clang 3.7 and 3.9
on Haswell.
crc32test.c
(1289 bytes, text/plain)crc32.c
(13721 bytes, text/plain)crc32.h
(30667 bytes, text/x-chdr)clang26.ll
(64135 bytes, application/octet-stream)clang27.ll
(77307 bytes, application/octet-stream)clang26.s
(47147 bytes, text/plain)clang27.s
(47162 bytes, text/plain)