]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc-bug-i.c: Add little endian variant.
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 28 Oct 2013 21:19:19 +0000 (21:19 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Mon, 28 Oct 2013 21:19:19 +0000 (21:19 +0000)
2013-10-28  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

* gcc.dg/vmx/gcc-bug-i.c: Add little endian variant.
* gcc.dg/vmx/eg-5.c: Likewise.

From-SVN: r204138

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vmx/eg-5.c
gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c

index 2853ec46aa879ca6d015504ff6b2aaa8e9b47df1..a0592592a4f17e6b66ed91512d8516ec6a72cfce 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-28  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       * gcc.dg/vmx/gcc-bug-i.c: Add little endian variant.
+       * gcc.dg/vmx/eg-5.c: Likewise.
+
 2013-10-28   Claudiu Zissulescu  <claziss@synopsys.com>
             Joern Rennecke  <joern.rennecke@embecosm.com>
 
index 0b37e69d194311d32ee3cf7de1b4a06d71d292c5..eb43e846b79466d8dfc3d76791fe84f64d32e15a 100644 (file)
@@ -7,10 +7,17 @@ matvecmul4 (vector float c0, vector float c1, vector float c2,
   /* Set result to a vector of f32 0's */
   vector float result = ((vector float){0.,0.,0.,0.});
 
+#ifdef __LITTLE_ENDIAN__
+  result  = vec_madd (c0, vec_splat (v, 3), result);
+  result  = vec_madd (c1, vec_splat (v, 2), result);
+  result  = vec_madd (c2, vec_splat (v, 1), result);
+  result  = vec_madd (c3, vec_splat (v, 0), result);
+#else
   result  = vec_madd (c0, vec_splat (v, 0), result);
   result  = vec_madd (c1, vec_splat (v, 1), result);
   result  = vec_madd (c2, vec_splat (v, 2), result);
   result  = vec_madd (c3, vec_splat (v, 3), result);
+#endif
 
   return result;
 }
index 97ef14488190876b5a8293ccb5f10022e5787c28..3e0e6a0793eef5c105c071d6dad1f77e845bcabc 100644 (file)
 #define DO_INLINE __attribute__ ((always_inline))
 #define DONT_INLINE __attribute__ ((noinline))
 
+#ifdef __LITTLE_ENDIAN__
+static inline DO_INLINE int inline_me(vector signed short data)
+{
+  union {vector signed short v; signed short s[8];} u;
+  signed short x;
+  unsigned char x1, x2;
+
+  u.v = data;
+  x = u.s[7];
+  x1 = (x >> 8) & 0xff;
+  x2 = x & 0xff;
+  return ((x2 << 8) | x1);
+}
+#else
 static inline DO_INLINE int inline_me(vector signed short data) 
 {
   union {vector signed short v; signed short s[8];} u;
   u.v = data;
   return u.s[7];
 }
+#endif
 
 static DONT_INLINE int foo(vector signed short data)
 {