;; Define combination compare-and-branch fp compare instructions to help
;; combine.
-(define_insn "*fp_jcc_1_387"
+(define_insn "*jcc<mode>_0_i387"
[(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand" "f")
- (match_operand 2 "nonimmediate_operand" "fm")])
+ (if_then_else (match_operator:CCFP 0 "ix86_fp_comparison_operator"
+ [(match_operand:X87MODEF 1 "register_operand" "f")
+ (match_operand:X87MODEF 2 "const0_operand")])
(label_ref (match_operand 3))
(pc)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 4 "=a"))]
- "TARGET_80387
- && (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
- && GET_MODE (operands[1]) == GET_MODE (operands[2])
- && SELECT_CC_MODE (GET_CODE (operands[0]),
- operands[1], operands[2]) == CCFPmode
- && !TARGET_CMOVE"
+ "TARGET_80387 && !TARGET_CMOVE"
"#")
-(define_insn "*fp_jcc_1r_387"
+(define_insn "*jcc<mode>_0_r_i387"
[(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand" "f")
- (match_operand 2 "nonimmediate_operand" "fm")])
+ (if_then_else (match_operator:CCFP 0 "ix86_fp_comparison_operator"
+ [(match_operand:X87MODEF 1 "register_operand" "f")
+ (match_operand:X87MODEF 2 "const0_operand")])
(pc)
(label_ref (match_operand 3))))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 4 "=a"))]
- "TARGET_80387
- && (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
- && GET_MODE (operands[1]) == GET_MODE (operands[2])
- && SELECT_CC_MODE (GET_CODE (operands[0]),
- operands[1], operands[2]) == CCFPmode
- && !TARGET_CMOVE"
+ "TARGET_80387 && !TARGET_CMOVE"
"#")
-(define_insn "*fp_jcc_2_387"
+(define_insn "*jccxf_i387"
[(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand" "f")
- (match_operand 2 "register_operand" "f")])
+ (if_then_else (match_operator:CCFP 0 "ix86_fp_comparison_operator"
+ [(match_operand:XF 1 "register_operand" "f")
+ (match_operand:XF 2 "register_operand" "f")])
(label_ref (match_operand 3))
(pc)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 4 "=a"))]
- "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
- && GET_MODE (operands[1]) == GET_MODE (operands[2])
- && !TARGET_CMOVE"
+ "TARGET_80387 && !TARGET_CMOVE"
"#")
-(define_insn "*fp_jcc_2r_387"
+(define_insn "*jccxf_r_i387"
[(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand" "f")
- (match_operand 2 "register_operand" "f")])
+ (if_then_else (match_operator:CCFP 0 "ix86_fp_comparison_operator"
+ [(match_operand:XF 1 "register_operand" "f")
+ (match_operand:XF 2 "register_operand" "f")])
(pc)
(label_ref (match_operand 3))))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 4 "=a"))]
- "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
- && GET_MODE (operands[1]) == GET_MODE (operands[2])
- && !TARGET_CMOVE"
+ "TARGET_80387 && !TARGET_CMOVE"
"#")
-(define_insn "*fp_jcc_3_387"
+(define_insn "*jcc<mode>_i387"
[(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand" "f")
- (match_operand 2 "const0_operand")])
+ (if_then_else (match_operator:CCFP 0 "ix86_fp_comparison_operator"
+ [(match_operand:MODEF 1 "register_operand" "f")
+ (match_operand:MODEF 2 "nonimmediate_operand" "fm")])
(label_ref (match_operand 3))
(pc)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 4 "=a"))]
- "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
- && GET_MODE (operands[1]) == GET_MODE (operands[2])
- && SELECT_CC_MODE (GET_CODE (operands[0]),
- operands[1], operands[2]) == CCFPmode
- && !TARGET_CMOVE"
+ "TARGET_80387 && !TARGET_CMOVE"
+ "#")
+
+(define_insn "*jcc<mode>_r_i387"
+ [(set (pc)
+ (if_then_else (match_operator:CCFP 0 "ix86_fp_comparison_operator"
+ [(match_operand:MODEF 1 "register_operand" "f")
+ (match_operand:MODEF 2 "nonimmediate_operand" "fm")])
+ (pc)
+ (label_ref (match_operand 3))))
+ (clobber (reg:CCFP FPSR_REG))
+ (clobber (reg:CCFP FLAGS_REG))
+ (clobber (match_scratch:HI 4 "=a"))]
+ "TARGET_80387 && !TARGET_CMOVE"
+ "#")
+
+(define_insn "*jccu<mode>_i387"
+ [(set (pc)
+ (if_then_else (match_operator:CCFPU 0 "ix86_fp_comparison_operator"
+ [(match_operand:X87MODEF 1 "register_operand" "f")
+ (match_operand:X87MODEF 2 "register_operand" "f")])
+ (label_ref (match_operand 3))
+ (pc)))
+ (clobber (reg:CCFP FPSR_REG))
+ (clobber (reg:CCFP FLAGS_REG))
+ (clobber (match_scratch:HI 4 "=a"))]
+ "TARGET_80387 && !TARGET_CMOVE"
+ "#")
+
+(define_insn "*jccu<mode>_r_i387"
+ [(set (pc)
+ (if_then_else (match_operator:CCFPU 0 "ix86_fp_comparison_operator"
+ [(match_operand:X87MODEF 1 "register_operand" "f")
+ (match_operand:X87MODEF 2 "register_operand" "f")])
+ (pc)
+ (label_ref (match_operand 3))))
+ (clobber (reg:CCFP FPSR_REG))
+ (clobber (reg:CCFP FLAGS_REG))
+ (clobber (match_scratch:HI 4 "=a"))]
+ "TARGET_80387 && !TARGET_CMOVE"
"#")
(define_split
[(set (pc)
(if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand")
- (match_operand 2 "nonimmediate_operand")])
+ [(match_operand:X87MODEF 1 "register_operand")
+ (match_operand:X87MODEF 2 "nonimmediate_operand")])
(match_operand 3)
(match_operand 4)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))]
- "reload_completed"
+ "TARGET_80387 && !TARGET_CMOVE
+ && reload_completed"
[(const_int 0)]
{
ix86_split_fp_branch (GET_CODE (operands[0]), operands[1], operands[2],
(define_split
[(set (pc)
(if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(match_operand 1 "register_operand")
- (match_operand 2 "general_operand")])
+ [(match_operand:X87MODEF 1 "register_operand")
+ (match_operand:X87MODEF 2 "general_operand")])
(match_operand 3)
(match_operand 4)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
- (clobber (match_scratch:HI 5 "=a"))]
- "reload_completed"
+ (clobber (match_scratch:HI 5))]
+ "TARGET_80387 && !TARGET_CMOVE
+ && reload_completed"
[(const_int 0)]
{
ix86_split_fp_branch (GET_CODE (operands[0]), operands[1], operands[2],
DONE;
})
-;; The order of operands in *fp_jcc_4_387 is forced by combine in
+;; The order of operands in *jcc<fp>_<int>_i387 is forced by combine in
;; simplify_comparison () function. Float operator is treated as RTX_OBJ
;; with a precedence over other operators and is always put in the first
;; place. Swap condition and operands to match ficom instruction.
-(define_insn "*fp_jcc_4_<mode>_387"
+(define_insn "*jcc<X87MODEF:mode>_<SWI24:mode>_i387"
[(set (pc)
(if_then_else
- (match_operator 0 "ix86_swapped_fp_comparison_operator"
- [(match_operator 1 "float_operator"
+ (match_operator:CCFP 0 "ix86_swapped_fp_comparison_operator"
+ [(match_operator:X87MODEF 1 "float_operator"
[(match_operand:SWI24 2 "nonimmediate_operand" "m,?r")])
- (match_operand 3 "register_operand" "f,f")])
+ (match_operand:X87MODEF 3 "register_operand" "f,f")])
(label_ref (match_operand 4))
(pc)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 5 "=a,a"))]
- "X87_FLOAT_MODE_P (GET_MODE (operands[3]))
- && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))
- && GET_MODE (operands[1]) == GET_MODE (operands[3])
- && ix86_fp_compare_mode (swap_condition (GET_CODE (operands[0]))) == CCFPmode
- && !TARGET_CMOVE"
+ "TARGET_80387 && !TARGET_CMOVE
+ && (TARGET_USE_<SWI24:MODE>MODE_FIOP
+ || optimize_function_for_size_p (cfun))"
+ "#")
+
+(define_insn "*jcc<X87MODEF:mode>_<SWI24:mode>_r_i387"
+ [(set (pc)
+ (if_then_else
+ (match_operator:CCFP 0 "ix86_swapped_fp_comparison_operator"
+ [(match_operator:X87MODEF 1 "float_operator"
+ [(match_operand:SWI24 2 "nonimmediate_operand" "m,?r")])
+ (match_operand:X87MODEF 3 "register_operand" "f,f")])
+ (pc)
+ (label_ref (match_operand 4))))
+ (clobber (reg:CCFP FPSR_REG))
+ (clobber (reg:CCFP FLAGS_REG))
+ (clobber (match_scratch:HI 5 "=a,a"))]
+ "TARGET_80387 && !TARGET_CMOVE
+ && (TARGET_USE_<SWI24:MODE>MODE_FIOP
+ || optimize_function_for_size_p (cfun))"
"#")
(define_split
[(set (pc)
(if_then_else
- (match_operator 0 "ix86_swapped_fp_comparison_operator"
- [(match_operator 1 "float_operator"
+ (match_operator:CCFP 0 "ix86_swapped_fp_comparison_operator"
+ [(match_operator:X87MODEF 1 "float_operator"
[(match_operand:SWI24 2 "memory_operand")])
- (match_operand 3 "register_operand")])
+ (match_operand:X87MODEF 3 "register_operand")])
(match_operand 4)
(match_operand 5)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
- (clobber (match_scratch:HI 6 "=a"))]
- "reload_completed"
+ (clobber (match_scratch:HI 6))]
+ "TARGET_80387 && !TARGET_CMOVE
+ && reload_completed"
[(const_int 0)]
{
- operands[7] = gen_rtx_FLOAT (GET_MODE (operands[1]), operands[2]);
-
- ix86_split_fp_branch (swap_condition (GET_CODE (operands[0])),
- operands[3], operands[7],
+ ix86_split_fp_branch (swap_condition (GET_CODE (operands[0])), operands[3],
+ gen_rtx_FLOAT (GET_MODE (operands[1]), operands[2]),
operands[4], operands[5], operands[6], NULL_RTX);
DONE;
})
(define_split
[(set (pc)
(if_then_else
- (match_operator 0 "ix86_swapped_fp_comparison_operator"
- [(match_operator 1 "float_operator"
+ (match_operator:CCFP 0 "ix86_swapped_fp_comparison_operator"
+ [(match_operator:X87MODEF 1 "float_operator"
[(match_operand:SWI24 2 "register_operand")])
- (match_operand 3 "register_operand")])
+ (match_operand:X87MODEF 3 "register_operand")])
(match_operand 4)
(match_operand 5)))
(clobber (reg:CCFP FPSR_REG))
(clobber (reg:CCFP FLAGS_REG))
- (clobber (match_scratch:HI 6 "=a"))]
- "reload_completed"
+ (clobber (match_scratch:HI 6))]
+ "TARGET_80387 && !TARGET_CMOVE
+ && reload_completed"
[(const_int 0)]
{
- operands[7] = ix86_force_to_memory (GET_MODE (operands[2]), operands[2]);
- operands[7] = gen_rtx_FLOAT (GET_MODE (operands[1]), operands[7]);
+ rtx tmp = ix86_force_to_memory (GET_MODE (operands[2]), operands[2]);
- ix86_split_fp_branch (swap_condition (GET_CODE (operands[0])),
- operands[3], operands[7],
+ ix86_split_fp_branch (swap_condition (GET_CODE (operands[0])), operands[3],
+ gen_rtx_FLOAT (GET_MODE (operands[1]), tmp),
operands[4], operands[5], operands[6], operands[2]);
DONE;
})