From 145f8fbfc010548dda353e5897b9d082e5bd4ddb Mon Sep 17 00:00:00 2001 From: tezc Date: Fri, 4 Feb 2022 22:32:17 +0300 Subject: [PATCH] CRC32c doc --- crc32/README.md | 7 ++++--- crc32/sc_crc32.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crc32/README.md b/crc32/README.md index 8e3a57f..2c1a444 100644 --- a/crc32/README.md +++ b/crc32/README.md @@ -11,7 +11,7 @@ include(CheckCCompilerFlag) include (TestBigEndian) -# detect x86 +# Detect x86 and sse4.2 support check_c_compiler_flag(-msse4.2 HAVE_CRC32_HARDWARE) if (${HAVE_CRC32_HARDWARE}) message(STATUS "CPU have -msse4.2, defined HAVE_CRC32C") @@ -19,14 +19,15 @@ if (${HAVE_CRC32_HARDWARE}) target_compile_definitions(${PROJECT_NAME}_test PRIVATE -DHAVE_CRC32C) endif () -# detect aarch64 +# Detect aarch64 and set march=armv8.1-a. armv7 doesn't have CRC32c instruction +# so, armv7 will be unsupported with this flag. if (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) message(STATUS "CPU = aarch64, defined HAVE_CRC32C, -march=armv8.1-a") target_compile_definitions(${PROJECT_NAME}_test PRIVATE -DHAVE_CRC32C) target_compile_options(${PROJECT_NAME}_test PRIVATE -march=armv8.1-a) endif() -# detect software version endianness +# Detect software version endianness test_big_endian(HAVE_BIG_ENDIAN) if (${HAVE_BIG_ENDIAN}) message(STATUS "System is BIG ENDIAN") diff --git a/crc32/sc_crc32.c b/crc32/sc_crc32.c index 7563225..58e750d 100644 --- a/crc32/sc_crc32.c +++ b/crc32/sc_crc32.c @@ -26,7 +26,7 @@ * Version history: * 1.0 10 Feb 2013 First version * 1.1 1 Aug 2013 Correct comments on why three crc instructions in parallel - * 1.2 2020 added gcc intrinsics, fixed undefined behaviour + * 1.2 2020 Added gcc intrinsics, fixed undefined behaviour * 1.3 2021 Added big endian support, added aarch64 crc32c support */