Brown bag time on this one. While I did build and test both x86_64 and i686 separately, I apparently only missed the regression in test results.
Anyway, a simple fix for the problem: don't enable the pattern when it's not supposed to be enabled due to excess precision. Moving the _387 pattern down means that we don't have to repeat the condition on the _sse pattern just above. Two separate patches, because I forgot about the mixed-sse-387 case until after I'd already committed the first patch. Ho hum. r~
PR target/60562 * config/i386/i386.md (*float<SWI48x><MODEF>2_i387): Move down to be shadowed by *float<SWI48><MODEF>2_sse. Test X87_ENABLE_FLOAT. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index a824e78..abc22f2 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4701,15 +4701,6 @@ } }) -(define_insn "*float<SWI48x:mode><MODEF:mode>2_i387" - [(set (match_operand:MODEF 0 "register_operand" "=f") - (float:MODEF (match_operand:SWI48x 1 "nonimmediate_operand" "m")))] - "TARGET_80387 && !(SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH)" - "fild%Z1\t%1" - [(set_attr "type" "fmov") - (set_attr "mode" "<MODEF:MODE>") - (set_attr "fp_int_src" "true")]) - (define_insn "*float<SWI48:mode><MODEF:mode>2_sse" [(set (match_operand:MODEF 0 "register_operand" "=f,x,x") (float:MODEF @@ -4743,6 +4734,15 @@ (symbol_ref "true"))) ]) +(define_insn "*float<SWI48x:mode><MODEF:mode>2_i387" + [(set (match_operand:MODEF 0 "register_operand" "=f") + (float:MODEF (match_operand:SWI48x 1 "nonimmediate_operand" "m")))] + "TARGET_80387 && X87_ENABLE_FLOAT (<MODEF:MODE>mode, <SWI48x:MODE>mode)" + "fild%Z1\t%1" + [(set_attr "type" "fmov") + (set_attr "mode" "<MODEF:MODE>") + (set_attr "fp_int_src" "true")]) + ;; Try TARGET_USE_VECTOR_CONVERTS, but not so hard as to require extra memory ;; slots when !TARGET_INTER_UNIT_MOVES_TO_VEC disables the general_regs ;; alternative in sse2_loadld.
PR target/60562 * config/i386/i386.md (*float<SWI48><MODEF>2_sse): Check X87_ENABLE_FLOAT for alternative 0. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index abc22f2..d96f997 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4726,7 +4726,9 @@ (set_attr "fp_int_src" "true") (set (attr "enabled") (cond [(eq_attr "alternative" "0") - (symbol_ref "TARGET_MIX_SSE_I387") + (symbol_ref "TARGET_MIX_SSE_I387 + && X87_ENABLE_FLOAT (<MODEF:MODE>mode, + <SWI48:MODE>mode)" (eq_attr "alternative" "1") (symbol_ref "TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun)")