diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2010-12-09 23:33:24 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2010-12-09 23:33:24 +0000 |
commit | 842f8b2a1e0780823528556046919173a9a8db57 (patch) | |
tree | af4644098fe9c3ffd84f500b52da2785da1df1bf /gas/config | |
parent | 34224acf3638b12890af9c51567bfd6647245f9f (diff) | |
download | fsf-binutils-gdb-842f8b2a1e0780823528556046919173a9a8db57.zip fsf-binutils-gdb-842f8b2a1e0780823528556046919173a9a8db57.tar.gz fsf-binutils-gdb-842f8b2a1e0780823528556046919173a9a8db57.tar.bz2 |
gas/
* config/tc-mips.c (macro) <ld_st>: Don't load a zero into an
auxiliary register when using a signed 16-bit constant offset.
gas/testsuite/
* gas/mips/ldstla-32.d: Update according to a 16-bit constant
offset optimization.
* gas/mips/ldstla-32-mips3.d: Likewise.
* gas/mips/ldstla-32-shared.d: Likewise.
* gas/mips/ldstla-32-mips3-shared.d: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index b664585..eb1ba2e 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -6565,14 +6565,19 @@ macro (struct mips_cl_insn *ip) is in non PIC code. */ if (offset_expr.X_op == O_constant) { - expr1.X_add_number = ((offset_expr.X_add_number + 0x8000) - & ~(bfd_vma) 0xffff); + expr1.X_add_number = offset_expr.X_add_number; normalize_address_expr (&expr1); - load_register (tempreg, &expr1, HAVE_64BIT_ADDRESSES); - if (breg != 0) - macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", - tempreg, tempreg, breg); - macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_LO16, tempreg); + if (!IS_SEXT_16BIT_NUM (expr1.X_add_number)) + { + expr1.X_add_number = ((expr1.X_add_number + 0x8000) + & ~(bfd_vma) 0xffff); + load_register (tempreg, &expr1, HAVE_64BIT_ADDRESSES); + if (breg != 0) + macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", + tempreg, tempreg, breg); + breg = tempreg; + } + macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_LO16, breg); } else if (mips_pic == NO_PIC) { |