Browse Source

gas/testsuite/

2009-11-11  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/prefix.d: Swap order of ADDR and REP prefixes.
	* gas/i386/rep.d: Likewise.
	* gas/i386/x86-64-rep.d: Likewise.

opcodes/

2009-11-11  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-dis.c (all_prefixes): New.
	(ckprefix): Set all_prefixes.
	(print_insn): Print all_prefixes instead of lock_prefix,
	repz_prefix, repnz_prefix, addr_prefix and data_prefix.
gdb_7_1-branch
H.J. Lu 17 years ago
parent
commit
f310f33d50
  1. 6
      gas/testsuite/ChangeLog
  2. 2
      gas/testsuite/gas/i386/prefix.d
  3. 42
      gas/testsuite/gas/i386/rep.d
  4. 52
      gas/testsuite/gas/i386/x86-64-rep.d
  5. 7
      opcodes/ChangeLog
  6. 44
      opcodes/i386-dis.c

6
gas/testsuite/ChangeLog

@ -1,3 +1,9 @@
2009-11-11 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/prefix.d: Swap order of ADDR and REP prefixes.
* gas/i386/rep.d: Likewise.
* gas/i386/x86-64-rep.d: Likewise.
2009-11-06 Sebastian Pop <sebastian.pop@amd.com> 2009-11-06 Sebastian Pop <sebastian.pop@amd.com>
* gas/i386/x86-64-lwp.s: Updated to also contain patterns * gas/i386/x86-64-lwp.s: Updated to also contain patterns

2
gas/testsuite/gas/i386/prefix.d

@ -10,5 +10,5 @@ Disassembly of section .text:
5: 9b df e0 [ ]*fstsw %ax 5: 9b df e0 [ ]*fstsw %ax
8: 9b df e0 [ ]*fstsw %ax 8: 9b df e0 [ ]*fstsw %ax
b: 9b 67 df e0 [ ]*addr16 fstsw %ax b: 9b 67 df e0 [ ]*addr16 fstsw %ax
f: 36 67 66 f3 a7 [ ]*repz addr16 cmpsw %es:\(%di\),%ss:\(%si\) f: 36 67 66 f3 a7 [ ]*addr16 repz cmpsw %es:\(%di\),%ss:\(%si\)
#pass #pass

42
gas/testsuite/gas/i386/rep.d

