This pattern is not strictly necessary and a similar effect could
be achieved through the use of a suitable compatibility relation
for CC modes; in the meantime, this helps on some benchmarks.
---
gcc/config/aarch64/aarch64.md | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 13a75d3..60e42af 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -2159,6 +2159,19 @@
[(set_attr "type" "alus_reg,alus_imm,alus_imm")]
)
+;; variant that generates a CC_NZ output mode
+(define_insn "*cmp<mode>_nz"
+ [(set (reg:CC_NZ CC_REGNUM)
+ (compare:CC_NZ (match_operand:GPI 0 "register_operand" "r,r,r")
+ (match_operand:GPI 1 "aarch64_plus_operand" "r,I,J")))]
+ ""
+ "@
+ cmp\\t%<w>0, %<w>1
+ cmp\\t%<w>0, %<w>1
+ cmn\\t%<w>0, #%n1"
+ [(set_attr "type" "alus_reg,alus_imm,alus_imm")]
+)
+
(define_insn "*cmp<mode>"
[(set (reg:CCFP CC_REGNUM)
(compare:CCFP (match_operand:GPF 0 "register_operand" "w,w")
--
1.9.0