public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Chenghui Pan <panchenghui@loongson.cn>
To: gcc-patches@gcc.gnu.org
Cc: xry111@xry111.site, i@xen0n.name, chenglulu@loongson.cn,
	xuchenghua@loongson.cn, Chenghui Pan <panchenghui@loongson.cn>
Subject: [PATCH v2 2/2] Add LoongArch in check_effective_target_vect_int_mod according to ISA capabilities.
Date: Tue, 26 Sep 2023 19:56:36 +0800	[thread overview]
Message-ID: <20230926115636.1367818-3-panchenghui@loongson.cn> (raw)
In-Reply-To: <20230926115636.1367818-1-panchenghui@loongson.cn>

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Add LoongArch in
	check_effective_target_vect_int_mod according to ISA 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 17863288ff0..4a84dee430b 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8586,6 +8586,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-*-*] }}]
 }
 
@@ -12663,6 +12665,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>
@@ -12675,6 +12685,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


  parent reply	other threads:[~2023-09-26 11:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 11:56 [PATCH v2 0/2] Update target-supports.exp for LoongArch SX/ASX Chenghui Pan
2023-09-26 11:56 ` [PATCH v2 1/2] Enable vect.exp for LoongArch Chenghui Pan
2023-09-26 11:56 ` Chenghui Pan [this message]
2023-09-26 12:09 ` [PATCH v2 0/2] Update target-supports.exp for LoongArch SX/ASX Chenghui Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230926115636.1367818-3-panchenghui@loongson.cn \
    --to=panchenghui@loongson.cn \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).