diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-11 21:49:20 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-06-11 21:49:20 -0400 |
commit | 785e6a26dace53cebed12db30f33169d25c0c719 (patch) | |
tree | 872c27f451c3580cf6dbf0eec3edb5a4ca2ba246 /gcc | |
parent | 11e5fe42ca1d186a56b85214fa492ff309570a32 (diff) | |
download | gcc-785e6a26dace53cebed12db30f33169d25c0c719.zip gcc-785e6a26dace53cebed12db30f33169d25c0c719.tar.gz gcc-785e6a26dace53cebed12db30f33169d25c0c719.tar.bz2 |
(movsf, movdf): Handle a move from an integer register before reload.
This can happen if the user uses asm to put a floating point variable
in an integer register.
From-SVN: r4666
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 4327d0c..342762e 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -2259,20 +2259,19 @@ && REGNO (SUBREG_REG (operands[1])) < FIRST_PSEUDO_REGISTER) operands[1] = alter_subreg (operands[1]); - /* If we are being called from reload, it is possible that operands[1] - is a hard non-fp register. So handle those cases. */ - if (reload_in_progress && GET_CODE (operands[1]) == REG - && REGNO (operands[1]) < 32) + if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 32) { rtx stack_slot; - /* Remember that we only see a pseudo here if it didn't get a hard - register, so it is memory. */ + /* If this is a store to memory or another integer register do the + move directly. Otherwise store to a temporary stack slot and + load from there into a floating point register. */ + if (GET_CODE (operands[0]) == MEM || (GET_CODE (operands[0]) == REG && (REGNO (operands[0]) < 32 - || REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)) - || (GET_CODE (operands[0]) == REG && REGNO (operands[0]) < 32)) + || (reload_in_progress + && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)))) { emit_move_insn (operand_subword (operands[0], 0, 0, SFmode), operand_subword (operands[1], 0, 0, SFmode)); @@ -2371,19 +2370,19 @@ && REGNO (SUBREG_REG (operands[1])) < FIRST_PSEUDO_REGISTER) operands[1] = alter_subreg (operands[1]); - /* If we are being called from reload, it is possible that operands[1] - is a hard non-fp register. So handle those cases. */ - if (reload_in_progress && GET_CODE (operands[1]) == REG - && REGNO (operands[1]) < 32) + if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < 32) { rtx stack_slot; - /* Remember that we only see a pseudo here if it didn't get a hard - register, so it is memory. */ + /* If this is a store to memory or another integer register do the + move directly. Otherwise store to a temporary stack slot and + load from there into a floating point register. */ + if (GET_CODE (operands[0]) == MEM || (GET_CODE (operands[0]) == REG && (REGNO (operands[0]) < 32 - || REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER))) + || (reload_in_progress + && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)))) { emit_move_insn (operand_subword (operands[0], 0, 0, DFmode), operand_subword (operands[1], 0, 0, DFmode)); |