[v3,2/2] LoongArch: Modify check_effective_target_vect_int_mod according to SX/ASX capabilities.

Message ID 20230928100526.3351245-3-panchenghui@loongson.cn
State Unresolved
Headers
Series LoongArch: Update target-supports.exp for LoongArch SX/ASX. |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Chenghui Pan Sept. 28, 2023, 10:05 a.m. UTC
  gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Add LoongArch in
	check_effective_target_vect_int_mod according to SX/ASX capabilities.
---
 gcc/testsuite/lib/target-supports.exp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
  

Patch

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 25958aaf0c5..5632904ddfd 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8747,6 +8747,8 @@  proc check_effective_target_vect_int_mod { } {
     return [check_cached_effective_target_indexed vect_int_mod {
       expr { ([istarget powerpc*-*-*]
 	      && [check_effective_target_has_arch_pwr10])
+	      || ([istarget loongarch*-*-*]
+		  && [check_effective_target_loongarch_sx])
              || [istarget amdgcn-*-*] }}]
 }
 
@@ -12824,6 +12826,14 @@  proc check_effective_target_const_volatile_readonly_section { } {
   return 1
 }
 
+proc check_effective_target_loongarch_sx { } {
+    return [check_no_compiler_messages loongarch_lsx assembly {
+       #if !defined(__loongarch_sx)
+       #error "LSX not defined"
+       #endif
+    }]
+}
+
 proc check_effective_target_loongarch_sx_hw { } {
     return [check_runtime loongarch_sx_hw {
 	#include <lsxintrin.h>
@@ -12836,6 +12846,14 @@  proc check_effective_target_loongarch_sx_hw { } {
     } "-mlsx"]
 }
 
+proc check_effective_target_loongarch_asx { } {
+    return [check_no_compiler_messages loongarch_asx assembly {
+       #if !defined(__loongarch_asx)
+       #error "LASX not defined"
+       #endif
+    }]
+}
+
 proc check_effective_target_loongarch_asx_hw { } {
     return [check_runtime loongarch_asx_hw {
 	#include <lasxintrin.h>