]> git.pld-linux.org Git - packages/gcc.git/blame - gcc-pr24055.patch
- fix invalid x87 insns patterns (PR24055).
[packages/gcc.git] / gcc-pr24055.patch
CommitLineData
780827a5
PS
1--- gcc-4.1/gcc/config/i386/i386.md 2005-09-06 10:53:06.000000000 +0200
2+++ gcc-4.1/gcc/config/i386/i386.md 2005-09-26 10:42:34.581839750 +0200
3@@ -16475,9 +16475,9 @@
4 DONE;
5 })
6
7-(define_insn_and_split "*fist<mode>2_1"
8- [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r")
9- (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "f,f")]
10+(define_insn_and_split "*fistdi2_1"
11+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r")
12+ (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")]
13 UNSPEC_FIST))]
14 "TARGET_USE_FANCY_MATH_387
15 && flag_unsafe_math_optimizations
16@@ -16487,17 +16487,17 @@
17 [(const_int 0)]
18 {
19 if (memory_operand (operands[0], VOIDmode))
20- emit_insn (gen_fist<mode>2 (operands[0], operands[1]));
21+ emit_insn (gen_fistdi2 (operands[0], operands[1]));
22 else
23 {
24- operands[2] = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
25- emit_insn (gen_fist<mode>2_with_temp (operands[0], operands[1],
26- operands[2]));
27+ operands[2] = assign_386_stack_local (DImode, SLOT_TEMP);
28+ emit_insn (gen_fistdi2_with_temp (operands[0], operands[1],
29+ operands[2]));
30 }
31 DONE;
32 }
33 [(set_attr "type" "fpspc")
34- (set_attr "mode" "<MODE>")])
35+ (set_attr "mode" "DI")])
36
37 (define_insn "fistdi2"
38 [(set (match_operand:DI 0 "memory_operand" "=m")
39@@ -16545,6 +16545,25 @@
40 (clobber (match_dup 3))])]
41 "")
42
43+(define_insn_and_split "*fist<mode>2_1"
44+ [(set (match_operand:X87MODEI12 0 "register_operand" "=r")
45+ (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")]
46+ UNSPEC_FIST))]
47+ "TARGET_USE_FANCY_MATH_387
48+ && flag_unsafe_math_optimizations
49+ && !(reload_completed || reload_in_progress)"
50+ "#"
51+ "&& 1"
52+ [(const_int 0)]
53+{
54+ operands[2] = assign_386_stack_local (<MODE>mode, SLOT_TEMP);
55+ emit_insn (gen_fist<mode>2_with_temp (operands[0], operands[1],
56+ operands[2]));
57+ DONE;
58+}
59+ [(set_attr "type" "fpspc")
60+ (set_attr "mode" "<MODE>")])
61+
62 (define_insn "fist<mode>2"
63 [(set (match_operand:X87MODEI12 0 "memory_operand" "=m")
64 (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")]
65@@ -16556,10 +16575,10 @@
66 (set_attr "mode" "<MODE>")])
67
68 (define_insn "fist<mode>2_with_temp"
69- [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r")
70- (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f,f")]
71+ [(set (match_operand:X87MODEI12 0 "register_operand" "=r")
72+ (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")]
73 UNSPEC_FIST))
74- (clobber (match_operand:X87MODEI12 2 "memory_operand" "=m,m"))]
75+ (clobber (match_operand:X87MODEI12 2 "memory_operand" "=m"))]
76 "TARGET_USE_FANCY_MATH_387
77 && flag_unsafe_math_optimizations"
78 "#"
This page took 0.044092 seconds and 4 git commands to generate.