A recent change added UNSPEC to the CCMP patterns to stop combine optimizing the...
authorWilco Dijkstra <wdijkstr@arm.com>
Thu, 28 Jan 2016 15:41:46 +0000 (15:41 +0000)
committerWilco Dijkstra <wilco@gcc.gnu.org>
Thu, 28 Jan 2016 15:41:46 +0000 (15:41 +0000)
A recent change added UNSPEC to the CCMP patterns to stop combine optimizing
the immediate in a rare case.  This requires a fix to the CCMP cost
calculation as the CCMP instruction with unspec is no longer recognized.
Fix the ccmp_1.c test by adding -ffinite-math-only so FCCMPE is emitted on
relational compares.

2016-01-28  Wilco Dijkstra  <wdijkstr@arm.com>

    gcc/
* config/aarch64/aarch64.c (aarch64_if_then_else_costs):
Remove CONST_INT_P check in CCMP cost calculation.

    gcc/testsuite/
* gcc.target/aarch64/ccmp_1.c: Fix test issue.

From-SVN: r232930

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/ccmp_1.c

index 1967e92279834cf66a33a14632724a527e8d6f31..551dedfc2d227cd30c08c6e5cc11a1a715111254 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-28  Wilco Dijkstra  <wdijkstr@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_if_then_else_costs):
+       Remove CONST_INT_P check in CCMP cost calculation.
+
 2016-01-28  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/aarch64/aarch64.c (generic_vector_cost):
index 5b3771eca6744c3dce7549468817d971e84091c4..bba7a9b6f42c2587cefbcb84dd6ace6a5de4b1a8 100644 (file)
@@ -6010,7 +6010,7 @@ aarch64_if_then_else_costs (rtx op0, rtx op1, rtx op2, int *cost, bool speed)
   else if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC)
     {
       /* CCMP.  */
-      if ((GET_CODE (op1) == COMPARE) && CONST_INT_P (op2))
+      if (GET_CODE (op1) == COMPARE)
        {
          /* Increase cost of CCMP reg, 0, imm, CC to prefer CMP reg, 0.  */
          if (XEXP (op1, 1) == const0_rtx)
index afc6d6fb6e8b3eea202cff95f7dd14297a6ebeaa..6e5e218815361ed31dc90a2d8abd8bb6f653d9d0 100644 (file)
@@ -1,3 +1,7 @@
+2016-01-28  Wilco Dijkstra  <wdijkstr@arm.com>
+
+       * gcc.target/aarch64/ccmp_1.c: Fix test issue.
+
 2016-01-28  David Edelsohn  <dje.gcc@gmail.com>
 
        * gcc.dg/pr65980.c: Skip on AIX.
index 7c39b61a585a1d4d662b0736e1c80e06bdc6b4ce..fd38b2cfdb834c6395ddb939b54d23345c51b8d9 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -ffinite-math-only" } */
 
 int
 f1 (int a)