sh.md (call): Extend 32-bit addresses to DImode for 32-bit TARGET_SHMEDIA.
authorKaz Kojima <kkojima@gcc.gnu.org>
Thu, 16 Sep 2004 23:37:00 +0000 (23:37 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Thu, 16 Sep 2004 23:37:00 +0000 (23:37 +0000)
* config/sh/sh.md (call): Extend 32-bit addresses to DImode
for 32-bit TARGET_SHMEDIA.
(call_value): Likewise.

From-SVN: r87619

gcc/ChangeLog
gcc/config/sh/sh.md

index 8648e7c..31e4df2 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-16  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * config/sh/sh.md (call): Extend 32-bit addresses to DImode
+       for 32-bit TARGET_SHMEDIA.
+       (call_value): Likewise.
+
 2004-09-16  Diego Novillo  <dnovillo@redhat.com>
 
        * tree-ssa-operands.c (add_call_clobber_ops): Make read-only
index 31e05a2..5adcac2 100644 (file)
              if (GET_MODE (operands[0]) != DImode)
                operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
            }
-         else
+         else if (TARGET_SHMEDIA64)
            {
              operands[0] = shallow_copy_rtx (operands[0]);
              PUT_MODE (operands[0], DImode);
            }
+         else
+           {
+             rtx reg = gen_reg_rtx (DImode);
+
+             operands[0] = copy_to_mode_reg (SImode, operands[0]);
+             emit_insn (gen_extendsidi2 (reg, operands[0]));
+             operands[0] = reg;
+           }
        }
       if (! target_reg_operand (operands[0], DImode))
        operands[0] = copy_to_mode_reg (DImode, operands[0]);
              if (GET_MODE (operands[1]) != DImode)
                operands[1] = gen_rtx_SUBREG (DImode, operands[1], 0);
            }
-         else
+         else if (TARGET_SHMEDIA64)
            {
              operands[1] = shallow_copy_rtx (operands[1]);
              PUT_MODE (operands[1], DImode);
            }
+         else
+           {
+             rtx reg = gen_reg_rtx (DImode);
+
+             operands[1] = copy_to_mode_reg (SImode, operands[1]);
+             emit_insn (gen_extendsidi2 (reg, operands[1]));
+             operands[1] = reg;
+           }
        }
       if (! target_reg_operand (operands[1], DImode))
        operands[1] = copy_to_mode_reg (DImode, operands[1]);