summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-17 20:44:01 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-17 20:44:01 +0000
commit7d1898d9b959cd870bab208722fbb5f0a67a7598 (patch)
treef2b799102e09bd04f40d4bb884d389b973568ad5
parentba59da21cb608695e32a7fc463f0fee4d982daa8 (diff)
downloadppe42-gcc-7d1898d9b959cd870bab208722fbb5f0a67a7598.tar.gz
ppe42-gcc-7d1898d9b959cd870bab208722fbb5f0a67a7598.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103224 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.md41
2 files changed, 34 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 25c6dfd25b9..6fa630143db 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 9e7e92ce8e5..88440d66183 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -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"
OpenPOWER on IntegriCloud