re PR target/39726 ([cond-optab] ColdFire pessimizations on QImode/HImode tests)
authorJeff Law <law@redhat.com>
Wed, 27 May 2015 21:13:25 +0000 (15:13 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 27 May 2015 21:13:25 +0000 (15:13 -0600)
        PR target/39726
        * gcc.dg/target/m68k/pr39726-1.c: New test.

From-SVN: r223781

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/m68k/pr39726.c [new file with mode: 0644]

index 76bb537db1b19e423f56ce64786af1fe7fef75f7..6528d42438a84a62d71c705986a405cbffe6cf1f 100644 (file)
 
 2015-05-07  Jeff Law  <law@redhat.com>
 
+       PR target/39726
        * match.pd (bit_and (plus/minus (convert @0) (convert @1) mask): New
        simplifier to narrow arithmetic.
        * generic-match-head.c: (types_match, single_use): New functions.
index 1923a2f2fba3fb80f8fdcbedd2d237fafcbd8126..a1a242e3bb52f77163a95ca19310dbc969089e0b 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-27  Jeff Law  <law@redhat.com>
+
+       PR target/39726
+       * gcc.dg/target/m68k/pr39726-1.c: New test.
+
 2015-05-27  Nathan Sidwell  <nathan@acm.org>
 
        PR c++/66270
diff --git a/gcc/testsuite/gcc.target/m68k/pr39726.c b/gcc/testsuite/gcc.target/m68k/pr39726.c
new file mode 100644 (file)
index 0000000..94d41ba
--- /dev/null
@@ -0,0 +1,65 @@
+/* { dg-do assemble } /*
+/* { dg-options "-O2 -fomit-frame-pointer" } */
+/* { dg-final { object-size text <= 228 } } */
+
+unsigned char v;
+
+int a0bs (unsigned char u, unsigned char w)
+{
+  if ((u - w) & 0x80)
+    v = 1;
+}
+
+int a1bs (unsigned char u, unsigned char w)
+{
+  if ((u + w) & 0x80)
+    v = 1;
+}
+
+int a0b (unsigned char u, unsigned char w)
+{
+  if ((u - w) & 0x22)
+    v = 1;
+}
+
+int a1b (unsigned char u, unsigned char w)
+{
+  if ((u + w) & 0x22)
+    v = 1;
+}
+
+int a0ws (unsigned short u, unsigned short w)
+{
+  if ((u - w) & 0x8000)
+    v = 1;
+}
+
+int a1ws (unsigned short u, unsigned short w)
+{
+  if ((u + w) & 0x8000)
+    v = 1;
+}
+
+int a0wbs (unsigned short u, unsigned short w)
+{
+  if ((u - w) & 0x80)
+    v = 1;
+}
+
+int a1wbs (unsigned short u, unsigned short w)
+{
+  if ((u + w) & 0x80)
+    v = 1;
+}
+
+int a0w (unsigned short u, unsigned short w)
+{
+  if ((u - w) & 0x8421)
+    v = 1;
+}
+
+int a1w (unsigned short u, unsigned short w)
+{
+  if ((u + w) & 0x8421)
+    v = 1;
+}