diff options
author | Chenghui Pan <panchenghui@loongson.cn> | 2023-09-26 14:39:18 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2023-10-12 15:26:08 +0800 |
commit | a2a51b6982c895ff3e37bda622303e92b3ac1d16 (patch) | |
tree | 892fb97c3054af9c8b430289363fe4da9ef8b2ca | |
parent | 3c23183652b5de791ba56fd1d7c14a529dc8ef0d (diff) | |
download | gcc-a2a51b6982c895ff3e37bda622303e92b3ac1d16.zip gcc-a2a51b6982c895ff3e37bda622303e92b3ac1d16.tar.gz gcc-a2a51b6982c895ff3e37bda622303e92b3ac1d16.tar.bz2 |
LoongArch: Enable vect.exp for LoongArch. [PR111424]
gcc/testsuite/ChangeLog:
PR target/111424
* lib/target-supports.exp: Enable vect.exp for LoongArch.
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index adcdacb..4451386 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -11432,6 +11432,13 @@ proc check_vect_support_and_set_flags { } { lappend DEFAULT_VECTCFLAGS "--param" "riscv-vector-abi" set dg-do-what-default compile } + } elseif [istarget loongarch*-*-*] { + lappend DEFAULT_VECTCFLAGS "-mdouble-float" "-mlasx" + if [check_effective_target_loongarch_asx_hw] { + set dg-do-what-default run + } else { + set dg-do-what-default compile + } } else { return 0 } @@ -12941,6 +12948,30 @@ proc check_effective_target_cv_alu { } { } "-march=rv32i_xcvalu" ] } +proc check_effective_target_loongarch_sx_hw { } { + return [check_runtime loongarch_sx_hw { + #include <lsxintrin.h> + int main (void) + { + __m128i a, b, c; + c = __lsx_vand_v (a, b); + return 0; + } + } "-mlsx"] +} + +proc check_effective_target_loongarch_asx_hw { } { + return [check_runtime loongarch_asx_hw { + #include <lasxintrin.h> + int main (void) + { + __m256i a, b, c; + c = __lasx_xvand_v (a, b); + return 0; + } + } "-mlasx"] +} + # Appends necessary Python flags to extra-tool-flags if Python.h is supported. # Otherwise, modifies dg-do-what. proc dg-require-python-h { args } { |