]> gcc.gnu.org Git - gcc.git/commitdiff
LoongArch: Enable vect.exp for LoongArch. [PR111424]
authorChenghui Pan <panchenghui@loongson.cn>
Tue, 26 Sep 2023 06:39:18 +0000 (14:39 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 12 Oct 2023 07:26:08 +0000 (15:26 +0800)
gcc/testsuite/ChangeLog:

PR target/111424
* lib/target-supports.exp: Enable vect.exp for LoongArch.

gcc/testsuite/lib/target-supports.exp

index adcdacbc7717592024da3404feb95ed7f95d9168..4451386d78089087ae9b6000f3badebd49372ea5 100644 (file)
@@ -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 } {
This page took 0.074514 seconds and 5 git commands to generate.