]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/testsuite/gas/i386/opcode.d
X86: Disassemble primary opcode map's group 2 ModRM.reg == 6 aliases correctly
authorBorislav Petkov <bp@suse.de>
Wed, 5 Jul 2017 09:27:49 +0000 (11:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 5 Jul 2017 09:27:49 +0000 (11:27 +0200)
commite4bdd679556e4e4ba71bcd066cc98ee7c2f4fca2
tree9659a1146cb84fda14a65d62524d3d85e65c03b1
parent60c96dbf02fcdb30942b9db7a138afcfc2b7220e
X86: Disassemble primary opcode map's group 2 ModRM.reg == 6 aliases correctly

The instructions are not documented in the Intel SDM but are documented
in the AMD APM as an alias to the group 2, ModRM.reg == 4 variant.

Both AMD and Intel CPUs execute the C[0-1] and D[0-3] instructions as
expected, i.e., like the /4 aliases:

  #include <stdio.h>

  int main(void)
  {
          int a = 2;

          printf ("a before: %d\n", a);

          asm volatile(".byte 0xd0,0xf0"          /* SHL %al */
                       : "+a" (a));

          printf("a after : %d\n", a);

          return 0;
  }

  $ ./a.out
  a before: 2
  a after : 4
gas/ChangeLog
gas/testsuite/gas/i386/opcode.d
gas/testsuite/gas/i386/opcode.s
gas/testsuite/gas/i386/x86-64-opcode.d
gas/testsuite/gas/i386/x86-64-opcode.s
opcodes/ChangeLog
opcodes/i386-dis.c