aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2024-05-02 12:50:05 -0700
committerJames Zern <jzern@google.com>2024-05-02 15:21:07 -0700
commit35f0262c5e9dc9f69421b8d602e081311d3a18ea (patch)
tree7a800882ad9fc1bce76c4a418cfbafea76ed80cf
parent3e713e39ae79e3b83b87ff65e54d454a3c6d3dfc (diff)
downloadlibvpx-35f0262c5e9dc9f69421b8d602e081311d3a18ea.tar.gz
configure: Do more elaborate test of whether SVE can be compiled
This is a port of the change in libaom: https://aomedia-review.googlesource.com/c/aom/+/189761 5ccdc66ab6 cpu.cmake: Do more elaborate test of whether SVE can be compiled For Windows targets, Clang will successfully compile simpler SVE functions, but if the function requires backing up and restoring SVE registers (as part of the AAPCS calling convention), Clang will fail to generate unwind data for this function, resulting in an error. This issue is tracked upstream in Clang in https://github.com/llvm/llvm-project/issues/80009. Check whether the compiler can compile such a function, and disable SVE if it is unable to handle that case. Change-Id: I8550248abd6a7876bd8ecf6ba66bc70518133566
-rw-r--r--build/make/configure.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 009bf7db5..40308fcb4 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -442,6 +442,22 @@ check_neon_sve_bridge_compiles() {
#include <arm_neon_sve_bridge.h>
EOF
compile_result=$?
+ if [ ${compile_result} -eq 0 ]; then
+ # Check whether the compiler can compile SVE functions that require
+ # backup/restore of SVE registers according to AAPCS. Clang for Windows
+ # used to fail this, see
+ # https://github.com/llvm/llvm-project/issues/80009.
+ check_cc -march=armv8.2-a+dotprod+i8mm+sve <<EOF
+#include <arm_sve.h>
+void other(void);
+svfloat32_t func(svfloat32_t a) {
+ other();
+ return a;
+}
+EOF
+ compile_result=$?
+ fi
+
if [ ${compile_result} -ne 0 ]; then
log_echo " disabling sve: arm_neon_sve_bridge.h not supported by compiler"
log_echo " disabling sve2: arm_neon_sve_bridge.h not supported by compiler"