From 13c025c1866a201fc46ffdbd3438f0cfea37c1a0 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 30 Sep 2004 21:21:57 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 14 ++++++++++++++ gcc/config/s390/s390.c | 22 ++++++++++++++------- gcc/config/s390/s390.md | 51 ++----------------------------------------------- 3 files changed, 31 insertions(+), 56 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5be270b..e8b7b17 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2004-09-30 Ulrich Weigand + + * 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 * config/arm/symbian.h (STARTFILE_SPEC): Remove crt*.o. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 3fff67c..bb468fe 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 d7f0e07..9f564be 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"))] "" -- 2.7.4