@ -27,25 +27,25 @@ Disassembly of section .text:
2b: f3 ab[ ]+rep stos %eax,%es:\(%edi\) 2b: f3 ab[ ]+rep stos %eax,%es:\(%edi\)
2d: f3 a7[ ]+repz cmpsl %es:\(%edi\),%ds:\(%esi\) 2d: f3 a7[ ]+repz cmpsl %es:\(%edi\),%ds:\(%esi\)
2f: f3 af[ ]+repz scas %es:\(%edi\),%eax 2f: f3 af[ ]+repz scas %es:\(%edi\),%eax
31: 67 f3 6c[ ]+rep addr16 insb \(%dx\),%es:\(%di\) 31: 67 f3 6c[ ]+addr16 rep insb \(%dx\),%es:\(%di\)
34: 67 f3 6e[ ]+rep addr16 outsb %ds:\(%si\),\(%dx\) 34: 67 f3 6e[ ]+addr16 rep outsb %ds:\(%si\),\(%dx\)
37: 67 f3 a4[ ]+rep addr16 movsb %ds:\(%si\),%es:\(%di\) 37: 67 f3 a4[ ]+addr16 rep movsb %ds:\(%si\),%es:\(%di\)
3a: 67 f3 ac[ ]+rep addr16 lods %ds:\(%si\),%al 3a: 67 f3 ac[ ]+addr16 rep lods %ds:\(%si\),%al
3d: 67 f3 aa[ ]+rep addr16 stos %al,%es:\(%di\) 3d: 67 f3 aa[ ]+addr16 rep stos %al,%es:\(%di\)
40: 67 f3 a6[ ]+repz addr16 cmpsb %es:\(%di\),%ds:\(%si\) 40: 67 f3 a6[ ]+addr16 repz cmpsb %es:\(%di\),%ds:\(%si\)
43: 67 f3 ae[ ]+repz addr16 scas %es:\(%di\),%al 43: 67 f3 ae[ ]+addr16 repz scas %es:\(%di\),%al
46: 67 66 f3 6d[ ]+rep addr16 insw \(%dx\),%es:\(%di\) 46: 67 66 f3 6d[ ]+addr16 rep insw \(%dx\),%es:\(%di\)
4a: 67 66 f3 6f[ ]+rep addr16 outsw %ds:\(%si\),\(%dx\) 4a: 67 66 f3 6f[ ]+addr16 rep outsw %ds:\(%si\),\(%dx\)
4e: 67 66 f3 a5[ ]+rep addr16 movsw %ds:\(%si\),%es:\(%di\) 4e: 67 66 f3 a5[ ]+addr16 rep movsw %ds:\(%si\),%es:\(%di\)
52: 67 66 f3 ad[ ]+rep addr16 lods %ds:\(%si\),%ax 52: 67 66 f3 ad[ ]+addr16 rep lods %ds:\(%si\),%ax
56: 67 66 f3 ab[ ]+rep addr16 stos %ax,%es:\(%di\) 56: 67 66 f3 ab[ ]+addr16 rep stos %ax,%es:\(%di\)
5a: 67 66 f3 a7[ ]+repz addr16 cmpsw %es:\(%di\),%ds:\(%si\) 5a: 67 66 f3 a7[ ]+addr16 repz cmpsw %es:\(%di\),%ds:\(%si\)
5e: 67 66 f3 af[ ]+repz addr16 scas %es:\(%di\),%ax 5e: 67 66 f3 af[ ]+addr16 repz scas %es:\(%di\),%ax
62: 67 f3 6d[ ]+rep addr16 insl \(%dx\),%es:\(%di\) 62: 67 f3 6d[ ]+addr16 rep insl \(%dx\),%es:\(%di\)
65: 67 f3 6f[ ]+rep addr16 outsl %ds:\(%si\),\(%dx\) 65: 67 f3 6f[ ]+addr16 rep outsl %ds:\(%si\),\(%dx\)
68: 67 f3 a5[ ]+rep addr16 movsl %ds:\(%si\),%es:\(%di\) 68: 67 f3 a5[ ]+addr16 rep movsl %ds:\(%si\),%es:\(%di\)
6b: 67 f3 ad[ ]+rep addr16 lods %ds:\(%si\),%eax 6b: 67 f3 ad[ ]+addr16 rep lods %ds:\(%si\),%eax
6e: 67 f3 ab[ ]+rep addr16 stos %eax,%es:\(%di\) 6e: 67 f3 ab[ ]+addr16 rep stos %eax,%es:\(%di\)
71: 67 f3 a7[ ]+repz addr16 cmpsl %es:\(%di\),%ds:\(%si\) 71: 67 f3 a7[ ]+addr16 repz cmpsl %es:\(%di\),%ds:\(%si\)
74: 67 f3 af[ ]+repz addr16 scas %es:\(%di\),%eax 74: 67 f3 af[ ]+addr16 repz scas %es:\(%di\),%eax
... ...

52
gas/testsuite/gas/i386/x86-64-rep.d

