aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-04-15 09:53:13 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-04-15 09:57:55 -0700
commitf24bcbaa5a6e30556e2da20bfd78e7823741475a (patch)
tree1a56cd0b6f00c81f88800c767c226a0578a5c67a /opcodes
parent507bd32558eb1c0054b7989d52ac1ab25cc5b0ac (diff)
downloadfsf-binutils-gdb-f24bcbaa5a6e30556e2da20bfd78e7823741475a.zip
fsf-binutils-gdb-f24bcbaa5a6e30556e2da20bfd78e7823741475a.tar.gz
fsf-binutils-gdb-f24bcbaa5a6e30556e2da20bfd78e7823741475a.tar.bz2
Handle invalid prefixes for rdrand and rdseed
This patch puts rdrand and rdseed in prefix_table so that invalid prefixes for rdrand and rdseed are handled properly. gas/testsuite/ PR binutils/17898 * gas/i386/prefix.s: Add rdrand/rdseed prefix tests. * gas/i386/prefix.d: Updated. opcodes/ PR binutils/17898 * i386-dis.c (PREFIX_0FC7_REG_6): Renamed to ... (PREFIX_MOD_0_0FC7_REG_6): This. (PREFIX_MOD_3_0FC7_REG_6): New. (PREFIX_MOD_3_0FC7_REG_7): Likewise. (prefix_table): Replace PREFIX_0FC7_REG_6 with PREFIX_MOD_0_0FC7_REG_6. Add PREFIX_MOD_3_0FC7_REG_6 and PREFIX_MOD_3_0FC7_REG_7. (mod_table): Replace PREFIX_0FC7_REG_6 with PREFIX_MOD_0_0FC7_REG_6. Use PREFIX_MOD_3_0FC7_REG_6 and PREFIX_MOD_3_0FC7_REG_7.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog14
-rw-r--r--opcodes/i386-dis.c26
2 files changed, 35 insertions, 5 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index b378dc1..b46c861 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,19 @@
2015-04-15 H.J. Lu <hongjiu.lu@intel.com>
+ PR binutils/17898
+ * i386-dis.c (PREFIX_0FC7_REG_6): Renamed to ...
+ (PREFIX_MOD_0_0FC7_REG_6): This.
+ (PREFIX_MOD_3_0FC7_REG_6): New.
+ (PREFIX_MOD_3_0FC7_REG_7): Likewise.
+ (prefix_table): Replace PREFIX_0FC7_REG_6 with
+ PREFIX_MOD_0_0FC7_REG_6. Add PREFIX_MOD_3_0FC7_REG_6 and
+ PREFIX_MOD_3_0FC7_REG_7.
+ (mod_table): Replace PREFIX_0FC7_REG_6 with
+ PREFIX_MOD_0_0FC7_REG_6. Use PREFIX_MOD_3_0FC7_REG_6 and
+ PREFIX_MOD_3_0FC7_REG_7.
+
+2015-04-15 H.J. Lu <hongjiu.lu@intel.com>
+
* i386-dis.c (PREFIX_MANDATORY_REPZ): Removed.
(PREFIX_MANDATORY_REPNZ): Likewise.
(PREFIX_MANDATORY_DATA): Likewise.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 1841488..76ecb5a 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -933,7 +933,9 @@ enum
PREFIX_0FBD,
PREFIX_0FC2,
PREFIX_0FC3,
- PREFIX_0FC7_REG_6,
+ PREFIX_MOD_0_0FC7_REG_6,
+ PREFIX_MOD_3_0FC7_REG_6,
+ PREFIX_MOD_3_0FC7_REG_7,
PREFIX_0FD0,
PREFIX_0FD6,
PREFIX_0FE6,
@@ -4047,13 +4049,27 @@ static const struct dis386 prefix_table[][4] = {
{ "movntiS", { Ma, Gv }, PREFIX_OPCODE },
},
- /* PREFIX_0FC7_REG_6 */
+ /* PREFIX_MOD_0_0FC7_REG_6 */
{
{ "vmptrld",{ Mq }, 0 },
{ "vmxon", { Mq }, 0 },
{ "vmclear",{ Mq }, 0 },
},
+ /* PREFIX_MOD_3_0FC7_REG_6 */
+ {
+ { "rdrand", { Ev }, 0 },
+ { Bad_Opcode },
+ { "rdrand", { Ev }, 0 }
+ },
+
+ /* PREFIX_MOD_3_0FC7_REG_7 */
+ {
+ { "rdseed", { Ev }, 0 },
+ { Bad_Opcode },
+ { "rdseed", { Ev }, 0 },
+ },
+
/* PREFIX_0FD0 */
{
{ Bad_Opcode },
@@ -11808,13 +11824,13 @@ static const struct dis386 mod_table[][2] = {
},
{
/* MOD_0FC7_REG_6 */
- { PREFIX_TABLE (PREFIX_0FC7_REG_6) },
- { "rdrand", { Ev }, 0 },
+ { PREFIX_TABLE (PREFIX_MOD_0_0FC7_REG_6) },
+ { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_6) }
},
{
/* MOD_0FC7_REG_7 */
{ "vmptrst", { Mq }, 0 },
- { "rdseed", { Ev }, 0 },
+ { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_7) }
},
{
/* MOD_0FD7 */