aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2012-11-22 22:13:56 +0100
committerUros Bizjak <uros@gcc.gnu.org>2012-11-22 22:13:56 +0100
commit31daf7a352524c596e0e9eb3dde4be777572e451 (patch)
tree5280f3f7a99b5a5675bc4096c3e8731dbac216a1
parentf6d53c025b05f7b624da194efabfae3b3aef9fb9 (diff)
downloadgcc-31daf7a352524c596e0e9eb3dde4be777572e451.zip
gcc-31daf7a352524c596e0e9eb3dde4be777572e451.tar.gz
gcc-31daf7a352524c596e0e9eb3dde4be777572e451.tar.bz2
i386.md (*jcc<mode>_0_i387): Macroize insn from *fp_jcc_3_387 using X87MODEF mode iterator.
* config/i386/i386.md (*jcc<mode>_0_i387): Macroize insn from *fp_jcc_3_387 using X87MODEF mode iterator. (*jcc<mode>_0_r_i387): New. (*jccxf_i387): Ditto. (*jccxf_r_i387): Ditto. (*jcc<mode>_i387): Macroize insn from *fp_jcc_1_387 using MODEF mode iterator. (*jcc<mode>_r_i387): Macroize insn from *fp_jcc_1r_387 using MODEF mode iterator. (*jccu<mode>_i387): Macroize insn from *fp_jcc_2_387 using X87MODEF mode iterator. (*jccu<mode>_r_i387): Macroize insn from *fp_jcc_2r_387 using X87MODEF mode iterator. (*jcc{,u}<mode>_i387 splitters): Macroize splitters using X87MODEF mode iterator. (*jcc<X87MODEF:mode>_<SWI24:mode>_i387): Macroize insn from *fp_jcc_4_<mode>_387 using X87MODEF mode iterator. (*jcc<X87MODEF:mode>_<SWI24:mode>_r_i387): New. (*jcc<X87MODEF:mode>_<SWI24:mode>_i387 splitters): Macroize splitters using X87MODEF and SWI24 mode iterators. From-SVN: r193734
-rw-r--r--gcc/ChangeLog23
-rw-r--r--gcc/config/i386/i386.md193
-rw-r--r--gcc/config/i386/predicates.md2
3 files changed, 139 insertions, 79 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 53b534f..a57c386 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -4,6 +4,29 @@
2012-11-22 Uros Bizjak <ubizjak@gmail.com>
+ * config/i386/i386.md (*jcc<mode>_0_i387): Macroize insn
+ from *fp_jcc_3_387 using X87MODEF mode iterator.
+ (*jcc<mode>_0_r_i387): New.
+ (*jccxf_i387): Ditto.
+ (*jccxf_r_i387): Ditto.
+ (*jcc<mode>_i387): Macroize insn from *fp_jcc_1_387 using
+ MODEF mode iterator.
+ (*jcc<mode>_r_i387): Macroize insn from *fp_jcc_1r_387 using
+ MODEF mode iterator.
+ (*jccu<mode>_i387): Macroize insn from *fp_jcc_2_387 using
+ X87MODEF mode iterator.
+ (*jccu<mode>_r_i387): Macroize insn from *fp_jcc_2r_387 using
+ X87MODEF mode iterator.
+ (*jcc{,u}<mode>_i387 splitters): Macroize splitters using
+ X87MODEF mode iterator.
+ (*jcc<X87MODEF:mode>_<SWI24:mode>_i387): Macroize insn
+ from *fp_jcc_4_<mode>_387 using X87MODEF mode iterator.
+ (*jcc<X87MODEF:mode>_<SWI24:mode>_r_i387): New.
+ (*jcc<X87MODEF:mode>_<SWI24:mode>_i387 splitters): Macroize
+ splitters using X87MODEF and SWI24 mode iterators.
+
+2012-11-22 Uros Bizjak <ubizjak@gmail.com>
+
* config/i386/i386.md (FPCMP): New mode iterator.
(unord): New mode attribute.
(*cmp<mode>_0_i387): Macroize insn from *cmpfp_0
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 69e7396..202a898 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -10948,99 +10948,121 @@
;; 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],
@@ -11051,14 +11073,15 @@
(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],
@@ -11066,49 +11089,63 @@
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;
})
@@ -11117,23 +11154,23 @@
(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;
})
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 485fc63..b183c3a 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1110,7 +1110,7 @@
(match_operand 0 "comparison_operator")
(match_operand 0 "ix86_trivial_fp_comparison_operator")))
-;; Same as above, but for swapped comparison used in fp_jcc_4_387.
+;; 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")
{