From: Victor Do Nascimento <victor.donascimento@arm.com>
To: <gcc-patches@gcc.gnu.org>
Cc: <kyrylo.tkachov@arm.com>, <richard.sandiford@arm.com>,
<Richard.Earnshaw@arm.com>,
Victor Do Nascimento <victor.donascimento@arm.com>
Subject: [PATCH 5/5] aarch64: rcpc3: Add intrinsics tests
Date: Thu, 9 Nov 2023 14:12:48 +0000 [thread overview]
Message-ID: <20231109141300.3542453-6-victor.donascimento@arm.com> (raw)
In-Reply-To: <20231109141300.3542453-1-victor.donascimento@arm.com>
Add unit test to ensure that added intrinsics compile to the correct
`LDAP1 {Vt.D}[lane],[Xn]' and `STL1 {Vt.d}[lane],[Xn]' instructions.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/acle/rcpc3.c: New.
---
gcc/testsuite/gcc.target/aarch64/acle/rcpc3.c | 47 +++++++++++++++++++
1 file changed, 47 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rcpc3.c
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/rcpc3.c b/gcc/testsuite/gcc.target/aarch64/acle/rcpc3.c
new file mode 100644
index 00000000000..689d047ab91
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/acle/rcpc3.c
@@ -0,0 +1,47 @@
+/* Test the rcpc3 ACLE intrinsics. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv8.2-a+rcpc3" } */
+#include <stdint.h>
+#include <arm_neon.h>
+
+#define TEST_LDAP(TYPE, T) \
+ TYPE##x##1_t T##1_test (TYPE##_t const * ptr, TYPE##x##1_t src) { \
+ return vldap1_lane_##T##64 (ptr, src, 0); \
+ }
+
+#define TEST_LDAPQ(TYPE, T) \
+ TYPE##x##2_t T##2_test (TYPE##_t const * ptr, TYPE##x##2_t src) { \
+ return vldap1q_lane_##T##64 (ptr, src, 1); \
+ }
+
+#define TEST_STL(TYPE, T) \
+ void T##1s_test (TYPE##_t * ptr, TYPE##x##1_t src) { \
+ vstl1_lane_##T##64 (ptr, src, 0); \
+ }
+
+#define TEST_STLQ(TYPE, T) \
+ void T##2s_test (TYPE##_t * ptr, TYPE##x##2_t src) { \
+ vstl1q_lane_##T##64 (ptr, src, 1); \
+ }
+
+TEST_LDAP (uint64, u);
+TEST_LDAP (int64, s);
+TEST_LDAP (float64, f);
+TEST_LDAP (poly64, p);
+/* { dg-final { scan-assembler-times {ldap1\t\{v\d.d\}\[0\], \[x\d\]} 4 } } */
+TEST_LDAPQ (uint64, u);
+TEST_LDAPQ (int64, s);
+TEST_LDAPQ (float64, f);
+TEST_LDAPQ (poly64, p);
+/* { dg-final { scan-assembler-times {ldap1\t\{v\d.d\}\[1\], \[x\d\]} 4 } } */
+
+TEST_STL (uint64, u);
+TEST_STL (int64, s);
+TEST_STL (float64, f);
+TEST_STL (poly64, p);
+/* { dg-final { scan-assembler-times {stl1\t\{v\d.d\}\[0\], \[x\d\]} 4 } } */
+TEST_STLQ (uint64, u);
+TEST_STLQ (int64, s);
+TEST_STLQ (float64, f);
+TEST_STLQ (poly64, p);
+/* { dg-final { scan-assembler-times {stl1\t\{v\d.d\}\[1\], \[x\d\]} 4 } } */
--
2.41.0
next prev parent reply other threads:[~2023-11-09 14:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 14:12 [PATCH 0/5] aarch64: Add ACLE intrinsics codegen support for lrcpc3 instructions Victor Do Nascimento
2023-11-09 14:12 ` [PATCH 1/5] aarch64: rcpc3: Add +rcpc3 extension Victor Do Nascimento
2023-11-24 12:03 ` Richard Sandiford
2023-11-09 14:12 ` [PATCH 2/5] aarch64: rcpc3: Add relevant iterators to handle Neon intrinsics Victor Do Nascimento
2023-11-24 11:31 ` Richard Sandiford
2023-11-09 14:12 ` [PATCH 3/5] aarch64: rcpc3: Add Neon ACLE intrinsics Victor Do Nascimento
2023-11-24 11:38 ` Richard Sandiford
2023-11-09 14:12 ` [PATCH 4/5] aarch64: rcpc3: add Neon ACLE wrapper functions to `arm_neon.h' Victor Do Nascimento
2023-11-24 12:05 ` Richard Sandiford
2023-12-07 17:22 ` Prathamesh Kulkarni
2023-11-09 14:12 ` Victor Do Nascimento [this message]
2023-11-24 12:06 ` [PATCH 5/5] aarch64: rcpc3: Add intrinsics tests Richard Sandiford
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=20231109141300.3542453-6-victor.donascimento@arm.com \
--to=victor.donascimento@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kyrylo.tkachov@arm.com \
--cc=richard.sandiford@arm.com \
/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).