@@ -3120,7 +3120,7 @@
[(set_attr "type" "alus_imm")]
)
-(define_insn "sub<mode>3_compare1"
+(define_insn "*sub<mode>3_compare1"
[(set (reg:CC CC_REGNUM)
(compare:CC
(match_operand:GPI 1 "aarch64_reg_or_zero" "rkZ")
@@ -3132,6 +3132,26 @@
[(set_attr "type" "alus_sreg")]
)
+(define_expand "sub<mode>3_compare1"
+ [(parallel
+ [(set (reg:CC CC_REGNUM)
+ (compare:CC
+ (match_operand:GPI 1 "aarch64_reg_or_zero")
+ (match_operand:GPI 2 "aarch64_reg_or_imm")))
+ (set (match_operand:GPI 0 "register_operand")
+ (minus:GPI (match_dup 1) (match_dup 2)))])]
+ ""
+{
+ if (aarch64_plus_immediate (operands[2], <MODE>mode))
+ {
+ emit_insn (gen_sub<mode>3_compare1_imm
+ (operands[0], operands[1], operands[2],
+ GEN_INT (-INTVAL (operands[2]))));
+ DONE;
+ }
+ operands[2] = force_reg (<MODE>mode, operands[2]);
+})
+
(define_peephole2
[(set (match_operand:GPI 0 "aarch64_general_reg")
(minus:GPI (match_operand:GPI 1 "aarch64_reg_or_zero")