(movsf, movdf): Handle a move from an integer register before reload.
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 12 Jun 1993 01:49:20 +0000 (21:49 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 12 Jun 1993 01:49:20 +0000 (21:49 -0400)
This can happen if the user uses asm to put a floating point variable
in an integer register.

From-SVN: r4666

gcc/config/rs6000/rs6000.md

index 4327d0cf5e3e86222d7e4397326f14f589f6f844..342762ea6a66d458bb51ba946f9a4d659ec3b7ea 100644 (file)
       && 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));
       && 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));