re PR target/23268 (ICE using math functions log & rint, -ffast-math, -O1 (,2,3,s))

PR target/23268
	* config/i386/i386.md ("*fist<mode>2_1"): New pattern.
	("lrint<mode>2"): Change expander to use "*fist<mode>2_1" pattern.

From-SVN: r103224
This commit is contained in:
Uros Bizjak 2005-08-17 22:44:01 +02:00 committed by Richard Henderson
parent c26104e494
commit 87bb8864f6
2 changed files with 34 additions and 13 deletions

View File

@ -1,3 +1,9 @@
2005-08-17 Uros Bizjak <uros@kss-loka.si>
PR target/23268
* config/i386/i386.md ("*fist<mode>2_1"): New pattern.
("lrint<mode>2"): Change expander to use "*fist<mode>2_1" pattern.
2005-08-17 J"orn Rennecke <joern.rennecke@st.com>
* varasm.c (decode_reg_name): Skip empty aqdditional register names.

View File

@ -16477,6 +16477,30 @@
DONE;
})
(define_insn_and_split "*fist<mode>2_1"
[(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r")
(unspec:X87MODEI [(match_operand:XF 1 "register_operand" "f,f")]
UNSPEC_FIST))]
"TARGET_USE_FANCY_MATH_387
&& flag_unsafe_math_optimizations
&& !(reload_completed || reload_in_progress)"
"#"
"&& 1"
[(const_int 0)]
{
if (memory_operand (operands[0], VOIDmode))
emit_insn (gen_fist<mode>2 (operands[0], operands[1]));
else
{
operands[2] = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
emit_insn (gen_fist<mode>2_with_temp (operands[0], operands[1],
operands[2]));
}
DONE;
}
[(set_attr "type" "fpspc")
(set_attr "mode" "<MODE>")])
(define_insn "fistdi2"
[(set (match_operand:DI 0 "memory_operand" "=m")
(unspec:DI [(match_operand:XF 1 "register_operand" "f")]
@ -16566,22 +16590,13 @@
"")
(define_expand "lrint<mode>2"
[(use (match_operand:X87MODEI 0 "nonimmediate_operand" ""))
(use (match_operand:XF 1 "register_operand" ""))]
[(set (match_operand:X87MODEI 0 "nonimmediate_operand" "")
(unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")]
UNSPEC_FIST))]
"TARGET_USE_FANCY_MATH_387
&& (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387)
&& flag_unsafe_math_optimizations"
{
if (memory_operand (operands[0], VOIDmode))
emit_insn (gen_fist<mode>2 (operands[0], operands[1]));
else
{
rtx op = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
emit_insn (gen_fist<mode>2_with_temp (operands[0], operands[1],
op));
}
DONE;
})
"")
;; Rounding mode control word calculation could clobber FLAGS_REG.
(define_insn_and_split "frndintxf2_floor"