@ -32,30 +32,30 @@ Disassembly of section .text:
37: f3 48 ab[ ]+rep stos %rax,%es:\(%rdi\) 37: f3 48 ab[ ]+rep stos %rax,%es:\(%rdi\)
3a: f3 48 a7[ ]+repz cmpsq %es:\(%rdi\),%ds:\(%rsi\) 3a: f3 48 a7[ ]+repz cmpsq %es:\(%rdi\),%ds:\(%rsi\)
3d: f3 48 af[ ]+repz scas %es:\(%rdi\),%rax 3d: f3 48 af[ ]+repz scas %es:\(%rdi\),%rax
40: 67 f3 6c[ ]+rep addr32 insb \(%dx\),%es:\(%edi\) 40: 67 f3 6c[ ]+addr32 rep insb \(%dx\),%es:\(%edi\)
43: 67 f3 6e[ ]+rep addr32 outsb %ds:\(%esi\),\(%dx\) 43: 67 f3 6e[ ]+addr32 rep outsb %ds:\(%esi\),\(%dx\)
46: 67 f3 a4[ ]+rep addr32 movsb %ds:\(%esi\),%es:\(%edi\) 46: 67 f3 a4[ ]+addr32 rep movsb %ds:\(%esi\),%es:\(%edi\)
49: 67 f3 ac[ ]+rep addr32 lods %ds:\(%esi\),%al 49: 67 f3 ac[ ]+addr32 rep lods %ds:\(%esi\),%al
4c: 67 f3 aa[ ]+rep addr32 stos %al,%es:\(%edi\) 4c: 67 f3 aa[ ]+addr32 rep stos %al,%es:\(%edi\)
4f: 67 f3 a6[ ]+repz addr32 cmpsb %es:\(%edi\),%ds:\(%esi\) 4f: 67 f3 a6[ ]+addr32 repz cmpsb %es:\(%edi\),%ds:\(%esi\)
52: 67 f3 ae[ ]+repz addr32 scas %es:\(%edi\),%al 52: 67 f3 ae[ ]+addr32 repz scas %es:\(%edi\),%al
55: 67 66 f3 6d[ ]+rep addr32 insw \(%dx\),%es:\(%edi\) 55: 67 66 f3 6d[ ]+addr32 rep insw \(%dx\),%es:\(%edi\)
59: 67 66 f3 6f[ ]+rep addr32 outsw %ds:\(%esi\),\(%dx\) 59: 67 66 f3 6f[ ]+addr32 rep outsw %ds:\(%esi\),\(%dx\)
5d: 67 66 f3 a5[ ]+rep addr32 movsw %ds:\(%esi\),%es:\(%edi\) 5d: 67 66 f3 a5[ ]+addr32 rep movsw %ds:\(%esi\),%es:\(%edi\)
61: 67 66 f3 ad[ ]+rep addr32 lods %ds:\(%esi\),%ax 61: 67 66 f3 ad[ ]+addr32 rep lods %ds:\(%esi\),%ax
65: 67 66 f3 ab[ ]+rep addr32 stos %ax,%es:\(%edi\) 65: 67 66 f3 ab[ ]+addr32 rep stos %ax,%es:\(%edi\)
69: 67 66 f3 a7[ ]+repz addr32 cmpsw %es:\(%edi\),%ds:\(%esi\) 69: 67 66 f3 a7[ ]+addr32 repz cmpsw %es:\(%edi\),%ds:\(%esi\)
6d: 67 66 f3 af[ ]+repz addr32 scas %es:\(%edi\),%ax 6d: 67 66 f3 af[ ]+addr32 repz scas %es:\(%edi\),%ax
71: 67 f3 6d[ ]+rep addr32 insl \(%dx\),%es:\(%edi\) 71: 67 f3 6d[ ]+addr32 rep insl \(%dx\),%es:\(%edi\)
74: 67 f3 6f[ ]+rep addr32 outsl %ds:\(%esi\),\(%dx\) 74: 67 f3 6f[ ]+addr32 rep outsl %ds:\(%esi\),\(%dx\)
77: 67 f3 a5[ ]+rep addr32 movsl %ds:\(%esi\),%es:\(%edi\) 77: 67 f3 a5[ ]+addr32 rep movsl %ds:\(%esi\),%es:\(%edi\)
7a: 67 f3 ad[ ]+rep addr32 lods %ds:\(%esi\),%eax 7a: 67 f3 ad[ ]+addr32 rep lods %ds:\(%esi\),%eax
7d: 67 f3 ab[ ]+rep addr32 stos %eax,%es:\(%edi\) 7d: 67 f3 ab[ ]+addr32 rep stos %eax,%es:\(%edi\)
80: 67 f3 a7[ ]+repz addr32 cmpsl %es:\(%edi\),%ds:\(%esi\) 80: 67 f3 a7[ ]+addr32 repz cmpsl %es:\(%edi\),%ds:\(%esi\)
83: 67 f3 af[ ]+repz addr32 scas %es:\(%edi\),%eax 83: 67 f3 af[ ]+addr32 repz scas %es:\(%edi\),%eax
86: 67 f3 48 a5[ ]+rep addr32 movsq %ds:\(%esi\),%es:\(%edi\) 86: 67 f3 48 a5[ ]+addr32 rep movsq %ds:\(%esi\),%es:\(%edi\)
8a: 67 f3 48 ad[ ]+rep addr32 lods %ds:\(%esi\),%rax 8a: 67 f3 48 ad[ ]+addr32 rep lods %ds:\(%esi\),%rax
8e: 67 f3 48 ab[ ]+rep addr32 stos %rax,%es:\(%edi\) 8e: 67 f3 48 ab[ ]+addr32 rep stos %rax,%es:\(%edi\)
92: 67 f3 48 a7[ ]+repz addr32 cmpsq %es:\(%edi\),%ds:\(%esi\) 92: 67 f3 48 a7[ ]+addr32 repz cmpsq %es:\(%edi\),%ds:\(%esi\)
96: 67 f3 48 af[ ]+repz addr32 scas %es:\(%edi\),%rax 96: 67 f3 48 af[ ]+addr32 repz scas %es:\(%edi\),%rax
#pass #pass

