The test case added for PR91275 fails on big-endian because 
__builtin_crypto_vpmsumd
is not a bi-endian intrinsic; source code must account for endian differences 
when
calling this intrinsic.  Fixed this and a type issue that only shows up on 
32-bit.
I thought I had previously tested this on P8 BE, but clearly not.

Tested on powerpc64-unknown-linux-gnu, committed as obvious.  Will backport 
soon.

Thanks,
Bill


2019-10-15  Bill Schmidt  <wschm...@linux.ibm.com>

        PR target/92093
        * gcc.target/powerpc/pr91275.c: Fix type and endian issues.


Index: gcc/testsuite/gcc.target/powerpc/pr91275.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/pr91275.c  (revision 276968)
+++ gcc/testsuite/gcc.target/powerpc/pr91275.c  (working copy)
@@ -10,12 +10,17 @@ int main() {
   const unsigned long long r0l = 0x8e7dfceac070e3a0;
   vector unsigned long long r0 = (vector unsigned long long) {r0l, 0}, v;
   const vector unsigned long long pd
-    = (vector unsigned long) {0xc2LLU << 56, 0};
+    = (vector unsigned long long) {0xc2LLU << 56, 0};
v = __builtin_crypto_vpmsumd ((vector unsigned long long) {r0[0], 0}, pd); +#if __LITTLE_ENDIAN__
   if (v[0] != 0x4000000000000000 || v[1] != 0x65bd7ab605a4a8ff)
     __builtin_abort ();
+#else
+  if (v[1] != 0x4000000000000000 || v[0] != 0x65bd7ab605a4a8ff)
+    __builtin_abort ();
+#endif
return 0;
 }

Reply via email to