From: Uros Bizjak Date: Thu, 22 Nov 2012 21:13:56 +0000 (+0100) Subject: i386.md (*jcc_0_i387): Macroize insn from *fp_jcc_3_387 using X87MODEF mode... X-Git-Tag: upstream/12.2.0~72637 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31daf7a352524c596e0e9eb3dde4be777572e451;p=platform%2Fupstream%2Fgcc.git i386.md (*jcc_0_i387): Macroize insn from *fp_jcc_3_387 using X87MODEF mode iterator. * config/i386/i386.md (*jcc_0_i387): Macroize insn from *fp_jcc_3_387 using X87MODEF mode iterator. (*jcc_0_r_i387): New. (*jccxf_i387): Ditto. (*jccxf_r_i387): Ditto. (*jcc_i387): Macroize insn from *fp_jcc_1_387 using MODEF mode iterator. (*jcc_r_i387): Macroize insn from *fp_jcc_1r_387 using MODEF mode iterator. (*jccu_i387): Macroize insn from *fp_jcc_2_387 using X87MODEF mode iterator. (*jccu_r_i387): Macroize insn from *fp_jcc_2r_387 using X87MODEF mode iterator. (*jcc{,u}_i387 splitters): Macroize splitters using X87MODEF mode iterator. (*jcc__i387): Macroize insn from *fp_jcc_4__387 using X87MODEF mode iterator. (*jcc__r_i387): New. (*jcc__i387 splitters): Macroize splitters using X87MODEF and SWI24 mode iterators. From-SVN: r193734 --- 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 + * config/i386/i386.md (*jcc_0_i387): Macroize insn + from *fp_jcc_3_387 using X87MODEF mode iterator. + (*jcc_0_r_i387): New. + (*jccxf_i387): Ditto. + (*jccxf_r_i387): Ditto. + (*jcc_i387): Macroize insn from *fp_jcc_1_387 using + MODEF mode iterator. + (*jcc_r_i387): Macroize insn from *fp_jcc_1r_387 using + MODEF mode iterator. + (*jccu_i387): Macroize insn from *fp_jcc_2_387 using + X87MODEF mode iterator. + (*jccu_r_i387): Macroize insn from *fp_jcc_2r_387 using + X87MODEF mode iterator. + (*jcc{,u}_i387 splitters): Macroize splitters using + X87MODEF mode iterator. + (*jcc__i387): Macroize insn + from *fp_jcc_4__387 using X87MODEF mode iterator. + (*jcc__r_i387): New. + (*jcc__i387 splitters): Macroize + splitters using X87MODEF and SWI24 mode iterators. + +2012-11-22 Uros Bizjak + * config/i386/i386.md (FPCMP): New mode iterator. (unord): New mode attribute. (*cmp_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_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_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_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_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_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_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__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__387" +(define_insn "*jcc__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_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_MODE_FIOP + || optimize_function_for_size_p (cfun))" + "#") + +(define_insn "*jcc__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_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__i387. (define_predicate "ix86_swapped_fp_comparison_operator" (match_operand 0 "comparison_operator") {