summaryrefslogtreecommitdiff
path: root/opcodes/mips16-opc.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-12-14 21:18:16 +0000
committerMaciej W. Rozycki <macro@imgtec.com>2016-12-14 22:04:39 +0000
commit353abf7c10561aab3e8e7ffce6e270c3743376f0 (patch)
tree8c3e3381198a36dacbb46cd30ce3c774e7cc803b /opcodes/mips16-opc.c
parent63e014fccdd91a89873554f6b33d7128d7112813 (diff)
downloadbinutils-gdb-353abf7c10561aab3e8e7ffce6e270c3743376f0.tar.gz
MIPS16: Fix SP-relative SD instruction annotation
Fix the annotation of SP-relative SD instructions incorrectly marked as reading from the PC rather than SP, which in turn prevented their 16-bit forms from being scheduled into jump delay slots. This bug has been there since forever. opcodes/ * mips16-opc.c (mips16_opcodes): Set RD_SP rather than RD_PC in `pinfo2' with SP-relative "sd" entries. gas/ * testsuite/gas/mips/mips16-sprel-swap.d: New test. * testsuite/gas/mips/mips16-sprel-swap.s: New test source. * testsuite/gas/mips/mips.exp: Run the new test.
Diffstat (limited to 'opcodes/mips16-opc.c')
-rw-r--r--opcodes/mips16-opc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/opcodes/mips16-opc.c b/opcodes/mips16-opc.c
index 0fcefc6d24a..3c90147e907 100644
--- a/opcodes/mips16-opc.c
+++ b/opcodes/mips16-opc.c
@@ -321,8 +321,8 @@ const struct mips_opcode mips16_opcodes[] =
{"remu", "z,v,y", 0, (int) M_REMU_3, INSN_MACRO, 0, I1, 0, 0 },
{"sb", "y,5(x)", 0xc000, 0xf800, RD_1|RD_3, 0, I1, 0, 0 },
{"sd", "y,D(x)", 0x7800, 0xf800, RD_1|RD_3, 0, I3, 0, 0 },
-{"sd", "y,D(S)", 0xf900, 0xff00, RD_1, RD_PC, I3, 0, 0 },
-{"sd", "R,C(S)", 0xfa00, 0xff00, 0, RD_31|RD_PC, I1, 0, 0 },
+{"sd", "y,D(S)", 0xf900, 0xff00, RD_1, RD_SP, I3, 0, 0 },
+{"sd", "R,C(S)", 0xfa00, 0xff00, 0, RD_31|RD_SP, I1, 0, 0 },
{"sh", "y,H(x)", 0xc800, 0xf800, RD_1|RD_3, 0, I1, 0, 0 },
{"sllv", "y,x", 0xe804, 0xf81f, MOD_1|RD_2, 0, I1, 0, 0 },
{"sll", "x,w,<", 0x3000, 0xf803, WR_1|RD_2, 0, I1, 0, 0 },