re PR target/52480 (SH Target: SH4A movua.l does not work for big endian)
authorOleg Endo <olegendo@gcc.gnu.org>
Wed, 10 Oct 2012 00:50:37 +0000 (00:50 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Wed, 10 Oct 2012 00:50:37 +0000 (00:50 +0000)
PR target/52480
* config/sh/sh.md (extv, extzv): Check that operands[3] is zero,
regardless of the endianness.

PR target/52480
* gcc.target/sh/sh4a-bitmovua.c: Compact skip-if list.
Add runtime tests.

From-SVN: r192283

gcc/ChangeLog
gcc/config/sh/sh.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/sh4a-bitmovua.c

index bb1345e7fe2b5c3b7b15e24123812df1c738569a..00a61de7628c9541def397f27a319d2f5a97ae11 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-10  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/52480
+       * config/sh/sh.md (extv, extzv): Check that operands[3] is zero,
+       regardless of the endianness.
+
 2012-10-09  Lawrence Crowl  <crowl@google.com>
 
        * Makefile.in (fold-const.o): Add depencence on hash-table.h.
index 0a1cd09c1f8db6f446dfaf829518d4d16a3018af..a0b1e8891f86ecd087164079caeacfa124c94c1d 100644 (file)
@@ -12706,7 +12706,7 @@ label:
    }
   if (TARGET_SH4A_ARCH
       && INTVAL (operands[2]) == 32
-      && INTVAL (operands[3]) == -24 * (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
+      && INTVAL (operands[3]) == 0
       && MEM_P (operands[1]) && MEM_ALIGN (operands[1]) < 32)
     {
       rtx src = adjust_address (operands[1], BLKmode, 0);
@@ -12738,7 +12738,7 @@ label:
     }
   if (TARGET_SH4A_ARCH
       && INTVAL (operands[2]) == 32
-      && INTVAL (operands[3]) == -24 * (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
+      && INTVAL (operands[3]) == 0
       && MEM_P (operands[1]) && MEM_ALIGN (operands[1]) < 32)
     {
       rtx src = adjust_address (operands[1], BLKmode, 0);
index 8b024bb012196d87ae760ce93fff6d649f72d4e4..a9d2fbd4f52cf7abca0d546cbaef7df2a8948e07 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-10  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR target/52480
+       * gcc.target/sh/sh4a-bitmovua.c: Compact skip-if list.
+       Add runtime tests.
+
 2012-10-10  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/53307
index 1c9ae6ee6bdfa2917245d225dfa376f88ae5cc1d..7912fbc551d8d6fe7e4fd8a30a9e7fa8ed7339fa 100644 (file)
@@ -1,7 +1,7 @@
 /* Verify that we generate movua to load unaligned 32-bit values on SH4A.  */
-/* { dg-do compile { target "sh*-*-*" } } */
-/* { dg-options "-O" } */
-/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" "-m4a-nofpu" } }  */
+/* { dg-do run { target "sh*-*-*" } } */
+/* { dg-options "-O1 -save-temps -fno-inline" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a*" } }  */
 /* { dg-final { scan-assembler-times "movua.l" 6 } } */
 
 /* Aligned.  */
@@ -64,4 +64,28 @@ unsigned long long g4() {
   return y4.d;
 }
 
+#include <assert.h>
 
+int
+main (void)
+{
+  x1.d = 0x12345678;
+  assert (f1 () == 0x12345678);
+
+  x2.d = 0x12345678;
+  assert (f2 () == 0x12345678);
+
+  x3.d = 0x12345678;
+  assert (f3 () == 0x12345678);
+
+  y_1.d = 0x12345678;
+  assert (g1 () == 0x12345678);
+
+  y2.d = 0x12345678;
+  assert (g2 () == 0x12345678);
+
+  y3.d = 0x12345678;
+  assert (g3 () == 0x12345678);
+
+  return 0;
+}