From 8a0152169477a9a450eaa349991c0140622b5e3e Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Wed, 6 Nov 1996 14:43:13 +0000 Subject: [PATCH] (sgt,sgtu,sge,sle,bgt,blt,bge,ble): Use CC_FCOM From-SVN: r13103 --- gcc/config/i386/i386.md | 115 ++++++++++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 40 deletions(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 33c307040cd..757e2cd7966 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -5065,7 +5065,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (sete,%0); OUTPUT_JUMP (\"setg %0\", \"seta %0\", NULL_PTR); @@ -5097,7 +5098,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (sete,%0); OUTPUT_JUMP (\"setl %0\", \"setb %0\", \"sets %0\"); @@ -5129,7 +5131,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (sete,%0); OUTPUT_JUMP (\"setge %0\", \"setae %0\", \"setns %0\"); @@ -5161,7 +5164,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (setb,%0); OUTPUT_JUMP (\"setle %0\", \"setbe %0\", NULL_PTR); @@ -5285,7 +5289,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (je,%l0); if (cc_prev_status.flags & CC_TEST_AX) @@ -5336,7 +5341,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (je,%l0); if (cc_prev_status.flags & CC_TEST_AX) @@ -5387,7 +5393,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (je,%l0); if (cc_prev_status.flags & CC_TEST_AX) { @@ -5437,7 +5444,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (jb,%l0); if (cc_prev_status.flags & CC_TEST_AX) { @@ -5524,7 +5532,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (jne,%l0); if (cc_prev_status.flags & CC_TEST_AX) { @@ -5554,7 +5563,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (jne,%l0); if (cc_prev_status.flags & CC_TEST_AX) { @@ -5585,7 +5595,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (jne,%l0); if (cc_prev_status.flags & CC_TEST_AX) { @@ -5615,7 +5626,8 @@ "" "* { - if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) && !TARGET_CMOVE) + if (TARGET_IEEE_FP && (cc_prev_status.flags & CC_IN_80387) + && ! (cc_prev_status.flags & CC_FCOMI)) return AS1 (jae,%l0); if (cc_prev_status.flags & CC_TEST_AX) @@ -6952,9 +6964,6 @@ "TARGET_CMOVE" "* { - if (cc_prev_status.flags & CC_IN_80387) - abort (); - if (which_alternative == 0) { /* r <- cond ? arg : r */ @@ -6978,21 +6987,21 @@ if (! rtx_equal_p (operands[0], operands[2])) if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[2]) == MEM) { - output_asm_insn (AS2 (mov%L2,%2,%4), operands); - output_asm_insn (AS2 (mov%L2,%4,%0), operands); + output_asm_insn (AS2 (mov%z2,%2,%4), operands); + output_asm_insn (AS2 (mov%z2,%4,%0), operands); } else - output_asm_insn (AS2 (mov%L0,%2,%0), operands); + output_asm_insn (AS2 (mov%z0,%2,%0), operands); if (! rtx_equal_p (operands[0], operands[3])) { output_asm_insn (\"j%C1 %l5\", operands); if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[3]) == MEM) { - output_asm_insn (AS2 (mov%L2,%3,%4), operands); - output_asm_insn (AS2 (mov%L2,%4,%0), operands); + output_asm_insn (AS2 (mov%z2,%3,%4), operands); + output_asm_insn (AS2 (mov%z2,%4,%0), operands); } else - output_asm_insn (AS2 (mov%L0,%3,%0), operands); + output_asm_insn (AS2 (mov%z0,%3,%0), operands); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[5])); } } @@ -7009,9 +7018,6 @@ "TARGET_CMOVE" "* { - if (cc_prev_status.flags & CC_IN_80387) - abort (); - if (which_alternative == 0) { /* r <- cond ? arg : r */ @@ -7035,21 +7041,21 @@ if (! rtx_equal_p (operands[0], operands[2])) if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[2]) == MEM) { - output_asm_insn (AS2 (mov%L2,%2,%4), operands); - output_asm_insn (AS2 (mov%L2,%4,%0), operands); + output_asm_insn (AS2 (mov%z2,%2,%4), operands); + output_asm_insn (AS2 (mov%z2,%4,%0), operands); } else - output_asm_insn (AS2 (mov%L0,%2,%0), operands); + output_asm_insn (AS2 (mov%z0,%2,%0), operands); if (! rtx_equal_p (operands[0], operands[3])) { output_asm_insn (\"j%C1 %l5\", operands); if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[3]) == MEM) { - output_asm_insn (AS2 (mov%L2,%3,%4), operands); - output_asm_insn (AS2 (mov%L2,%4,%0), operands); + output_asm_insn (AS2 (mov%z2,%3,%4), operands); + output_asm_insn (AS2 (mov%z2,%4,%0), operands); } else - output_asm_insn (AS2 (mov%L0,%3,%0), operands); + output_asm_insn (AS2 (mov%z0,%3,%0), operands); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[5])); } } @@ -7125,24 +7131,21 @@ operands[4] = gen_label_rtx (); if (STACK_REG_P (operands[2]) || GET_CODE (operands[2]) == MEM) - output_asm_insn (AS1 (fld,%y2), operands); + output_asm_insn (AS1 (fld%z2,%y2), operands); else { xops[0] = operands[0]; xops[1] = operands[2]; - /* SET_SRC (PATTERN (insn)) = XEXP (SET_SRC (PATTERN (insn)), 1);*/ - output_asm_insn (output_move_const_single (xops), xops); + output_move_const_single (xops); } output_asm_insn (\"j%C1 %l4\", operands); if (STACK_REG_P (operands[3]) || GET_CODE (operands[0]) == MEM) - output_asm_insn (AS1 (fld,%y3), operands); + output_asm_insn (AS1 (fld%z3,%y3), operands); else { xops[1] = operands[3]; SET_SRC (PATTERN (insn)) = XEXP (SET_SRC (PATTERN (insn)), 2); - output_asm_insn (output_move_const_single (xops), xops); - /* output_move_memory (xops, insn, GET_MODE_SIZE (DFmode), 2, 4);*/ - /* output_asm_insn (AS1 (fld%z0,%y3), operands);*/ + output_move_const_single (xops); } ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4])); } @@ -7150,11 +7153,11 @@ }") (define_insn "movdfcc_1" - [(set (match_operand:DF 0 "register_operand" "=t,t") + [(set (match_operand:DF 0 "general_operand" "=t,=t,f,fFm") (if_then_else:DF (match_operator 1 "comparison_operator" [(cc0) (const_int 0)]) - (match_operand:DF 2 "register_operand" "0,f") - (match_operand:DF 3 "register_operand" "f,0")))] + (match_operand:DF 2 "general_operand" "0,f,f,fFm") + (match_operand:DF 3 "general_operand" "f,0,f,fFm")))] "TARGET_CMOVE" "* { @@ -7168,6 +7171,38 @@ /* r <- cond ? r : arg */ output_asm_insn (AS2 (fcmov%F1,%2,%0), operands); } + else if (which_alternative == 2) + { + /* r <- cond ? r : arg */ + output_asm_insn (AS2 (fcmov%F1,%2,%0), operands); + output_asm_insn (AS2 (fcmov%f1,%3,%0), operands); + } + else if (which_alternative == 3) + { + rtx xops[2]; + + /* r <- cond ? arg1 : arg2 */ + operands[4] = gen_label_rtx (); + + if (STACK_REG_P (operands[2]) || GET_CODE (operands[2]) == MEM) + output_asm_insn (AS1 (fld%z2,%y2), operands); + else + { + xops[0] = operands[0]; + xops[1] = operands[2]; + output_move_const_single (xops); + } + output_asm_insn (\"j%C1 %l4\", operands); + if (STACK_REG_P (operands[3]) || GET_CODE (operands[0]) == MEM) + output_asm_insn (AS1 (fld%z3,%y3), operands); + else + { + xops[1] = operands[3]; + SET_SRC (PATTERN (insn)) = XEXP (SET_SRC (PATTERN (insn)), 2); + output_move_const_single (xops); + } + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4])); +} RET; }") -- 2.30.2