opcodes/
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 10 Jun 2003 07:27:56 +0000 (07:27 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Tue, 10 Jun 2003 07:27:56 +0000 (07:27 +0000)
* h8300-dis.c (bfd_h8_disassemble): Don't print brackets round
rts/l and rte/l register lists.

gas/
* config/tc-h8300.c (get_rtsl_operands): Accept unbracketed register
lists.  Allow single-register ranges.

testsuite/
* gas/h8300/h8sx_rtsl.[sd]: New test.
* gas/h8300/h8300.exp: Run it.

gas/ChangeLog
gas/config/tc-h8300.c
gas/testsuite/ChangeLog
gas/testsuite/gas/h8300/h8300.exp
gas/testsuite/gas/h8300/h8sx_rtsl.d [new file with mode: 0644]
gas/testsuite/gas/h8300/h8sx_rtsl.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/h8300-dis.c

index 9a3888fed8953255b1c26d03bcede895cca2762c..9a69d58d7d3644b60daf7b9137a6208e3816f3d0 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
+
+       * config/tc-h8300.c (get_rtsl_operands): Accept unbracketed register
+       lists.  Allow single-register ranges.
+
 2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/tc-h8300.c (h8300sxnmode): New.
index 6e6a170a387b66c5ebdc35dc4dba780352941124..6a6e3a87a61aeb8f69f87847cc570eaf3503b87f 100644 (file)
@@ -1091,29 +1091,19 @@ get_rtsl_operands (char *ptr, struct h8_op *operand)
       as_bad (_("expected register"));
       return;
     }
-  if (type == 1)
+  ptr += len;
+  if (*ptr == '-')
     {
-      ptr += len;
-      if (*ptr++ != '-')
-       {
-         as_bad (_("expected register list"));
-         return;
-       }
-      len = parse_reg (ptr, &mode, &num2, SRC);
+      len = parse_reg (++ptr, &mode, &num2, SRC);
       if (len == 0 || (mode & MODE) != REG)
        {
          as_bad (_("expected register"));
          return;
        }
       ptr += len;
-      if (*ptr++ != ')')
-       {
-         as_bad (_("expected closing paren"));
-         return;
-       }
       /* CONST_xxx are used as placeholders in the opcode table.  */
       num = num2 - num;
-      if (num < 1 || num > 3)
+      if (num < 0 || num > 3)
        {
          as_bad (_("invalid register list"));
          return;
@@ -1121,6 +1111,11 @@ get_rtsl_operands (char *ptr, struct h8_op *operand)
     }
   else
     num2 = num, num = 0;
+  if (type == 1 && *ptr++ != ')')
+    {
+      as_bad (_("expected closing paren"));
+      return;
+    }
   operand[0].mode = RS32;
   operand[1].mode = RD32;
   operand[0].reg = num;
index d72b21abe171f68cf4dee445ea4a3d1a86977940..4ea3d4b3277828c67b755c750d983601d0711b1d 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gas/h8300/h8sx_rtsl.[sd]: New test.
+       * gas/h8300/h8300.exp: Run it.
+
 2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
 
        * gas/h8300/h8sx_disp2.[sd]: New test.
index 8162f4847b24cd718a810fd94fff5b9662607aa6..e167a3f2c9f542a82bae3b3cee8fe668a2a24b40 100644 (file)
@@ -2168,6 +2168,7 @@ if [istarget h8300*-*-*] then {
     do_h8300h_mov32bug
 
     run_dump_test h8sx_disp2
+    run_dump_test h8sx_rtsl
 
     # Now some random tests
     set svr4pic [expr [istarget *-*-elf*] || [istarget *-*-irix5*] ]
diff --git a/gas/testsuite/gas/h8300/h8sx_rtsl.d b/gas/testsuite/gas/h8300/h8sx_rtsl.d
new file mode 100644 (file)
index 0000000..648faf9
--- /dev/null
@@ -0,0 +1,14 @@
+# objdump: -dr
+
+.*: *file format elf32-h8300
+
+Disassembly of section \.text:
+
+0+00 <\.text>:
+ *0:   54 00 * 54 00 * rts/l   er0
+ *2:   54 01 * 54 01 * rts/l   er1
+ *4:   54 03 * 54 03 * rts/l   er3
+ *6:   54 05 * 54 05 * rts/l   er5
+ *8:   54 16 * 54 16 * rts/l   er5-er6
+ *a:   54 25 * 54 25 * rts/l   er3-er5
+ *c:   54 34 * 54 34 * rts/l   er1-er4
diff --git a/gas/testsuite/gas/h8300/h8sx_rtsl.s b/gas/testsuite/gas/h8300/h8sx_rtsl.s
new file mode 100644 (file)
index 0000000..b5f4788
--- /dev/null
@@ -0,0 +1,8 @@
+       .h8300sx
+       rts/l   er0
+       rts/l   er1-er1
+       rts/l   (er3)
+       rts/l   (er5-er5)
+       rts/l   er5-er6
+       rts/l   er3-er5
+       rts/l   (er1-er4)
index 820027807a377d71667aef6045bf08c3ae5b63e2..afe48fd1d5adedaf8e123c0e87fb173cdbf5973d 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-10  Richard Sandiford  <rsandifo@redhat.com>
+
+       * h8300-dis.c (bfd_h8_disassemble): Don't print brackets round
+       rts/l and rte/l register lists.
+
 2003-06-03  Nick Clifton  <nickc@redhat.com>
 
        * frv-desc.c: Regenerate.
index 299267f4605586df52f279ce1123da05da97987f..ea8d30b457c657a7f39550cc3717322a4d332526 100644 (file)
@@ -698,7 +698,7 @@ bfd_h8_disassemble (addr, info, mach)
                        outfn (stream, "er%d", regno[1]);
                      else
                        {
-                         outfn (stream, "(er%d-er%d)", regno[1] - regno[0],
+                         outfn (stream, "er%d-er%d", regno[1] - regno[0],
                                 regno[1]);
                        }
                      return qi->length;
This page took 0.035054 seconds and 4 git commands to generate.