aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorHafiz Abid Qadeer <abidh@codesourcery.com>2021-03-24 21:24:35 +0000
committerHafiz Abid Qadeer <abidh@codesourcery.com>2021-03-25 10:52:14 +0000
commitefa30ac3c504d24c55733a627abe49bd0368cf67 (patch)
tree546cf1df9b817a8cf13f445069f53feb26d603d7 /gas
parent5e74b4959bdeb5660c5e6f3e7a293269043a9a67 (diff)
downloadgdb-efa30ac3c504d24c55733a627abe49bd0368cf67.zip
gdb-efa30ac3c504d24c55733a627abe49bd0368cf67.tar.gz
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 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/testsuite/gas/nios2/brn.d10
-rw-r--r--gas/testsuite/gas/nios2/brn.s4
3 files changed, 19 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a540566..f6c350d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-25 Abid Qadeer <abidh@codesourcery.com>
+
+ * testsuite/gas/nios2/brn.d: New.
+ * testsuite/gas/nios2/brn.d: New.
+
2021-03-25 Jan Beulich <jbeulich@suse.com>
* config/tc-i386.c (match_template): Use t instead of i.tm.
diff --git a/gas/testsuite/gas/nios2/brn.d b/gas/testsuite/gas/nios2/brn.d
new file mode 100644
index 0000000..a9ed472
--- /dev/null
+++ b/gas/testsuite/gas/nios2/brn.d
@@ -0,0 +1,10 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: NIOS2 br.n
+#as: -march=r2
+
+.*: +file format elf32-littlenios2
+
+Disassembly of section .text:
+0+0000 <[^>]*> c4000020 nop
+0+0004 <[^>]*> ff43 br.n 00000000 <foo>
+ ...
diff --git a/gas/testsuite/gas/nios2/brn.s b/gas/testsuite/gas/nios2/brn.s
new file mode 100644
index 0000000..84d9cf1
--- /dev/null
+++ b/gas/testsuite/gas/nios2/brn.s
@@ -0,0 +1,4 @@
+# Source file used to test the br.n instructions
+foo:
+ nop
+ br.n foo