1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
From da3b2b8ec5f3057e53934d825ff46f5f20be7362 Mon Sep 17 00:00:00 2001
From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 16 May 2011 20:29:20 +0000
Subject: [PATCH] * config/i386/i386.md (*movxf_internal): Disable CONST_DOUBLE
optimization for CM_MEDIUM and CM_LARGE code models. Fix usage
of standard_80387_constant_p.
(*movxf_internal_nointeger): Ditto.
(*movdf_internal): Remove dead code-size optimization.
(*movdf_internal_rex64): Fix usage of standard_80387_constant_p.
(*movdf_internal_nointeger): Ditto.
(*movsf_internal): Ditto.
(floating point move splitters): Ditto.
* config/i386/constraints.md (G): Ditto.
* config/i386/i386.c (ix86_preferred_reload_class): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173803 138bc75d-0d04-0410-961f-82ee72b054a4
index 89722bb..4bc3ed6 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -149,7 +149,7 @@
(define_constraint "G"
"Standard 80387 floating point constant."
(and (match_code "const_double")
- (match_test "standard_80387_constant_p (op)")))
+ (match_test "standard_80387_constant_p (op) > 0")))
;; This can theoretically be any mode's CONST0_RTX.
(define_constraint "C"
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e8210c5..e8b9af5 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -28252,7 +28252,7 @@ ix86_preferred_reload_class (rtx x, reg_class_t regclass)
zero above. We only want to wind up preferring 80387 registers if
we plan on doing computation with them. */
if (TARGET_80387
- && standard_80387_constant_p (x))
+ && standard_80387_constant_p (x) > 0)
{
/* Limit class to non-sse. */
if (regclass == FLOAT_SSE_REGS)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 9db8a74..3bfa0b3 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2836,6 +2836,7 @@
"optimize_function_for_speed_p (cfun)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (reload_in_progress || reload_completed
+ || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], XFmode))"
{
@@ -2865,7 +2866,8 @@
"optimize_function_for_size_p (cfun)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (reload_in_progress || reload_completed
- || standard_80387_constant_p (operands[1])
+ || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
+ || standard_80387_constant_p (operands[1]) > 0
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], XFmode))"
{
@@ -2911,7 +2913,7 @@
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| (!(TARGET_SSE2 && TARGET_SSE_MATH)
&& optimize_function_for_size_p (cfun)
- && standard_80387_constant_p (operands[1]))
+ && standard_80387_constant_p (operands[1]) > 0)
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], DFmode))"
{
@@ -3078,9 +3080,6 @@
&& TARGET_INTEGER_DFMODE_MOVES
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || (!(TARGET_SSE2 && TARGET_SSE_MATH)
- && optimize_function_for_size_p (cfun)
- && standard_80387_constant_p (operands[1]))
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], DFmode))"
{
@@ -3249,11 +3248,10 @@
|| (!(TARGET_SSE2 && TARGET_SSE_MATH)
&& optimize_function_for_size_p (cfun)
&& !memory_operand (operands[0], DFmode)
- && standard_80387_constant_p (operands[1]))
+ && standard_80387_constant_p (operands[1]) > 0)
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| ((optimize_function_for_size_p (cfun)
- || !TARGET_MEMORY_MISMATCH_STALL
- || reload_in_progress || reload_completed)
+ || !TARGET_MEMORY_MISMATCH_STALL)
&& memory_operand (operands[0], DFmode)))"
{
switch (which_alternative)
@@ -3427,7 +3425,7 @@
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| (!TARGET_SSE_MATH && optimize_function_for_size_p (cfun)
- && standard_80387_constant_p (operands[1]))
+ && standard_80387_constant_p (operands[1]) > 0)
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], SFmode))"
{
@@ -3540,7 +3538,7 @@
}
else if (FP_REG_P (r))
{
- if (!standard_80387_constant_p (c))
+ if (standard_80387_constant_p (c) < 1)
FAIL;
}
else if (MMX_REG_P (r))
@@ -3572,7 +3570,7 @@
}
else if (FP_REG_P (r))
{
- if (!standard_80387_constant_p (c))
+ if (standard_80387_constant_p (c) < 1)
FAIL;
}
else if (MMX_REG_P (r))
--
1.7.0.4
|