Commit 13c025c1 by Ulrich Weigand Committed by Ulrich Weigand

s390.c (legitimate_reload_constant_p): Remove floating point constant workaround.

	* 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.

From-SVN: r88356
parent 99b2692a
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> 2004-09-30 Paul Brook <paul@codesourcery.com>
* config/arm/symbian.h (STARTFILE_SPEC): Remove crt*.o. * config/arm/symbian.h (STARTFILE_SPEC): Remove crt*.o.
......
...@@ -2062,12 +2062,6 @@ legitimate_reload_constant_p (register rtx op) ...@@ -2062,12 +2062,6 @@ legitimate_reload_constant_p (register rtx op)
enum reg_class enum reg_class
s390_preferred_reload_class (rtx op, enum reg_class 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)) switch (GET_CODE (op))
{ {
/* Constants we cannot reload must be forced into the /* Constants we cannot reload must be forced into the
...@@ -2111,7 +2105,17 @@ s390_secondary_input_reload_class (enum reg_class class ATTRIBUTE_UNUSED, ...@@ -2111,7 +2105,17 @@ s390_secondary_input_reload_class (enum reg_class class ATTRIBUTE_UNUSED,
enum machine_mode mode, rtx in) enum machine_mode mode, rtx in)
{ {
if (s390_plus_operand (in, mode)) 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; return NO_REGS;
} }
...@@ -2193,6 +2197,10 @@ s390_expand_plus_operand (register rtx target, register rtx src, ...@@ -2193,6 +2197,10 @@ s390_expand_plus_operand (register rtx target, register rtx src,
} }
if (true_regnum (sum2) < 1 || true_regnum (sum2) > 15) 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); emit_move_insn (scratch, sum2);
sum2 = scratch; sum2 = scratch;
} }
......
...@@ -827,14 +827,6 @@ ...@@ -827,14 +827,6 @@
/* Handle symbolic constants. */ /* Handle symbolic constants. */
if (TARGET_64BIT && SYMBOLIC_CONST (operands[1])) if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
emit_symbolic_move (operands); 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" (define_insn "*movdi_larl"
...@@ -1011,27 +1003,6 @@ ...@@ -1011,27 +1003,6 @@
/* Handle symbolic constants. */ /* Handle symbolic constants. */
if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1])) if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
emit_symbolic_move (operands); 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" (define_insn "*movsi_larl"
...@@ -1321,13 +1292,7 @@ ...@@ -1321,13 +1292,7 @@
[(set (match_operand:DF 0 "nonimmediate_operand" "") [(set (match_operand:DF 0 "nonimmediate_operand" "")
(match_operand:DF 1 "general_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" (define_insn "*movdf_64"
[(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q") [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
...@@ -1421,19 +1386,7 @@ ...@@ -1421,19 +1386,7 @@
; movsf instruction pattern(s). ; movsf instruction pattern(s).
; ;
(define_expand "movsf" (define_insn "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"
[(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q") [(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"))] (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
"" ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment