public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX.
@ 2023-09-28 10:05 Chenghui Pan
  2023-09-28 10:05 ` [PATCH v3 1/2] LoongArch: Enable vect.exp for LoongArch. [PR111424] Chenghui Pan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chenghui Pan @ 2023-09-28 10:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, chenglulu, xuchenghua, Chenghui Pan

This is the update of: 
https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631379.html

This version does not include changes for codes, but fixes the commit title
format and appends the missing PR info.

Chenghui Pan (2):
  LoongArch: Enable vect.exp for LoongArch. [PR111424]
  LoongArch: Modify check_effective_target_vect_int_mod according to
    SX/ASX capabilities.

 gcc/testsuite/lib/target-supports.exp | 49 +++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

-- 
2.36.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/2] LoongArch: Enable vect.exp for LoongArch. [PR111424]
  2023-09-28 10:05 [PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX Chenghui Pan
@ 2023-09-28 10:05 ` Chenghui Pan
  2023-09-28 10:05 ` [PATCH v3 2/2] LoongArch: Modify check_effective_target_vect_int_mod according to SX/ASX capabilities Chenghui Pan
  2023-10-12  7:29 ` [pushed][PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX chenglulu
  2 siblings, 0 replies; 4+ messages in thread
From: Chenghui Pan @ 2023-09-28 10:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, chenglulu, xuchenghua, Chenghui Pan

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Enable vect.exp for LoongArch.
---
 gcc/testsuite/lib/target-supports.exp | 31 +++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 3a472943a9b..25958aaf0c5 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11335,6 +11335,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
     }
@@ -12817,6 +12824,30 @@ proc check_effective_target_const_volatile_readonly_section { } {
   return 1
 }
 
+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 } {
-- 
2.36.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] LoongArch: Modify check_effective_target_vect_int_mod according to SX/ASX capabilities.
  2023-09-28 10:05 [PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX Chenghui Pan
  2023-09-28 10:05 ` [PATCH v3 1/2] LoongArch: Enable vect.exp for LoongArch. [PR111424] Chenghui Pan
@ 2023-09-28 10:05 ` Chenghui Pan
  2023-10-12  7:29 ` [pushed][PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX chenglulu
  2 siblings, 0 replies; 4+ messages in thread
From: Chenghui Pan @ 2023-09-28 10:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, chenglulu, xuchenghua, Chenghui Pan

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(+)

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>
-- 
2.36.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pushed][PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX.
  2023-09-28 10:05 [PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX Chenghui Pan
  2023-09-28 10:05 ` [PATCH v3 1/2] LoongArch: Enable vect.exp for LoongArch. [PR111424] Chenghui Pan
  2023-09-28 10:05 ` [PATCH v3 2/2] LoongArch: Modify check_effective_target_vect_int_mod according to SX/ASX capabilities Chenghui Pan
@ 2023-10-12  7:29 ` chenglulu
  2 siblings, 0 replies; 4+ messages in thread
From: chenglulu @ 2023-10-12  7:29 UTC (permalink / raw)
  To: Chenghui Pan, gcc-patches; +Cc: xry111, i, xuchenghua

Pushed to r14-4585.

在 2023/9/28 下午6:05, Chenghui Pan 写道:
> This is the update of:
> https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631379.html
>
> This version does not include changes for codes, but fixes the commit title
> format and appends the missing PR info.
>
> Chenghui Pan (2):
>    LoongArch: Enable vect.exp for LoongArch. [PR111424]
>    LoongArch: Modify check_effective_target_vect_int_mod according to
>      SX/ASX capabilities.
>
>   gcc/testsuite/lib/target-supports.exp | 49 +++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-12  7:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28 10:05 [PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX Chenghui Pan
2023-09-28 10:05 ` [PATCH v3 1/2] LoongArch: Enable vect.exp for LoongArch. [PR111424] Chenghui Pan
2023-09-28 10:05 ` [PATCH v3 2/2] LoongArch: Modify check_effective_target_vect_int_mod according to SX/ASX capabilities Chenghui Pan
2023-10-12  7:29 ` [pushed][PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX chenglulu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).