aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2003-10-06 17:50:26 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2003-10-06 17:50:26 +0000
commit4fef83a7dd56abbc587d91d0bf738942ac510189 (patch)
tree64000138000fea36ddc0bf8ca12c94e860c2e94a /gcc/config/mips/mips.c
parentac1605d6d3a0a049524738c35aacfc1641b2c065 (diff)
downloadgcc-4fef83a7dd56abbc587d91d0bf738942ac510189.zip
gcc-4fef83a7dd56abbc587d91d0bf738942ac510189.tar.gz
gcc-4fef83a7dd56abbc587d91d0bf738942ac510189.tar.bz2
mips.md (*lowsi): Renamed from lowsi.
* config/mips/mips.md (*lowsi): Renamed from lowsi. (*lowdi): Likewise lowdi. (*lowsi_mips16, *lowdi_mips16): New patterns. * config/mips/mips.c (mips_const_insns, mips_output_move): Remove mips16 CONSTANT_RELOC handling. (mips_delegitimize_address): Adjust for new sdata representation. From-SVN: r72157
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r--gcc/config/mips/mips.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index bcd9586..304cf1d 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1202,6 +1202,8 @@ mips_address_insns (rtx x, enum machine_mode mode)
return factor;
case ADDRESS_LO_SUM:
+ return (TARGET_MIPS16 ? factor * 2 : factor);
+
case ADDRESS_CONST_INT:
return factor;
@@ -1250,12 +1252,8 @@ mips_const_insns (rtx x)
return 0;
case CONSTANT_GP:
- return 1;
-
case CONSTANT_RELOC:
- /* When generating mips16 code, we need to set the destination to
- $0 and then add in the signed offset. See mips_output_move. */
- return (TARGET_MIPS16 ? 3 : 1);
+ return 1;
case CONSTANT_SYMBOLIC:
return mips_symbol_insns (mips_classify_symbol (c.symbol));
@@ -2013,12 +2011,11 @@ mips_delegitimize_address (rtx x)
&& mips_classify_symbol (c.symbol) == SYMBOL_GOT_GLOBAL)
return c.symbol;
- if (GET_CODE (x) == PLUS
- && (XEXP (x, 0) == pic_offset_table_rtx
- || XEXP (x, 0) == cfun->machine->mips16_gp_pseudo_rtx)
- && mips_classify_constant (&c, XEXP (x, 1)) == CONSTANT_RELOC
- && mips_classify_symbol (c.symbol) == SYMBOL_SMALL_DATA)
- return plus_constant (c.symbol, c.offset);
+ if (GET_CODE (x) == LO_SUM
+ && XEXP (x, 0) == (TARGET_MIPS16
+ ? cfun->machine->mips16_gp_pseudo_rtx
+ : pic_offset_table_rtx))
+ return XEXP (x, 1);
return x;
}
@@ -2721,7 +2718,7 @@ mips_output_move (rtx dest, rtx src)
return "move\t%0,%1";
case CONSTANT_RELOC:
- return (TARGET_MIPS16 ? "li\t%0,0\n\taddiu\t%0,%1" : "li\t%0,%1");
+ return "li\t%0,%1";
case CONSTANT_SYMBOLIC:
return (dbl_p ? "dla\t%0,%a1" : "la\t%0,%a1");