mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
riscv: Do not overwrite -march
when testing against SIMD availability
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
parent
3391bb98e3
commit
6aa47debba
@ -332,9 +332,6 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
message(FATAL_ERROR "PNG_RISCV_RVV must be one of [${PNG_RISCV_RVV_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_RISCV_RVV must be one of [${PNG_RISCV_RVV_POSSIBLE_VALUES}]")
|
||||||
elseif(NOT PNG_RISCV_RVV STREQUAL "off")
|
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("
|
check_c_source_compiles("
|
||||||
#include <riscv_vector.h>
|
#include <riscv_vector.h>
|
||||||
#include <asm/hwcap.h>
|
#include <asm/hwcap.h>
|
||||||
@ -349,8 +346,6 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
return (int)__riscv_vfmv_f_s_f32m1_f32(val);
|
return (int)__riscv_vfmv_f_s_f32m1_f32(val);
|
||||||
}" COMPILER_SUPPORTS_RVV)
|
}" COMPILER_SUPPORTS_RVV)
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_FLAGS ${_SAVED_CMAKE_REQUIRED_FLAGS})
|
|
||||||
|
|
||||||
if(NOT COMPILER_SUPPORTS_RVV)
|
if(NOT COMPILER_SUPPORTS_RVV)
|
||||||
message(FATAL_ERROR "Compiler does not support RISC-V Vector extension or its unable to detect it")
|
message(FATAL_ERROR "Compiler does not support RISC-V Vector extension or its unable to detect it")
|
||||||
endif()
|
endif()
|
||||||
|
@ -715,8 +715,6 @@ then
|
|||||||
compiler_support_riscv_rvv=no
|
compiler_support_riscv_rvv=no
|
||||||
AC_MSG_CHECKING(whether to use RISC-V RVV intrinsics)
|
AC_MSG_CHECKING(whether to use RISC-V RVV intrinsics)
|
||||||
|
|
||||||
save_CFLAGS=$CFLAGS
|
|
||||||
CFLAGS="$CFLAGS -march=rv64gv1p0"
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <riscv_vector.h>
|
#include <riscv_vector.h>
|
||||||
#include <asm/hwcap.h>
|
#include <asm/hwcap.h>
|
||||||
@ -737,7 +735,6 @@ int main() {
|
|||||||
else
|
else
|
||||||
AC_MSG_WARN([Compiler does not support riscv rvv.])
|
AC_MSG_WARN([Compiler does not support riscv rvv.])
|
||||||
fi
|
fi
|
||||||
CFLAGS=$save_CFLAGS
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add RISC-V-specific files to all builds where $host_cpu is riscv ('riscv64')
|
# Add RISC-V-specific files to all builds where $host_cpu is riscv ('riscv64')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user