(match_operand:SWI48 1 "nonimmediate_operand" "%0,0,rm,r"))
(match_operand:SWI48 2 "nonimmediate_operand" "r,rm,r,m")))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 2))
(match_operator:<DWI> 4 "ix86_carry_flag_operator"
- [(match_dup 3) (const_int 0)]))))
+ [(match_dup 3) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 2)))))
(set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r,r,r")
(plus:SWI48 (plus:SWI48 (match_op_dup 5
- [(match_dup 3) (const_int 0)])
+ [(match_dup 3) (const_int 0)])
(match_dup 1))
(match_dup 2)))]
"ix86_binary_operator_ok (PLUS, <MODE>mode, operands, TARGET_APX_NDD)"
(match_operand:SWI48 0 "general_reg_operand"))
(match_operand:SWI48 1 "memory_operand")))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 1))
(match_operator:<DWI> 3 "ix86_carry_flag_operator"
- [(match_dup 2) (const_int 0)]))))
+ [(match_dup 2) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 1)))))
(set (match_dup 0)
(plus:SWI48 (plus:SWI48 (match_op_dup 4
[(match_dup 2) (const_int 0)])
(match_dup 1))
(match_dup 0)))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 0))
(match_op_dup 3
- [(match_dup 2) (const_int 0)]))))
+ [(match_dup 2) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 0)))))
(set (match_dup 1)
(plus:SWI48 (plus:SWI48 (match_op_dup 4
[(match_dup 2) (const_int 0)])
(match_dup 0))
(match_operand:SWI48 2 "memory_operand")))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 2))
(match_operator:<DWI> 4 "ix86_carry_flag_operator"
- [(match_dup 3) (const_int 0)]))))
+ [(match_dup 3) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 2)))))
(set (match_dup 0)
(plus:SWI48 (plus:SWI48 (match_op_dup 5
[(match_dup 3) (const_int 0)])
(match_dup 1))
(match_dup 0)))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 0))
(match_op_dup 4
- [(match_dup 3) (const_int 0)]))))
+ [(match_dup 3) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 0)))))
(set (match_dup 1)
(plus:SWI48 (plus:SWI48 (match_op_dup 5
[(match_dup 3) (const_int 0)])
(match_operand:SWI48 0 "general_reg_operand"))
(match_operand:SWI48 1 "memory_operand")))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 1))
(match_operator:<DWI> 3 "ix86_carry_flag_operator"
- [(match_dup 2) (const_int 0)]))))
+ [(match_dup 2) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 1)))))
(set (match_dup 0)
(plus:SWI48 (plus:SWI48 (match_op_dup 4
[(match_dup 2) (const_int 0)])
(match_dup 1))
(match_dup 0)))
(plus:<DWI>
- (zero_extend:<DWI> (match_dup 0))
(match_op_dup 3
- [(match_dup 2) (const_int 0)]))))
+ [(match_dup 2) (const_int 0)])
+ (zero_extend:<DWI> (match_dup 0)))))
(set (match_dup 1)
(plus:SWI48 (plus:SWI48 (match_op_dup 4
[(match_dup 2) (const_int 0)])
(match_operand:SWI48 1 "nonimmediate_operand" "%0,rm"))
(match_operand:SWI48 2 "x86_64_immediate_operand" "e,e")))
(plus:<DWI>
- (match_operand:<DWI> 6 "const_scalar_int_operand")
(match_operator:<DWI> 4 "ix86_carry_flag_operator"
- [(match_dup 3) (const_int 0)]))))
+ [(match_dup 3) (const_int 0)])
+ (match_operand:<DWI> 6 "const_scalar_int_operand"))))
(set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r")
(plus:SWI48 (plus:SWI48 (match_op_dup 5
[(match_dup 3) (const_int 0)])
(minus:SWI48 (match_dup 1) (match_dup 2)))])]
"ix86_binary_operator_ok (MINUS, <MODE>mode, operands, TARGET_APX_NDD)")
+(define_insn "*subborrow<mode>_1"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (zero_extend:<DWI>
+ (match_operand:SWI48 1 "nonimmediate_operand" "0,rm"))
+ (plus:<DWI>
+ (match_operator:<DWI> 4 "ix86_carry_flag_operator"
+ [(match_operand 3 "flags_reg_operand") (const_int 0)])
+ (match_operand:<DWI> 6 "const_scalar_int_operand"))))
+ (set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r")
+ (plus:SWI48 (minus:SWI48
+ (match_dup 1)
+ (match_operator:SWI48 5 "ix86_carry_flag_operator"
+ [(match_dup 3) (const_int 0)]))
+ (match_operand:SWI48 2 "x86_64_immediate_operand" "e,e")))]
+ "ix86_binary_operator_ok (MINUS, <MODE>mode, operands, TARGET_APX_NDD)
+ && CONST_INT_P (operands[2])
+ /* Check that operands[6] is -operands[2] zero extended from
+ <MODE>mode to <DWI>mode. */
+ && ((<MODE>mode == SImode || -INTVAL (operands[2]) >= 0)
+ ? (CONST_INT_P (operands[6])
+ && (UINTVAL (operands[6])
+ == ((unsigned HOST_WIDE_INT) -INTVAL (operands[2])
+ & GET_MODE_MASK (<MODE>mode))))
+ : (CONST_WIDE_INT_P (operands[6])
+ && CONST_WIDE_INT_NUNITS (operands[6]) == 2
+ && ((unsigned HOST_WIDE_INT) CONST_WIDE_INT_ELT (operands[6], 0)
+ == (unsigned HOST_WIDE_INT) -INTVAL (operands[2]))
+ && CONST_WIDE_INT_ELT (operands[6], 1) == 0))"
+{
+ bool use_ndd = get_attr_isa (insn) == ISA_APX_NDD;
+
+ operands[2] = GEN_INT (-INTVAL (operands[2]));
+
+ return use_ndd ? "sbb{<imodesuffix>}\t{%2, %1, %0|%0, %1, %2}"
+ : "sbb{<imodesuffix>}\t{%2, %0|%0, %2}";
+}
+ [(set_attr "isa" "*,apx_ndd")
+ (set_attr "type" "alu")
+ (set_attr "use_carry" "1")
+ (set_attr "pent_pair" "pu")
+ (set_attr "mode" "<MODE>")
+ (set (attr "length_immediate")
+ (if_then_else (match_test "IN_RANGE (-INTVAL (operands[2]), -128, 127)")
+ (const_string "1")
+ (const_string "4")))])
+
(define_expand "uaddc<mode>5"
[(match_operand:SWI48 0 "register_operand")
(match_operand:SWI48 1 "register_operand")
(match_dup 4))
(match_dup 5)))
(plus:<DWI>
- (match_dup 6)
- (ltu:<DWI> (reg:CC FLAGS_REG) (const_int 0)))))
+ (ltu:<DWI> (reg:CC FLAGS_REG) (const_int 0))
+ (match_dup 6))))
(set (match_dup 3)
(plus:DWIH
(plus:DWIH (ltu:DWIH (reg:CC FLAGS_REG) (const_int 0))