]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ChangeLog:
authorxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Aug 2013 06:38:26 +0000 (06:38 +0000)
committerxguo <xguo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Aug 2013 06:38:26 +0000 (06:38 +0000)
2013-08-09  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

        * config/arm/neon.md (vcond): Fix floating-point vector
        comparisons against 0.

testsuite/ChangeLog:
2013-08-09  Zhenqiang Chen  <zhenqiang.chen@linaro.org>

        * gcc.target/arm/lp1189445.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201618 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/neon.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/lp1189445.c [new file with mode: 0644]

index 33e54ef54c4235924eb11bab72ad9d3443c7e133..c2240dbce685838918432cfd4287a11522b34745 100644 (file)
@@ -1,3 +1,8 @@
+2013-08-09  Zhenqiang Chen  <zhenqiang.chen@linaro.org>
+
+       * config/arm/neon.md (vcond): Fix floating-point vector
+       comparisons against 0.
+
 2013-08-08  Vladimir Makarov  <vmakarov@redhat.com>
 
        * lra-constraints.c (emit_spill_move): Remove assert.
index d0ca6b9ae794340c5d1d7d5ed554563af078c2d0..e00ca2c7bf982f71c377dec73ee438687aadad02 100644 (file)
                             ? 3 : 1;
   rtx magic_rtx = GEN_INT (magic_word);
   int inverse = 0;
+  int use_zero_form = 0;
   int swap_bsl_operands = 0;
   rtx mask = gen_reg_rtx (<V_cmp_result>mode);
   rtx tmp = gen_reg_rtx (<V_cmp_result>mode);
   switch (GET_CODE (operands[3]))
     {
     case GE:
+    case GT:
     case LE:
+    case LT:
     case EQ:
-      if (!REG_P (operands[5])
-         && (operands[5] != CONST0_RTX (<MODE>mode)))
-       operands[5] = force_reg (<MODE>mode, operands[5]);
-      break;
+      if (operands[5] == CONST0_RTX (<MODE>mode))
+       {
+         use_zero_form = 1;
+         break;
+       }
+      /* Fall through.  */
     default:
       if (!REG_P (operands[5]))
        operands[5] = force_reg (<MODE>mode, operands[5]);
         a GT b -> a GT b
         a LE b -> b GE a
         a LT b -> b GT a
-        a EQ b -> a EQ b  */
+        a EQ b -> a EQ b
+        Note that there also exist direct comparison against 0 forms,
+        so catch those as a special case.  */
+      if (use_zero_form)
+       {
+         inverse = 0;
+         switch (GET_CODE (operands[3]))
+           {
+           case LT:
+             base_comparison = gen_neon_vclt<mode>;
+             break;
+           case LE:
+             base_comparison = gen_neon_vcle<mode>;
+             break;
+           default:
+             /* Do nothing, other zero form cases already have the correct
+                base_comparison.  */
+             break;
+           }
+       }
 
       if (!inverse)
        emit_insn (base_comparison (mask, operands[4], operands[5], magic_rtx));
index d86db3082a990417f4fff72fb0d524525bc755ea..24efd3e1317588f8c97b85249260e49a68ff5e30 100644 (file)
@@ -1,3 +1,7 @@
+2013-08-09  Zhenqiang Chen  <zhenqiang.chen@linaro.org>
+
+       * gcc.target/arm/lp1189445.c: New testcase.
+
 2013-08-08  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.dg/torture/pr58079.c: New test.
diff --git a/gcc/testsuite/gcc.target/arm/lp1189445.c b/gcc/testsuite/gcc.target/arm/lp1189445.c
new file mode 100644 (file)
index 0000000..766748e
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_neon } */
+/* { dg-add-options arm_neon } */
+/* { dg-options "-O3" } */
+
+int id;
+int
+test (const long int *data)
+{
+  int i, retval;
+  retval = id;
+  for (i = 0; i < id; i++)
+    {
+      retval &= (data[i] <= 0);
+    }
+
+  return (retval);
+}