gas/testsuite/
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 7 May 2005 13:30:02 +0000 (13:30 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 7 May 2005 13:30:02 +0000 (13:30 +0000)
2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>

PR 843
* gas/i386/i386.exp: Add x86-64-branch.

* gas/i386/x86-64-branch.d: New.
* gas/i386/x86-64-branch.s: New.

opcodes/

2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>

PR 843
* i386-dis.c (branch_v_mode): New.
(indirEv): Use branch_v_mode instead of v_mode.
(OP_E): Handle branch_v_mode.

gas/testsuite/ChangeLog
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/x86-64-branch.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-branch.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/i386-dis.c

index 1f4b1c942d67d9151ee7bf28b329899f49cb212b..bcd4da6771dd06f54ec608da805ccf6b8cea9e77 100644 (file)
@@ -1,3 +1,11 @@
+2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 843
+       * gas/i386/i386.exp: Add x86-64-branch.
+
+       * gas/i386/x86-64-branch.d: New.
+       * gas/i386/x86-64-branch.s: New.
+
 2005-05-06  Jan Beulich  <jbeulich@novell.com>
 
        * gas/macros/badarg.s: Add check for bad qualifier specification.
index 0922e747ca836cd11607b31d2705157c4676e174..34862a50ef121651d6258327bec7ff2da9863084 100644 (file)
@@ -127,6 +127,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
     run_list_test "x86-64-inval" "-al"
     run_list_test "x86-64-segment" "-al"
     run_list_test "x86-64-inval-seg" "-al"
+    run_dump_test "x86-64-branch"
 
     # For ELF targets verify that @unwind works.
     if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"]
diff --git a/gas/testsuite/gas/i386/x86-64-branch.d b/gas/testsuite/gas/i386/x86-64-branch.d
new file mode 100644 (file)
index 0000000..7ddd6fe
--- /dev/null
@@ -0,0 +1,13 @@
+#as: -J
+#objdump: -drw
+#name: x86-64 indirect branch
+
+.*: +file format elf64-x86-64
+
+Disassembly of section .text:
+
+0+000 <.text>:
+[       ]*0:[   ]+ff d0[        ]+callq[        ]+\*%rax
+[       ]*2:[   ]+ff d0[        ]+callq[        ]+\*%rax
+[       ]*4:[   ]+ff e0[        ]+jmpq[         ]+\*%rax
+[       ]*6:[   ]+ff e0[        ]+jmpq[         ]+\*%rax
diff --git a/gas/testsuite/gas/i386/x86-64-branch.s b/gas/testsuite/gas/i386/x86-64-branch.s
new file mode 100644 (file)
index 0000000..865c475
--- /dev/null
@@ -0,0 +1,5 @@
+.text
+       callq   *%rax
+       call    *%rax
+       jmpq    *%rax
+       jmp     *%rax
index 30956eb81e2b06975eb1ecaf4dd0c2ffc6d4857d..b76172ee403e8cf616932a9443811b30a91a5dc8 100644 (file)
@@ -1,3 +1,10 @@
+2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR 843
+       * i386-dis.c (branch_v_mode): New.
+       (indirEv): Use branch_v_mode instead of v_mode.
+       (OP_E): Handle branch_v_mode.
+
 2005-05-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * d10v-dis.c (dis_2_short): Support 64bit host.
index 0014a706ad89889adc206542d6d5ba07b04be9f1..15f43c30b25761679145c6d29d2211908fc717db 100644 (file)
@@ -197,7 +197,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define Eq OP_E, q_mode
 #define Edq OP_E, dq_mode
 #define Edqw OP_E, dqw_mode
-#define indirEv OP_indirE, v_mode
+#define indirEv OP_indirE, branch_v_mode
 #define indirEp OP_indirE, f_mode
 #define Ew OP_E, w_mode
 #define Ma OP_E, v_mode
@@ -323,6 +323,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define dqw_mode 12 /* registers like dq_mode, memory like w_mode.  */
 #define f_mode 13 /* 4- or 6-byte pointer operand */
 #define const_1_mode 14
+#define branch_v_mode 15 /* v_mode for branch.  */
 
 #define es_reg 100
 #define cs_reg 101
@@ -3155,6 +3156,18 @@ OP_E (int bytemode, int sizeflag)
          else
            oappend (names32[rm + add]);
          break;
+       case branch_v_mode:
+         if (mode_64bit)
+           oappend (names64[rm + add]);
+         else
+           {
+             if ((sizeflag & DFLAG) || bytemode != branch_v_mode)
+               oappend (names32[rm + add]);
+             else
+               oappend (names16[rm + add]);
+             used_prefixes |= (prefixes & PREFIX_DATA);
+           }
+         break;
        case v_mode:
        case dq_mode:
        case dqw_mode:
@@ -3256,6 +3269,7 @@ OP_E (int bytemode, int sizeflag)
                case dqw_mode:
                  oappend ("WORD PTR ");
                  break;
+               case branch_v_mode:
                case v_mode:
                case dq_mode:
                  USED_REX (REX_MODE64);