summaryrefslogtreecommitdiff
path: root/cmake/config
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-04-25 22:21:49 +0200
committerSander Vrijders <sander@ouroboros.rocks>2026-05-06 09:04:22 +0200
commit77fdc9f1d162b2307d7752d56930710858f702b4 (patch)
treede70a08d6da1c0d5f14a4693c0872843b4625717 /cmake/config
parentdd978895f5bbf6b595813d1288d90f825fd402ec (diff)
downloadouroboros-77fdc9f1d162b2307d7752d56930710858f702b4.tar.gz
ouroboros-77fdc9f1d162b2307d7752d56930710858f702b4.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'cmake/config')
-rw-r--r--cmake/config/lib.cmake11
1 files changed, 11 insertions, 0 deletions
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)")