diff options
author | Jeff Law <law@gcc.gnu.org> | 1993-05-13 22:46:44 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1993-05-13 22:46:44 -0600 |
commit | c063ad7513c89ce027a3b98cba283ace9f16eff8 (patch) | |
tree | 08483b0d0f4d611d8b5e0f48f43dccac83342d39 | |
parent | f4e5900810f1818a0b60f7556d1caf1fe13998a7 (diff) | |
download | gcc-c063ad7513c89ce027a3b98cba283ace9f16eff8.zip gcc-c063ad7513c89ce027a3b98cba283ace9f16eff8.tar.gz gcc-c063ad7513c89ce027a3b98cba283ace9f16eff8.tar.bz2 |
pa.c (emit_move_sequence): Handle secondary reloads for load of FP registers from constant expressions.
* pa.c (emit_move_sequence): Handle secondary reloads for load of
FP registers from constant expressions.
From-SVN: r4447
-rw-r--r-- | gcc/config/pa/pa.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index a05890e..30fcf9a 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -728,6 +728,32 @@ emit_move_sequence (operands, mode, scratch_reg) operand1)); return 1; } + /* Handle secondary reloads for loads of FP registers from constant + expressions by forcing the constant into memory. + + use scratch_reg to hold the address of the memory location. + + ??? The proper fix is to change PREFERRED_RELOAD_CLASS to return + NO_REGS when presented with a const_int and an register class + containing only FP registers. Doing so unfortunately creates + more problems than it solves. Fix this for 2.5. */ + else if (fp_reg_operand (operand0, mode) + && CONSTANT_P (operand1) + && scratch_reg) + { + rtx xoperands[2]; + + /* Force the constant into memory and put the address of the + memory location into scratch_reg. */ + xoperands[0] = scratch_reg; + xoperands[1] = XEXP (force_const_mem (mode, operand1), 0); + emit_move_sequence (xoperands, mode, 0); + + /* Now load the destination register. */ + emit_insn (gen_rtx (SET, mode, operand0, + gen_rtx (MEM, mode, scratch_reg))); + return 1; + } /* Handle secondary reloads for SAR. These occur when trying to load the SAR from memory or from a FP register. */ else if (GET_CODE (operand0) == REG |