riscv: Do not overwrite -march when testing against SIMD availability

Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Filip Wasil 2025-06-26 13:32:49 +02:00 committed by Cosmin Truta
parent 3391bb98e3
commit 6aa47debba
2 changed files with 0 additions and 8 deletions

View File

@ -332,9 +332,6 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
message(FATAL_ERROR "PNG_RISCV_RVV must be one of [${PNG_RISCV_RVV_POSSIBLE_VALUES}]")
elseif(NOT PNG_RISCV_RVV STREQUAL "off")
set(_SAVED_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-march=rv64gv1p0")
check_c_source_compiles("
#include <riscv_vector.h>
#include <asm/hwcap.h>
@ -349,8 +346,6 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
return (int)__riscv_vfmv_f_s_f32m1_f32(val);
}" COMPILER_SUPPORTS_RVV)
set(CMAKE_REQUIRED_FLAGS ${_SAVED_CMAKE_REQUIRED_FLAGS})
if(NOT COMPILER_SUPPORTS_RVV)
message(FATAL_ERROR "Compiler does not support RISC-V Vector extension or its unable to detect it")
endif()

View File

@ -715,8 +715,6 @@ then
compiler_support_riscv_rvv=no
AC_MSG_CHECKING(whether to use RISC-V RVV intrinsics)
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -march=rv64gv1p0"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <riscv_vector.h>
#include <asm/hwcap.h>
@ -737,7 +735,6 @@ int main() {
else
AC_MSG_WARN([Compiler does not support riscv rvv.])
fi
CFLAGS=$save_CFLAGS
fi
# Add RISC-V-specific files to all builds where $host_cpu is riscv ('riscv64')