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 1/2] Enable vect.exp for LoongArch.
Date: Tue, 26 Sep 2023 19:56:35 +0800 [thread overview]
Message-ID: <20230926115636.1367818-2-panchenghui@loongson.cn> (raw)
In-Reply-To: <20230926115636.1367818-1-panchenghui@loongson.cn>
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 2de41cef2f6..17863288ff0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -11174,6 +11174,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
}
@@ -12656,6 +12663,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
next prev 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 ` Chenghui Pan [this message]
2023-09-26 11:56 ` [PATCH v2 2/2] Add LoongArch in check_effective_target_vect_int_mod according to ISA capabilities Chenghui Pan
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-2-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).