From 77fdc9f1d162b2307d7752d56930710858f702b4 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 25 Apr 2026 22:21:49 +0200 Subject: cmake: Add CPU feature detection helper Add cmake/utils/CPUUtils.cmake providing detect_cpu_feature() plus detect_pclmul() and detect_pmull() that compile-test for x86 PCLMULQDQ+SSE4.1 and aarch64 FEAT_PMULL respectively. This will be useful for hardware accelerated CRC64/NVMe integrity checks. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- cmake/config/lib.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmake/config') diff --git a/cmake/config/lib.cmake b/cmake/config/lib.cmake index 287f30dc..aba580f1 100644 --- a/cmake/config/lib.cmake +++ b/cmake/config/lib.cmake @@ -28,6 +28,17 @@ set(SOCKET_TIMEOUT 500 CACHE STRING set(QOS_DISABLE_CRC TRUE CACHE BOOL "Ignores ber setting on all QoS cubes") +include(utils/CPUUtils) +detect_pclmul() +detect_pmull() +if(HAVE_PCLMUL) + message(STATUS "CRC-64/NVMe backend: PCLMUL (x86 SSE4.1+PCLMUL)") +elseif(HAVE_PMULL) + message(STATUS "CRC-64/NVMe backend: PMULL (aarch64 crypto)") +else() + message(STATUS "CRC-64/NVMe backend: byte table (no acceleration)") +endif() + # Delta-t protocol timers set(DELTA_T_MPL 60 CACHE STRING "Maximum packet lifetime (s)") -- cgit v1.2.3