aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/i386-dis.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index a839a68..9bfd67b 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-28 Ramiro Polla <ramiro@hex-rays.com>
+ Amit Pawar <amit.pawar@amd.com>
+
+ PR binutils/20637
+ * i386-dis.c (get_valid_dis386): Ignore REX_B for 32-bit XOP
+ instructions.
+
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 5f49f91..ada4401 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -12670,11 +12670,15 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
rex |= REX_W;
vex.register_specifier = (~(*codep >> 3)) & 0xf;
- if (address_mode != mode_64bit
- && vex.register_specifier > 0x7)
+ if (address_mode != mode_64bit)
{
- dp = &bad_opcode;
- return dp;
+ /* In 16/32-bit mode REX_B is silently ignored. */
+ rex &= ~REX_B;
+ if (vex.register_specifier > 0x7)
+ {
+ dp = &bad_opcode;
+ return dp;
+ }
}
vex.length = (*codep & 0x4) ? 256 : 128;