aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2004-09-30 21:21:57 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2004-09-30 21:21:57 +0000
commit3b33bd3848fd135b0bb5d0cc45adb10b9af5854a (patch)
tree0eff45c4a951b38c07caf016add8011a61fa2659
parent88512b3ebc9161c71c8c26f2abc5bf31d70339d3 (diff)
* config/s390/s390.c (legitimate_reload_constant_p): Remove
floating point constant workaround. (s390_secondary_input_reload_class): Handle PLUS reloads with too-large constant. (s390_expand_plus_operand): Likewise. * config/s390/s390.md ("movdi"): Do not call force_const_mem. ("movsi"): Likewise. Also, remove workaround for non-general operands. ("movdf"): Do not call force_const_mem. ("movsf"): Likewise. Merge expander with *movsf insn. ("*movsf"): Remove, merge with movsf expander. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@88356 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/s390/s390.c22
-rw-r--r--gcc/config/s390/s390.md51
3 files changed, 31 insertions, 56 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5be270b967c..e8b7b17eb71 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2004-09-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (legitimate_reload_constant_p): Remove
+ floating point constant workaround.
+ (s390_secondary_input_reload_class): Handle PLUS reloads
+ with too-large constant.
+ (s390_expand_plus_operand): Likewise.
+ * config/s390/s390.md ("movdi"): Do not call force_const_mem.
+ ("movsi"): Likewise. Also, remove workaround for non-general
+ operands.
+ ("movdf"): Do not call force_const_mem.
+ ("movsf"): Likewise. Merge expander with *movsf insn.
+ ("*movsf"): Remove, merge with movsf expander.
+
2004-09-30 Paul Brook <paul@codesourcery.com>
* config/arm/symbian.h (STARTFILE_SPEC): Remove crt*.o.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3fff67ce1f2..bb468fe510f 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -2062,12 +2062,6 @@ legitimate_reload_constant_p (register rtx op)
enum reg_class
s390_preferred_reload_class (rtx op, enum reg_class class)
{
- /* This can happen if a floating point constant is being
- reloaded into an integer register. Leave well alone. */
- if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
- && class != FP_REGS)
- return class;
-
switch (GET_CODE (op))
{
/* Constants we cannot reload must be forced into the
@@ -2111,7 +2105,17 @@ s390_secondary_input_reload_class (enum reg_class class ATTRIBUTE_UNUSED,
enum machine_mode mode, rtx in)
{
if (s390_plus_operand (in, mode))
- return ADDR_REGS;
+ {
+ /* ??? Reload sometimes pushes a PLUS reload with a too-large constant.
+ Until reload is fixed, we need to force_const_mem while emitting the
+ secondary reload insn -- thus we need to make sure here that we do
+ have a literal pool for the current function. */
+ if (CONSTANT_P (XEXP (in, 1))
+ && !legitimate_reload_constant_p (XEXP (in, 1)))
+ current_function_uses_const_pool = true;
+
+ return ADDR_REGS;
+ }
return NO_REGS;
}
@@ -2193,6 +2197,10 @@ s390_expand_plus_operand (register rtx target, register rtx src,
}
if (true_regnum (sum2) < 1 || true_regnum (sum2) > 15)
{
+ /* ??? See comment in s390_secondary_input_reload_class. */
+ if (CONSTANT_P (sum2) && !legitimate_reload_constant_p (sum2))
+ sum2 = force_const_mem (Pmode, sum2);
+
emit_move_insn (scratch, sum2);
sum2 = scratch;
}
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index d7f0e0763b4..9f564be6d48 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -827,14 +827,6 @@
/* Handle symbolic constants. */
if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
emit_symbolic_move (operands);
-
- /* During and after reload, we need to force constants
- to the literal pool ourselves, if necessary. */
- if ((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1])
- && (!legitimate_reload_constant_p (operands[1])
- || FP_REG_P (operands[0])))
- operands[1] = force_const_mem (DImode, operands[1]);
})
(define_insn "*movdi_larl"
@@ -1011,27 +1003,6 @@
/* Handle symbolic constants. */
if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
emit_symbolic_move (operands);
-
- /* expr.c tries to load an effective address using
- force_reg. This fails because we don't have a
- generic load_address pattern. Convert the move
- to a proper arithmetic operation instead, unless
- it is guaranteed to be OK. */
- if (GET_CODE (operands[1]) == PLUS
- && !legitimate_la_operand_p (operands[1]))
- {
- operands[1] = force_operand (operands[1], operands[0]);
- if (operands[1] == operands[0])
- DONE;
- }
-
- /* During and after reload, we need to force constants
- to the literal pool ourselves, if necessary. */
- if ((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1])
- && (!legitimate_reload_constant_p (operands[1])
- || FP_REG_P (operands[0])))
- operands[1] = force_const_mem (SImode, operands[1]);
})
(define_insn "*movsi_larl"
@@ -1321,13 +1292,7 @@
[(set (match_operand:DF 0 "nonimmediate_operand" "")
(match_operand:DF 1 "general_operand" ""))]
""
-{
- /* During and after reload, we need to force constants
- to the literal pool ourselves, if necessary. */
- if ((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1]))
- operands[1] = force_const_mem (DFmode, operands[1]);
-})
+ "")
(define_insn "*movdf_64"
[(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
@@ -1421,19 +1386,7 @@
; movsf instruction pattern(s).
;
-(define_expand "movsf"
- [(set (match_operand:SF 0 "nonimmediate_operand" "")
- (match_operand:SF 1 "general_operand" ""))]
- ""
-{
- /* During and after reload, we need to force constants
- to the literal pool ourselves, if necessary. */
- if ((reload_in_progress || reload_completed)
- && CONSTANT_P (operands[1]))
- operands[1] = force_const_mem (SFmode, operands[1]);
-})
-
-(define_insn "*movsf"
+(define_insn "movsf"
[(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
(match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
""