Commit 9bd2d085 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

OS X and clang fixes

parent 9e22ee53
...@@ -322,7 +322,10 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm) ...@@ -322,7 +322,10 @@ static inline uint32_t direct_get_fs(struct aec_stream *strm)
state->bitp = 56; state->bitp = 56;
} }
#if HAVE_DECL___BUILTIN_CLZLL #ifndef __has_builtin
#define __has_builtin(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if HAVE_DECL___BUILTIN_CLZLL || __has_builtin(__builtin_clzll)
i = 63 - __builtin_clzll(state->acc); i = 63 - __builtin_clzll(state->acc);
#elif HAVE_BSR64 #elif HAVE_BSR64
_BitScanReverse64(&i, state->acc); _BitScanReverse64(&i, state->acc);
......
...@@ -8,7 +8,7 @@ if [ ! -f bench.rz ]; then ...@@ -8,7 +8,7 @@ if [ ! -f bench.rz ]; then
"${path}"/benc.sh "${path}"/benc.sh
fi fi
rm -f dec.dat rm -f dec.dat
bsize=$(stat -c "%s" bench.dat) bsize=$(wc -c bench.dat | awk '{print $1}')
utime=$(../src/utime $AEC -d -n16 -j64 -r256 -m bench.rz dec.dat 2>&1) utime=$(../src/utime $AEC -d -n16 -j64 -r256 -m bench.rz dec.dat 2>&1)
perf=$(echo "$bsize/1048576/$utime" | bc) perf=$(echo "$bsize/1048576/$utime" | bc)
echo "*** Decoding with $perf MiB/s user time ***" echo "*** Decoding with $perf MiB/s user time ***"
......
...@@ -23,6 +23,6 @@ if [ ! -f bench.dat ]; then ...@@ -23,6 +23,6 @@ if [ ! -f bench.dat ]; then
fi fi
rm -f bench.rz rm -f bench.rz
utime=$(../src/utime $AEC -n16 -j64 -r256 -m bench.dat bench.rz 2>&1) utime=$(../src/utime $AEC -n16 -j64 -r256 -m bench.dat bench.rz 2>&1)
bsize=$(stat -c "%s" bench.dat) bsize=$(wc -c bench.dat | awk '{print $1}')
perf=$(echo "$bsize/1048576/$utime" | bc) perf=$(echo "$bsize/1048576/$utime" | bc)
echo "*** Encoding with $perf MiB/s user time ***" echo "*** Encoding with $perf MiB/s user time ***"
...@@ -19,9 +19,13 @@ if [ ! -f $archive ]; then ...@@ -19,9 +19,13 @@ if [ ! -f $archive ]; then
fi fi
unzip -oq $archive unzip -oq $archive
filesize () {
wc -c $1 | awk '{print $1}'
}
decode () { decode () {
$AEC -d $3 $1 test.dat $AEC -d $3 $1 test.dat
cmp -n $(stat -c "%s" $2) $2 test.dat cmp -n $(filesize $2) $2 test.dat
} }
code () { code () {
...@@ -31,7 +35,7 @@ code () { ...@@ -31,7 +35,7 @@ code () {
code_size () { code_size () {
$AEC $3 $2 test.rz $AEC $3 $2 test.rz
if [ ! $(stat -c "%s" test.rz) -eq $(stat -c "%s" $1) ]; then if [ ! $(filesize test.rz) -eq $(filesize $1) ]; then
echo "$1 size mismatch" echo "$1 size mismatch"
exit 1 exit 1
fi fi
...@@ -48,7 +52,7 @@ cosdec () { ...@@ -48,7 +52,7 @@ cosdec () {
} }
echo All Options echo All Options
ln -f ${ALLO}/test_P512n22.dat ${ALLO}/test_p512n22.dat mv -f ${ALLO}/test_P512n22.dat ${ALLO}/test_p512n22.dat
for i in 01 02 03 04 for i in 01 02 03 04
do do
uf=$ALLO/test_p256n${i}.dat uf=$ALLO/test_p256n${i}.dat
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment