aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2018-12-11 01:11:38 -0800
committerMark Adler <madler@alumni.caltech.edu>2018-12-26 12:26:52 -0800
commitf8719f5ae5acdc31d3794ddfea8ac963359de41e (patch)
tree70327ff8a4953abd605665ecd458a3c4b1a66443 /configure
parent41d86c73b21191a3fa9ea5f476fc9f1fc5e4f8b3 (diff)
downloadzlib-f8719f5ae5acdc31d3794ddfea8ac963359de41e.tar.gz
zlib-f8719f5ae5acdc31d3794ddfea8ac963359de41e.tar.bz2
zlib-f8719f5ae5acdc31d3794ddfea8ac963359de41e.zip
Speed up software CRC-32 computation by a factor of 1.5 to 3.
Use the interleaved method of Kadatch and Jenkins in order to make use of pipelined instructions through multiple ALUs in a single core. This also speeds up and simplifies the combination of CRCs, and updates the functions to pre-calculate and use an operator for CRC combination.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure33
1 files changed, 14 insertions, 19 deletions
diff --git a/configure b/configure
index f412795..1cd4fe5 100755
--- a/configure
+++ b/configure
@@ -367,8 +367,11 @@ else
367 try() 367 try()
368 { 368 {
369 show $* 369 show $*
370 ( $* ) >> configure.log 2>&1 370 got=`( $* ) 2>&1`
371 ret=$? 371 ret=$?
372 if test "$got" != ""; then
373 printf "%s\n" "$got" >> configure.log
374 fi
372 if test $ret -ne 0; then 375 if test $ret -ne 0; then
373 echo "(exit code "$ret")" >> configure.log 376 echo "(exit code "$ret")" >> configure.log
374 fi 377 fi
@@ -381,8 +384,11 @@ tryboth()
381 show $* 384 show $*
382 got=`( $* ) 2>&1` 385 got=`( $* ) 2>&1`
383 ret=$? 386 ret=$?
384 printf %s "$got" >> configure.log 387 if test "$got" != ""; then
388 printf "%s\n" "$got" >> configure.log
389 fi
385 if test $ret -ne 0; then 390 if test $ret -ne 0; then
391 echo "(exit code "$ret")" >> configure.log
386 return $ret 392 return $ret
387 fi 393 fi
388 test "$got" = "" 394 test "$got" = ""
@@ -457,17 +463,11 @@ size_t dummy = 0;
457EOF 463EOF
458if try $CC -c $CFLAGS $test.c; then 464if try $CC -c $CFLAGS $test.c; then
459 echo "Checking for size_t... Yes." | tee -a configure.log 465 echo "Checking for size_t... Yes." | tee -a configure.log
460 need_sizet=0
461else 466else
462 echo "Checking for size_t... No." | tee -a configure.log 467 echo "Checking for size_t... No." | tee -a configure.log
463 need_sizet=1 468 # find a size_t integer type
464fi 469 # check for long long
465 470 cat > $test.c << EOF
466echo >> configure.log
467
468# find the size_t integer type, if needed
469if test $need_sizet -eq 1; then
470 cat > $test.c <<EOF
471long long dummy = 0; 471long long dummy = 0;
472EOF 472EOF
473 if try $CC -c $CFLAGS $test.c; then 473 if try $CC -c $CFLAGS $test.c; then
@@ -495,17 +495,13 @@ EOF
495 if try $CC $CFLAGS -o $test $test.c; then 495 if try $CC $CFLAGS -o $test $test.c; then
496 sizet=`./$test` 496 sizet=`./$test`
497 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log 497 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
498 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
499 SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
498 else 500 else
499 echo "Failed to find a pointer-size integer type." | tee -a configure.log 501 echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
500 leave 1
501 fi 502 fi
502fi 503fi
503 504
504if test $need_sizet -eq 1; then
505 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
506 SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
507fi
508
509echo >> configure.log 505echo >> configure.log
510 506
511# check for large file support, and if none, check for fseeko() 507# check for large file support, and if none, check for fseeko()
@@ -849,7 +845,6 @@ echo SHAREDLIBV = $SHAREDLIBV >> configure.log
849echo STATICLIB = $STATICLIB >> configure.log 845echo STATICLIB = $STATICLIB >> configure.log
850echo TEST = $TEST >> configure.log 846echo TEST = $TEST >> configure.log
851echo VER = $VER >> configure.log 847echo VER = $VER >> configure.log
852echo Z_U4 = $Z_U4 >> configure.log
853echo SRCDIR = $SRCDIR >> configure.log 848echo SRCDIR = $SRCDIR >> configure.log
854echo exec_prefix = $exec_prefix >> configure.log 849echo exec_prefix = $exec_prefix >> configure.log
855echo includedir = $includedir >> configure.log 850echo includedir = $includedir >> configure.log