2017-07-11 Michael Collison <michael.collison@arm.com>
* config/aarch64/aarch64-simd.md(aarch64_sub<mode>_compare0):
New pattern.
* testsuite/gcc.target/aarch64/cmp-2.c: New testcase.
From-SVN: r250148
+2017-07-11 Michael Collison <michael.collison@arm.com>
+
+ * config/aarch64/aarch64-simd.md (aarch64_sub<mode>_compare0):
+ New pattern.
+
2017-07-11 Carl Love <cel@us.ibm.com>
* config/rs6000/rs6000-c.c: Add support for builtins
[(set_attr "type" "alus_sreg,alus_imm,alus_imm")]
)
+(define_insn "aarch64_sub<mode>_compare0"
+ [(set (reg:CC_NZ CC_REGNUM)
+ (compare:CC_NZ
+ (minus:GPI (match_operand:GPI 0 "register_operand" "r")
+ (match_operand:GPI 1 "aarch64_plus_operand" "r"))
+ (const_int 0)))]
+ ""
+ "cmp\\t%<w>0, %<w>1"
+ [(set_attr "type" "alus_sreg")]
+)
+
(define_insn "*compare_neg<mode>"
[(set (reg:CC_Z CC_REGNUM)
(compare:CC_Z
+2017-07-11 Michael Collison <michael.collison@arm.com>
+
+ * testsuite/gcc.target/aarch64/cmp-2.c: New testcase.
+
2017-07-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51270
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int lt (int x, int y)
+{
+ if ((x - y) < 0)
+ return 10;
+
+ return 0;
+}
+
+int ge (int x, int y)
+{
+ if ((x - y) >= 0)
+ return 10;
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-times "csel\t" 2 } } */
+/* { dg-final { scan-assembler-not "sub\t" } } */