From: Andrew Burgess Date: Tue, 14 Jun 2016 20:48:11 +0000 (+0100) Subject: opcodes/arc: Fix extract for some add_s instructions X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=02f3be19f6fca3a46794f8f32350cc090ac38d0e;hp=31eef93e717c59975b3e6f37619ab956302ca37a;p=deliverable%2Fbinutils-gdb.git opcodes/arc: Fix extract for some add_s instructions The extract function used for some arc_s instructions was not implemented, and instead always returned 0. Fixed in this commit. opcodes/ChangeLog: * arc-opc.c (extract_rhv1): Extract value from insn. gas/ChangeLog: * testsuite/gas/arc/add_s.d: New file. * testsuite/gas/arc/add_s.s: New file. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index df77393623..eba7ddf8c1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2016-06-15 Andrew Burgess + + * testsuite/gas/arc/add_s.d: New file. + * testsuite/gas/arc/add_s.s: New file. + 2016-06-14 Graham Markall * testsuite/gas/arc/nps400-6.s: Add tests of ldbit. diff --git a/gas/testsuite/gas/arc/add_s.d b/gas/testsuite/gas/arc/add_s.d new file mode 100644 index 0000000000..31b60e45f7 --- /dev/null +++ b/gas/testsuite/gas/arc/add_s.d @@ -0,0 +1,8 @@ +#as: -mcpu=arc700 +#objdump: -dr --prefix-addresses --show-raw-insn + +.*: +file format .*arc.* + +Disassembly of section .text: +0x[0-9a-f]+ 6178 add_s r0,r1,r3 +0x[0-9a-f]+ 70e7 add_s r0,r0,pcl diff --git a/gas/testsuite/gas/arc/add_s.s b/gas/testsuite/gas/arc/add_s.s new file mode 100644 index 0000000000..71b60f8227 --- /dev/null +++ b/gas/testsuite/gas/arc/add_s.s @@ -0,0 +1,4 @@ +# add_s test + + add_s r0,r1,r3 + add_s r0,r0,pcl diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index ecc5261206..9ca0760acc 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2016-06-15 Andrew Burgess + + * arc-opc.c (extract_rhv1): Extract value from insn. + 2016-06-14 Graham Markall * arc-nps400-tbl.h: Add ldbit instruction. diff --git a/opcodes/arc-opc.c b/opcodes/arc-opc.c index 433fdcc9ab..25db8684ca 100644 --- a/opcodes/arc-opc.c +++ b/opcodes/arc-opc.c @@ -130,7 +130,7 @@ static int extract_rhv1 (unsigned insn ATTRIBUTE_UNUSED, bfd_boolean * invalid ATTRIBUTE_UNUSED) { - int value = 0; + int value = ((insn & 0x7) << 3) | ((insn >> 5) & 0x7); return value; }