public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jiufu Guo <guojiufu@linux.ibm.com>
To: gcc-patches@gcc.gnu.org
Cc: segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org,
	guojiufu@linux.ibm.com
Subject: [PATCH] testsuite: update builtins-5-p9-runnable.c for BE
Date: Fri, 14 Apr 2023 15:30:26 +0800	[thread overview]
Message-ID: <20230414073026.2766449-1-guojiufu@linux.ibm.com> (raw)

Hi,

As PR108809 mentioned, vec_xl_len_r and vec_xst_len_r are tested 
in gcc.target/powerpc/builtins-5-p9-runnable.c.
The vector operand of these two bifs are different from the view
of v16_int8 between BE and LE, even it is same from the view of
128bits(uint128/V1TI). 

The test case gcc.target/powerpc/builtins-5-p9-runnable.c was
written for LE environment, this patch updates it for BE.

Tested on ppc64 BE and LE.
Is this ok for trunk?

BR,
Jeff (Jiufu)

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/builtins-5-p9-runnable.c: Updated.

---
 .../powerpc/builtins-5-p9-runnable.c          | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
index 14e935513fe..1a5f1d6383a 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
@@ -78,8 +78,13 @@ int main() {
    size = 8;
    vec_uc_result1 = vec_xl_len_r(data_uc, size);
 
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){8, 7, 6, 5, 4, 3, 2, 1,
 					     0, 0, 0, 0, 0, 0, 0, 0,};
+#else
+   vec_uc_expected1 = (vector unsigned char){0, 0, 0, 0, 0, 0, 0, 0,
+					     1, 2, 3, 4, 5, 6, 7, 8,};
+#endif
    
    if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
@@ -107,8 +112,13 @@ int main() {
    size = 4;
    vec_uc_result1 = vec_xl_len_r(data_uc, size);
 
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){ 4, 3, 2, 1, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
+#else
+   vec_uc_expected1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0,
+                                              0, 0, 0, 0, 1, 2, 3, 4 };
+#endif
    
    if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
@@ -135,8 +145,13 @@ int main() {
    size = 2;
    vec_uc_result1 = vec_xl_len_r(data_uc, size);
 
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){ 2, 1, 0, 0, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
+#else
+   vec_uc_expected1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0,
+                                              0, 0, 0, 0, 0, 0, 1, 2 };
+#endif
    
    if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
@@ -231,8 +246,13 @@ int main() {
      }
 
    /* VEC_XST_LEN_R */
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){ 16, 15, 14, 13, 12, 11, 10, 9,
 					      8, 7, 6, 5, 4, 3, 2, 1 };
+#else
+   vec_uc_expected1 = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
+					      9, 10, 11, 12, 13, 14, 15, 16 };
+#endif
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
 					   9, 10, 11, 12, 13, 14, 15, 16 };
    vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0,
@@ -265,8 +285,13 @@ int main() {
 #endif
      }
 
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){ 2, 1, 0, 0, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
+#else
+   vec_uc_expected1 = (vector unsigned char){ 15, 16, 0, 0, 0, 0, 0, 0,
+                                              0, 0, 0, 0, 0, 0, 0, 0 };
+#endif
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
 					   9, 10, 11, 12, 13, 14, 15, 16 };
    vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -299,8 +324,13 @@ int main() {
 #endif
      }
 
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){ 16, 15, 14, 13, 12, 11, 10, 9,
                                               8, 7, 6, 5, 4, 3, 2, 1 };
+#else
+   vec_uc_expected1 = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
+					      9, 10, 11, 12, 13, 14, 15, 16 };
+#endif
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
 					   9, 10, 11, 12, 13, 14, 15, 16 };
    vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0, 
@@ -333,8 +363,13 @@ int main() {
 #endif
      }
 
+#ifdef __LITTLE_ENDIAN__
    vec_uc_expected1 = (vector unsigned char){ 14, 13, 12, 11, 10, 9, 8, 7,
                                               6, 5, 4, 3, 2, 1, 0, 0 };
+#else
+   vec_uc_expected1 = (vector unsigned char){ 3, 4, 5, 6, 7, 8, 9, 10,
+                                              11, 12, 13, 14, 15, 16, 0, 0 };
+#endif
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
 					   9, 10, 11, 12, 13, 14, 15, 16 };
    vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0, 
-- 
2.40.0


             reply	other threads:[~2023-04-14  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  7:30 Jiufu Guo [this message]
2023-04-14  8:01 ` guojiufu
2023-04-14  9:09   ` Kewen.Lin
2023-04-17  2:42     ` guojiufu

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=20230414073026.2766449-1-guojiufu@linux.ibm.com \
    --to=guojiufu@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /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).