7
opcodes/ChangeLog

@ -1,3 +1,10 @@
2009-11-11 H.J. Lu <hongjiu.lu@intel.com>
* i386-dis.c (all_prefixes): New.
(ckprefix): Set all_prefixes.
(print_insn): Print all_prefixes instead of lock_prefix,
repz_prefix, repnz_prefix, addr_prefix and data_prefix.
2009-11-11 Nick Clifton <nickc@redhat.com> 2009-11-11 Nick Clifton <nickc@redhat.com>
PR binutils/10924 PR binutils/10924

44
opcodes/i386-dis.c

@ -1997,6 +1997,7 @@ static const char *data_prefix;
static const char *addr_prefix; static const char *addr_prefix;
static const char *repz_prefix; static const char *repz_prefix;
static const char *repnz_prefix; static const char *repnz_prefix;
static const char **all_prefixes[5];
static disassemble_info *the_info; static disassemble_info *the_info;
static struct static struct
{ {
@ -9572,13 +9573,16 @@ static const struct dis386 rm_table[][8] = {
static void static void
ckprefix (void) ckprefix (void)
{ {
int newrex; int newrex, i;
rex = 0; rex = 0;
rex_original = 0; rex_original = 0;
rex_ignored = 0; rex_ignored = 0;
prefixes = 0; prefixes = 0;
used_prefixes = 0; used_prefixes = 0;
rex_used = 0; rex_used = 0;
for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
all_prefixes[i] = 0;
i = 0;
while (1) while (1)
{ {
FETCH_DATA (the_info, codep + 1); FETCH_DATA (the_info, codep + 1);
@ -9608,12 +9612,27 @@ ckprefix (void)
return; return;
break; break;
case 0xf3: case 0xf3:
if ((prefixes & PREFIX_REPZ) == 0)
{
all_prefixes[i] = &repz_prefix;
i++;
}
prefixes |= PREFIX_REPZ; prefixes |= PREFIX_REPZ;
break; break;
case 0xf2: case 0xf2:
if ((prefixes & PREFIX_REPNZ) == 0)
{
all_prefixes[i] = &repnz_prefix;
i++;
}
prefixes |= PREFIX_REPNZ; prefixes |= PREFIX_REPNZ;
break; break;
case 0xf0: case 0xf0:
if ((prefixes & PREFIX_LOCK) == 0)
{
all_prefixes[i] = &lock_prefix;
i++;
}
prefixes |= PREFIX_LOCK; prefixes |= PREFIX_LOCK;
break; break;
case 0x2e: case 0x2e:
@ -9635,9 +9654,19 @@ ckprefix (void)
prefixes |= PREFIX_GS; prefixes |= PREFIX_GS;
break; break;
case 0x66: case 0x66:
if ((prefixes & PREFIX_DATA) == 0)
{
all_prefixes[i] = &data_prefix;
i++;
}
prefixes |= PREFIX_DATA; prefixes |= PREFIX_DATA;
break; break;
case 0x67: case 0x67:
if ((prefixes & PREFIX_ADDR) == 0)
{
all_prefixes[i] = &addr_prefix;
i++;
}
prefixes |= PREFIX_ADDR; prefixes |= PREFIX_ADDR;
break; break;
case FWAIT_OPCODE: case FWAIT_OPCODE:
@ -10437,16 +10466,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
prefix_obuf[0] = 0; prefix_obuf[0] = 0;
prefix_obufp = prefix_obuf; prefix_obufp = prefix_obuf;
if (lock_prefix) for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
prefix_obufp = stpcpy (prefix_obufp, lock_prefix); if (all_prefixes[i] && *all_prefixes[i])
if (repz_prefix) prefix_obufp = stpcpy (prefix_obufp, *all_prefixes[i]);
prefix_obufp = stpcpy (prefix_obufp, repz_prefix);
if (repnz_prefix)
prefix_obufp = stpcpy (prefix_obufp, repnz_prefix);
if (addr_prefix)
prefix_obufp = stpcpy (prefix_obufp, addr_prefix);
if (data_prefix)
prefix_obufp = stpcpy (prefix_obufp, data_prefix);
if (prefix_obuf[0] != 0) if (prefix_obuf[0] != 0)
(*info->fprintf_func) (info->stream, "%s", prefix_obuf); (*info->fprintf_func) (info->stream, "%s", prefix_obuf);

Loading…
Cancel
Save