From 9887f1f144f4ab55524581caa4c8770fdef7f8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=98=B3?= <657837019@qq.com> Date: Wed, 10 Jun 2026 02:20:18 +0800 Subject: [PATCH 1/2] Add generic RISC-V build path --- CMakeLists.txt | 4 ++++ blosc/shuffle.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fac75f5f..197a92a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,6 +250,10 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "(i386|i686|x86_64|amd64|AMD64)") # Unrecognized compiler. Emit a warning message to let the user know hardware-acceleration won't be available. message(WARNING "Unable to determine which ${CMAKE_SYSTEM_PROCESSOR} hardware features are supported by the C compiler (${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}).") endif() +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv") + set(COMPILER_SUPPORT_SSE2 FALSE) + set(COMPILER_SUPPORT_AVX2 FALSE) + message(STATUS "Recognized RISC-V target ${CMAKE_SYSTEM_PROCESSOR}; hardware-accelerated x86 shuffle implementations are disabled and generic routines will be used.") else() # If the target system processor isn't recognized, emit a warning message to alert the user # that hardware-acceleration support won't be available but allow configuration to proceed. diff --git a/blosc/shuffle.c b/blosc/shuffle.c index 9e3ee3e3..48e0e967 100644 --- a/blosc/shuffle.c +++ b/blosc/shuffle.c @@ -285,6 +285,12 @@ static blosc_cpu_features blosc_get_cpu_features(void) { } #endif +#elif defined(__riscv) + +static blosc_cpu_features blosc_get_cpu_features(void) { + return BLOSC_HAVE_NOTHING; +} + #else /* No hardware acceleration supported for the target architecture. */ #if defined(_MSC_VER) #pragma message("Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available.") @@ -301,6 +307,7 @@ static blosc_cpu_features blosc_get_cpu_features(void) { static shuffle_implementation_t get_shuffle_implementation(void) { blosc_cpu_features cpu_features = blosc_get_cpu_features(); shuffle_implementation_t impl_generic; + (void)cpu_features; #if defined(SHUFFLE_AVX2_ENABLED) if (cpu_features & BLOSC_HAVE_AVX2) { From 1d062607648db0594dfd6d454c0e60d636f1d72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=98=B3?= <657837019@qq.com> Date: Mon, 15 Jun 2026 22:01:23 +0800 Subject: [PATCH 2/2] Silence generic fallback detection warning --- blosc/shuffle.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/blosc/shuffle.c b/blosc/shuffle.c index 48e0e967..72557134 100644 --- a/blosc/shuffle.c +++ b/blosc/shuffle.c @@ -285,19 +285,7 @@ static blosc_cpu_features blosc_get_cpu_features(void) { } #endif -#elif defined(__riscv) - -static blosc_cpu_features blosc_get_cpu_features(void) { - return BLOSC_HAVE_NOTHING; -} - #else /* No hardware acceleration supported for the target architecture. */ - #if defined(_MSC_VER) - #pragma message("Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available.") - #else - #warning Hardware-acceleration detection not implemented for the target architecture. Only the generic shuffle/unshuffle routines will be available. - #endif - static blosc_cpu_features blosc_get_cpu_features(void) { return BLOSC_HAVE_NOTHING; }