aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-04-29 13:13:55 +0100
committerNick Clifton <nickc@redhat.com>2020-04-29 13:13:55 +0100
commit5c936ef50f02fe21a6e1306e30849b4487c65b2c (patch)
tree5a9e05736ce354bf06a4221c3cb18e2a314e42ec /gas
parent4849fabc7c4c47d770b61adc025e34bc2a23fe23 (diff)
downloadfsf-binutils-gdb-5c936ef50f02fe21a6e1306e30849b4487c65b2c.zip
fsf-binutils-gdb-5c936ef50f02fe21a6e1306e30849b4487c65b2c.tar.gz
fsf-binutils-gdb-5c936ef50f02fe21a6e1306e30849b4487c65b2c.tar.bz2
Fix the disassmbly of SH instructions which have an unsigned 8-bit immediate operand.
PR 22699 opcodes * sh-opc.h (IMM0_8): Replace with IMM0_8S and IMM0_8U. Use IMM0_8S for arithmetic insns and IMM0_8U for logical insns. * sh-dis.c (print_insn_sh): Change IMM0_8 case to IMM0_8S and add IMM0_8U case. gas * config/tc-sh.c (build_Mytes): Change operand type IMM0_8 to IMM0_8S and add support for IMM0_8U. * testsuite/gas/sh/sh4a.s: Add test of a logical insn using an unsigned 8-bit immediate. * testsuite/gas/sh/sh4a.d: Extended expected disassembly.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-sh.c3
-rw-r--r--gas/testsuite/gas/sh/sh4a.d2
-rw-r--r--gas/testsuite/gas/sh/sh4a.s2
4 files changed, 15 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8cbe5ec..8df687b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2020-04-29 Nick Clifton <nickc@redhat.com>
+
+ PR 22699
+ * config/tc-sh.c (build_Mytes): Change operand type IMM0_8 to
+ IMM0_8S and add support for IMM0_8U.
+ * testsuite/gas/sh/sh4a.s: Add test of a logical insn using an
+ unsigned 8-bit immediate.
+ * testsuite/gas/sh/sh4a.d: Extended expected disassembly.
+
2020-04-27 Tamar Christina <tamar.christina@arm.com>
* NEWS: Add news entry for big-obj.
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index decbb29..d06cc5e 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -2091,7 +2091,8 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand)
case IMM0_8BY2:
insert (output + low_byte, BFD_RELOC_SH_IMM8BY2, 0, operand);
break;
- case IMM0_8:
+ case IMM0_8U:
+ case IMM0_8S:
insert (output + low_byte, BFD_RELOC_SH_IMM8, 0, operand);
break;
case IMM1_8BY4:
diff --git a/gas/testsuite/gas/sh/sh4a.d b/gas/testsuite/gas/sh/sh4a.d
index 0cdbf33..45fade6 100644
--- a/gas/testsuite/gas/sh/sh4a.d
+++ b/gas/testsuite/gas/sh/sh4a.d
@@ -25,3 +25,5 @@ Disassembly of section \.text:
0x0000001e 05 d3 prefi @r5
0x00000020 0a d3 prefi @r10
0x00000022 00 ab synco
+0x00000024 c8 80[ ]+tst[ ]+#128,r0
+#pass
diff --git a/gas/testsuite/gas/sh/sh4a.s b/gas/testsuite/gas/sh/sh4a.s
index 51c2382..6b68ec2 100644
--- a/gas/testsuite/gas/sh/sh4a.s
+++ b/gas/testsuite/gas/sh/sh4a.s
@@ -26,3 +26,5 @@
prefi @r10
synco
+
+ tst #128,r0