cksum,wc: clean up hw capability checking
commitf780a85985f5b069ba8597aaeac49eb74864926a
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 14 Jun 2023 21:52:37 +0000 (14 14:52 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 14 Jun 2023 21:54:46 +0000 (14 14:54 -0700)
tree478b83a97c9a315cef56a315ec3dde4cb4b208cb
parent4ac941565fc1f7c1eb7954302f2ec20435fdf34c
cksum,wc: clean up hw capability checking

* src/cksum.c (cksum_pclmul) [!CRCTAB && !USE_PCLMUL_CRC32]:
Remove macro.
(cksum_fp): No longer file-scope.
(pclmul_supported): Define only if USE_PCLMUL_CRC32.
This omits the debug output "using generic hardware support"
for simplicity and consistency with wc’s output.
(crc_sum_stream) [!USE_PCLMUL_32]: No need for static function pointer.
* src/wc.c (wc_lines_p) [USE_AVX2_WC_LINECOUNT]: No longer file-scope.
(wc) [USE_AVX2_WC_LINECOUNT]: Check for avx2 support at most once,
which was surely the code’s original intent.
(wc) [!USE_AVX2_WC_LINECOUNT]: No need for static function pointer.
src/cksum.c
src/wc.c