diff options
author | Hafiz Abid Qadeer <abidh@codesourcery.com> | 2021-03-24 21:24:35 +0000 |
---|---|---|
committer | Hafiz Abid Qadeer <abidh@codesourcery.com> | 2021-03-25 10:52:14 +0000 |
commit | efa30ac3c504d24c55733a627abe49bd0368cf67 (patch) | |
tree | 546cf1df9b817a8cf13f445069f53feb26d603d7 /opcodes/nios2-dis.c | |
parent | 5e74b4959bdeb5660c5e6f3e7a293269043a9a67 (diff) | |
download | fsf-binutils-gdb-efa30ac3c504d24c55733a627abe49bd0368cf67.zip fsf-binutils-gdb-efa30ac3c504d24c55733a627abe49bd0368cf67.tar.gz fsf-binutils-gdb-efa30ac3c504d24c55733a627abe49bd0368cf67.tar.bz2 |
[NIOS2] Fix disassembly of br.n instruction.
The code was checking wrong bit for sign extension. It caused it
to zero-extend instead of sign-extend the immediate value.
2021-03-25 Abid Qadeer <abidh@codesourcery.com>
opcodes/
* nios2-dis.c (nios2_print_insn_arg): Fix sign extension of
immediate in br.n instruction.
gas/
* testsuite/gas/nios2/brn.s: New.
* testsuite/gas/nios2/brn.d: New.
Diffstat (limited to 'opcodes/nios2-dis.c')
-rw-r--r-- | opcodes/nios2-dis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/nios2-dis.c b/opcodes/nios2-dis.c index e1cc716..794d700 100644 --- a/opcodes/nios2-dis.c +++ b/opcodes/nios2-dis.c @@ -694,7 +694,7 @@ nios2_print_insn_arg (const char *argptr, switch (op->format) { case iw_I10_type: - o = (((GET_IW_I10_IMM10 (opcode) & 0x3ff) ^ 0x400) - 0x400) * 2; + o = (((GET_IW_I10_IMM10 (opcode) & 0x3ff) ^ 0x200) - 0x200) * 2; break; default: bad_opcode (op); |