+2017-10-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*cmp<X87MODEF:mode>_<SWI24:mode>_i387):
+ Do not use float_operator operator predicate.
+ (*cmp<X87MODEF:mode>_<SWI24:mode>_cc_i387): Ditto.
+ * config/i386/predicates.md (float_operator): Remove predicate.
+
+2017-10-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*jcc<mode>_0_i387): Remove insn pattern.
+ (*jccxf_i387): Ditto.
+ (*jcc<mode>_i387): Ditto.
+ (*jccu<mode>_i387): Ditto.
+ (*jcc<X87MODEF:mode>_<SWI24:mode>_i387): Ditto.
+ (*jcc_*_i387 splitters): Remove.
+ * config/i386/i386-protos.h (ix86_split_fp_branch): Remove prototype.
+ * config/i386/i386.c (ix86_split_fp_branch): Remove.
+ * config/i386/predicates.md (ix86_swapped_fp_comparison_operator):
+ Remove predicate.
+
2017-10-11 Jan Hubicka <hubicka@ucw.cz>
* profile-count.h (slow_safe_scale_64bit): New function.
(ix86_atom_sched_reorder): Declare.
* i386/i386.c Move all CPU cost tables to x86-tune-costs.h.
(COSTS_N_BYTES): Move to x86-tune-costs.h.
- (DUMMY_STRINGOP_ALGS):x86-tune-costs.h.
+ (DUMMY_STRINGOP_ALGS):Move to x86-tune-costs.h.
(rip_relative_addr_p): Rename to ...
(ix86_rip_relative_addr_p): ... this one; export.
(memory_address_length): Update.
(unspec:HI
[(compare:CCFP
(match_operand:X87MODEF 1 "register_operand" "f")
- (match_operator:X87MODEF 3 "float_operator"
- [(match_operand:SWI24 2 "memory_operand" "m")]))]
+ (float:X87MODEF
+ (match_operand:SWI24 2 "memory_operand" "m")))]
UNSPEC_FNSTSW))]
"TARGET_80387
&& (TARGET_USE_<SWI24:MODE>MODE_FIOP
[(set (reg:CCFP FLAGS_REG)
(compare:CCFP
(match_operand:X87MODEF 1 "register_operand" "f")
- (match_operator:X87MODEF 3 "float_operator"
- [(match_operand:SWI24 2 "memory_operand" "m")])))
+ (float:X87MODEF
+ (match_operand:SWI24 2 "memory_operand" "m"))))
(clobber (match_operand:HI 0 "register_operand" "=a"))]
"TARGET_80387 && TARGET_SAHF && !TARGET_CMOVE
&& (TARGET_USE_<SWI24:MODE>MODE_FIOP
(unspec:HI
[(compare:CCFP
(match_dup 1)
- (match_op_dup 3 [(match_dup 2)]))]
+ (float:X87MODEF (match_dup 2)))]
UNSPEC_FNSTSW))
(set (reg:CC FLAGS_REG)
(unspec:CC [(match_dup 0)] UNSPEC_SAHF))]
if (! ix86_comparison_operator (operands[0], VOIDmode))
FAIL;
})
-
-;; Define combination compare-and-branch fp compare instructions to help
-;; combine.
-
-(define_insn "*jcc<mode>_0_i387"
- [(set (pc)
- (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 && !TARGET_CMOVE"
- "#")
-
-(define_insn "*jccxf_i387"
- [(set (pc)
- (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"))]
- "TARGET_80387 && !TARGET_CMOVE"
- "#")
-
-(define_insn "*jcc<mode>_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")])
- (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>_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_split
- [(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(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))]
- "TARGET_80387 && !TARGET_CMOVE
- && reload_completed"
- [(const_int 0)]
-{
- ix86_split_fp_branch (GET_CODE (operands[0]), operands[1], operands[2],
- operands[3], operands[4], NULL_RTX);
- DONE;
-})
-
-(define_split
- [(set (pc)
- (if_then_else (match_operator 0 "ix86_fp_comparison_operator"
- [(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))]
- "TARGET_80387 && !TARGET_CMOVE
- && reload_completed"
- [(const_int 0)]
-{
- ix86_split_fp_branch (GET_CODE (operands[0]), operands[1], operands[2],
- operands[3], operands[4], operands[5]);
- DONE;
-})
-
-;; 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 "*jcc<X87MODEF:mode>_<SWI24:mode>_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")])
- (match_operand:X87MODEF 3 "register_operand" "f")])
- (label_ref (match_operand 4))
- (pc)))
- (clobber (reg:CCFP FPSR_REG))
- (clobber (reg:CCFP FLAGS_REG))
- (clobber (match_scratch:HI 5 "=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:CCFP 0 "ix86_swapped_fp_comparison_operator"
- [(match_operator:X87MODEF 1 "float_operator"
- [(match_operand:SWI24 2 "memory_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))]
- "TARGET_80387 && !TARGET_CMOVE
- && reload_completed"
- [(const_int 0)]
-{
- 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]);
- DONE;
-})
\f
;; Unconditional and other jump instructions
(match_operand 0 "comparison_operator")
(match_operand 0 "ix86_trivial_fp_comparison_operator")))
-;; Same as above, but for swapped comparison used in *jcc<fp>_<int>_i387.
-(define_predicate "ix86_swapped_fp_comparison_operator"
- (match_operand 0 "comparison_operator")
-{
- enum rtx_code code = GET_CODE (op);
- bool ret;
-
- PUT_CODE (op, swap_condition (code));
- ret = ix86_fp_comparison_operator (op, mode);
- PUT_CODE (op, code);
- return ret;
-})
-
;; Nearly general operand, but accept any const_double, since we wish
;; to be able to drop them into memory rather than have them get pulled
;; into registers.
(define_predicate "plusminuslogic_operator"
(match_code "plus,minus,and,ior,xor"))
-;; Return true if this is a float extend operation.
-(define_predicate "float_operator"
- (match_code "float"))
-
;; Return true for ARITHMETIC_P.
(define_predicate "arith_or_logical_operator"
(match_code "plus,mult,and,ior,xor,smin,smax,umin,umax,compare,minus,div,