]> gcc.gnu.org Git - gcc.git/commitdiff
epiphany.c (epiphany_rtx_cost): Compare with CC_N_NE / CC_C_LTU / CC_C_GTU carries...
authorJoern Rennecke <joern.rennecke@embecosm.com>
Fri, 11 Apr 2014 18:29:30 +0000 (18:29 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 11 Apr 2014 18:29:30 +0000 (19:29 +0100)
    gcc:
            * config/epiphany/epiphany.c (epiphany_rtx_cost): Compare
            with CC_N_NE / CC_C_LTU / CC_C_GTU carries no extra cost for
            its operands.
    gcc/testsuite:
            * gcc.target/epiphany/btst-1.c: New test.

From-SVN: r209319

gcc/ChangeLog
gcc/config/epiphany/epiphany.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/epiphany/btst-1.c [new file with mode: 0644]

index 32ed05f445221159cf5e892af598893951f2449c..a9ecf69ac3cb851c70e25e6b2993b2b42e7cac74 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-11  Joern Rennecke  <joern.rennecke@embecosm.com>
+
+       * config/epiphany/epiphany.c (epiphany_rtx_cost): Compare
+       with CC_N_NE / CC_C_LTU / CC_C_GTU carries no extra cost for
+       its operands.
+
 2014-04-11  Joern Rennecke  <joern.rennecke@embecosm.com>
 
        PR rtl-optimization/60651
index 59b24107a6892cadbf41775a2e4779d75cd06cf6..8e45ea756d22c29241872c56bacbb882eedf557e 100644 (file)
@@ -763,6 +763,19 @@ epiphany_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
       *total = COSTS_N_INSNS (1);
       return true;
 
+    case COMPARE:
+      switch (GET_MODE (x))
+       {
+       /* There are a number of single-insn combiner patterns that use
+          the flag side effects of arithmetic.  */
+       case CC_N_NEmode:
+       case CC_C_LTUmode:
+       case CC_C_GTUmode:
+         return true;
+       default:
+         return false;
+       }
+
     default:
       return false;
     }
index e7f800a1cb1aafa9669ecbdc7946235a062076ef..9c3c3e4bfcd0310f4a7702666157d127c5f1bd25 100644 (file)
@@ -1,3 +1,7 @@
+2014-04-11  Joern Rennecke  <joern.rennecke@embecosm.com>
+
+       * gcc.target/epiphany/btst-1.c: New test.
+
 2014-04-11  Joern Rennecke  <joern.rennecke@embecosm.com>
 
        PR rtl-optimization/60651
diff --git a/gcc/testsuite/gcc.target/epiphany/btst-1.c b/gcc/testsuite/gcc.target/epiphany/btst-1.c
new file mode 100644 (file)
index 0000000..b5667cc
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-common" } */
+/* { dg-final { scan-assembler-not "movt" } } */
+/* { dg-final { scan-assembler-not "and" } } */
+/* { dg-final { scan-assembler "lsl" } } */
+
+int
+tst (int i)
+{
+  return (i & (1<<21)) ? 6 : 9;
+}
This page took 0.076529 seconds and 5 git commands to generate.