aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-07-06 13:42:33 +0200
committerJan Beulich <jbeulich@suse.com>2020-07-06 13:42:33 +0200
commitfedfb81e60564682bc5c5d5592fdea39ca520c6e (patch)
tree5bafab5f3764344034beefa7041c85bc79a78528 /opcodes
parent3a57774c7b3840355b5b21818515fa2b6df3e5e9 (diff)
downloadgdb-fedfb81e60564682bc5c5d5592fdea39ca520c6e.zip
gdb-fedfb81e60564682bc5c5d5592fdea39ca520c6e.tar.gz
gdb-fedfb81e60564682bc5c5d5592fdea39ca520c6e.tar.bz2
x86: drop EVEX table entries that can be made served by VEX ones
By doing the EVEX.W decode first, in various cases VEX table entries can be re-used.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog32
-rw-r--r--opcodes/i386-dis-evex-prefix.h90
-rw-r--r--opcodes/i386-dis-evex-w.h60
-rw-r--r--opcodes/i386-dis-evex.h30
-rw-r--r--opcodes/i386-dis.c45
5 files changed, 92 insertions, 165 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index c72e1d1..f9b87d1 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,37 @@
2020-07-06 Jan Beulich <jbeulich@suse.com>
+ * i386-dis.c (PREFIX_EVEX_0F62, PREFIX_EVEX_0F6A,
+ PREFIX_EVEX_0F6B, PREFIX_EVEX_0F6C, PREFIX_EVEX_0F6D,
+ PREFIX_EVEX_0FD2, PREFIX_EVEX_0FD3, PREFIX_EVEX_0FD4,
+ PREFIX_EVEX_0FF2, PREFIX_EVEX_0FF3, PREFIX_EVEX_0FF4,
+ PREFIX_EVEX_0FFA, PREFIX_EVEX_0FFB, PREFIX_EVEX_0FFE,
+ PREFIX_EVEX_0F382B): Delete.
+ (EVEX_W_0F62_P_2, EVEX_W_0F6A_P_2, EVEX_W_0F6B_P_2,
+ EVEX_W_0F6C_P_2, EVEX_W_0F6D_P_2, EVEX_W_0FD2_P_2,
+ EVEX_W_0FD3_P_2, EVEX_W_0FD4_P_2, EVEX_W_0FF2_P_2,
+ EVEX_W_0FF3_P_2, EVEX_W_0FF4_P_2, EVEX_W_0FFA_P_2,
+ EVEX_W_0FFB_P_2, EVEX_W_0FFE_P_2, EVEX_W_0F382B_P_2): Rename
+ to ...
+ (EVEX_W_0F62, EVEX_W_0F6A, EVEX_W_0F6B, EVEX_W_0F6C,
+ EVEX_W_0F6D, EVEX_W_0FD2, EVEX_W_0FD3, EVEX_W_0FD4,
+ EVEX_W_0FF2, EVEX_W_0FF3, EVEX_W_0FF4, EVEX_W_0FFA,
+ EVEX_W_0FFB, EVEX_W_0FFE, EVEX_W_0F382B): ... these
+ respectively.
+ * i386-dis-evex.h (evex_table): Reference VEX_W table entries
+ for opcodes 0F62, 0F6A, 0F6B, 0F6C, 0F6D, 0FD2, 0FD3, 0FD4,
+ 0FF2, 0FF3, 0FF4, 0FFA, 0FFB, 0FFE, 0F382B.
+ * i386-dis-evex-prefix.h (PREFIX_EVEX_0F62, PREFIX_EVEX_0F6A,
+ PREFIX_EVEX_0F6B, PREFIX_EVEX_0F6C, PREFIX_EVEX_0F6D,
+ PREFIX_EVEX_0FD2, PREFIX_EVEX_0FD3, PREFIX_EVEX_0FD4,
+ PREFIX_EVEX_0FF2, PREFIX_EVEX_0FF3, PREFIX_EVEX_0FF4,
+ PREFIX_EVEX_0FFA, PREFIX_EVEX_0FFB, PREFIX_EVEX_0FFE,
+ PREFIX_EVEX_0F382B): Remove table entries.
+ * i386-dis-evex-w.h: Reference VEX table entries for opcodes
+ 0F62, 0F6A, 0F6B, 0F6C, 0F6D, 0FD2, 0FD3, 0FD4, 0FF2, 0FF3,
+ 0FF4, 0FFA, 0FFB, 0FFE, 0F382B.
+
+2020-07-06 Jan Beulich <jbeulich@suse.com>
+
* i386-dis.c (EVEX_LEN_0F3816_P_2, EVEX_LEN_0F3836_P_2,
EVEX_LEN_0F3A00_P_2_W_1, EVEX_LEN_0F3A01_P_2_W_1): New
enumerators.
diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h
index 25514db..4bfa319 100644
--- a/opcodes/i386-dis-evex-prefix.h
+++ b/opcodes/i386-dis-evex-prefix.h
@@ -120,12 +120,6 @@
{ "vmaxpX", { XM, Vex, EXx, EXxEVexS }, PREFIX_OPCODE },
{ VEX_W_TABLE (EVEX_W_0F5F_P_3) },
},
- /* PREFIX_EVEX_0F62 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F62_P_2) },
- },
/* PREFIX_EVEX_0F64 */
{
{ Bad_Opcode },
@@ -144,30 +138,6 @@
{ Bad_Opcode },
{ VEX_W_TABLE (EVEX_W_0F66_P_2) },
},
- /* PREFIX_EVEX_0F6A */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F6A_P_2) },
- },
- /* PREFIX_EVEX_0F6B */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F6B_P_2) },
- },
- /* PREFIX_EVEX_0F6C */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F6C_P_2) },
- },
- /* PREFIX_EVEX_0F6D */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F6D_P_2) },
- },
/* PREFIX_EVEX_0F6E */
{
{ Bad_Opcode },
@@ -338,24 +308,6 @@
{ Bad_Opcode },
{ EVEX_LEN_TABLE (EVEX_LEN_0FC5_P_2) },
},
- /* PREFIX_EVEX_0FD2 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FD2_P_2) },
- },
- /* PREFIX_EVEX_0FD3 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FD3_P_2) },
- },
- /* PREFIX_EVEX_0FD4 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FD4_P_2) },
- },
/* PREFIX_EVEX_0FD6 */
{
{ Bad_Opcode },
@@ -405,42 +357,6 @@
{ Bad_Opcode },
{ "vpxor%LW", { XM, Vex, EXx }, 0 },
},
- /* PREFIX_EVEX_0FF2 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FF2_P_2) },
- },
- /* PREFIX_EVEX_0FF3 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FF3_P_2) },
- },
- /* PREFIX_EVEX_0FF4 */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FF4_P_2) },
- },
- /* PREFIX_EVEX_0FFA */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FFA_P_2) },
- },
- /* PREFIX_EVEX_0FFB */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FFB_P_2) },
- },
- /* PREFIX_EVEX_0FFE */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0FFE_P_2) },
- },
/* PREFIX_EVEX_0F380D */
{
{ Bad_Opcode },
@@ -585,12 +501,6 @@
{ VEX_W_TABLE (EVEX_W_0F382A_P_1) },
{ VEX_W_TABLE (EVEX_W_0F382A_P_2) },
},
- /* PREFIX_EVEX_0F382B */
- {
- { Bad_Opcode },
- { Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F382B_P_2) },
- },
/* PREFIX_EVEX_0F382C */
{
{ Bad_Opcode },
diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h
index b388def..86cb68e 100644
--- a/opcodes/i386-dis-evex-w.h
+++ b/opcodes/i386-dis-evex-w.h
@@ -136,31 +136,31 @@
{ Bad_Opcode },
{ "vmaxsd", { XMScalar, VexScalar, EXxmm_mq, EXxEVexS }, 0 },
},
- /* EVEX_W_0F62_P_2 */
+ /* EVEX_W_0F62 */
{
- { "vpunpckldq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0F62) },
},
/* EVEX_W_0F66_P_2 */
{
{ "vpcmpgtd", { XMask, Vex, EXx }, 0 },
},
- /* EVEX_W_0F6A_P_2 */
+ /* EVEX_W_0F6A */
{
- { "vpunpckhdq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0F6A) },
},
- /* EVEX_W_0F6B_P_2 */
+ /* EVEX_W_0F6B */
{
- { "vpackssdw", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0F6B) },
},
- /* EVEX_W_0F6C_P_2 */
+ /* EVEX_W_0F6C */
{
{ Bad_Opcode },
- { "vpunpcklqdq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0F6C) },
},
- /* EVEX_W_0F6D_P_2 */
+ /* EVEX_W_0F6D */
{
{ Bad_Opcode },
- { "vpunpckhqdq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0F6D) },
},
/* EVEX_W_0F6F_P_1 */
{
@@ -277,19 +277,19 @@
{ Bad_Opcode },
{ "vcmpsd", { XMask, VexScalar, EXxmm_mq, EXxEVexS, VCMP }, 0 },
},
- /* EVEX_W_0FD2_P_2 */
+ /* EVEX_W_0FD2 */
{
- { "vpsrld", { XM, Vex, EXxmm }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FD2) },
},
- /* EVEX_W_0FD3_P_2 */
+ /* EVEX_W_0FD3 */
{
{ Bad_Opcode },
- { "vpsrlq", { XM, Vex, EXxmm }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FD3) },
},
- /* EVEX_W_0FD4_P_2 */
+ /* EVEX_W_0FD4 */
{
{ Bad_Opcode },
- { "vpaddq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FD4) },
},
/* EVEX_W_0FD6_P_2 */
{
@@ -315,32 +315,32 @@
{
{ "vmovntdq", { EXEvexXNoBcst, XM }, 0 },
},
- /* EVEX_W_0FF2_P_2 */
+ /* EVEX_W_0FF2 */
{
- { "vpslld", { XM, Vex, EXxmm }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FF2) },
},
- /* EVEX_W_0FF3_P_2 */
+ /* EVEX_W_0FF3 */
{
{ Bad_Opcode },
- { "vpsllq", { XM, Vex, EXxmm }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FF3) },
},
- /* EVEX_W_0FF4_P_2 */
+ /* EVEX_W_0FF4 */
{
{ Bad_Opcode },
- { "vpmuludq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FF4) },
},
- /* EVEX_W_0FFA_P_2 */
+ /* EVEX_W_0FFA */
{
- { "vpsubd", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FFA) },
},
- /* EVEX_W_0FFB_P_2 */
+ /* EVEX_W_0FFB */
{
{ Bad_Opcode },
- { "vpsubq", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FFB) },
},
- /* EVEX_W_0FFE_P_2 */
+ /* EVEX_W_0FFE */
{
- { "vpaddd", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0FFE) },
},
/* EVEX_W_0F380D_P_2 */
{
@@ -481,9 +481,9 @@
{
{ "vmovntdqa", { XM, EXEvexXNoBcst }, 0 },
},
- /* EVEX_W_0F382B_P_2 */
+ /* EVEX_W_0F382B */
{
- { "vpackusdw", { XM, Vex, EXx }, 0 },
+ { PREFIX_TABLE (PREFIX_VEX_0F382B) },
},
/* EVEX_W_0F3830_P_1 */
{
diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h
index 667d39d..1f6635d 100644
--- a/opcodes/i386-dis-evex.h
+++ b/opcodes/i386-dis-evex.h
@@ -112,7 +112,7 @@ static const struct dis386 evex_table[][256] = {
/* 60 */
{ PREFIX_TABLE (PREFIX_VEX_0F60) },
{ PREFIX_TABLE (PREFIX_VEX_0F61) },
- { PREFIX_TABLE (PREFIX_EVEX_0F62) },
+ { VEX_W_TABLE (EVEX_W_0F62) },
{ PREFIX_TABLE (PREFIX_VEX_0F63) },
{ PREFIX_TABLE (PREFIX_EVEX_0F64) },
{ PREFIX_TABLE (PREFIX_EVEX_0F65) },
@@ -121,10 +121,10 @@ static const struct dis386 evex_table[][256] = {
/* 68 */
{ PREFIX_TABLE (PREFIX_VEX_0F68) },
{ PREFIX_TABLE (PREFIX_VEX_0F69) },
- { PREFIX_TABLE (PREFIX_EVEX_0F6A) },
- { PREFIX_TABLE (PREFIX_EVEX_0F6B) },
- { PREFIX_TABLE (PREFIX_EVEX_0F6C) },
- { PREFIX_TABLE (PREFIX_EVEX_0F6D) },
+ { VEX_W_TABLE (EVEX_W_0F6A) },
+ { VEX_W_TABLE (EVEX_W_0F6B) },
+ { VEX_W_TABLE (EVEX_W_0F6C) },
+ { VEX_W_TABLE (EVEX_W_0F6D) },
{ PREFIX_TABLE (PREFIX_EVEX_0F6E) },
{ PREFIX_TABLE (PREFIX_EVEX_0F6F) },
/* 70 */
@@ -238,9 +238,9 @@ static const struct dis386 evex_table[][256] = {
/* D0 */
{ Bad_Opcode },
{ PREFIX_TABLE (PREFIX_VEX_0FD1) },
- { PREFIX_TABLE (PREFIX_EVEX_0FD2) },
- { PREFIX_TABLE (PREFIX_EVEX_0FD3) },
- { PREFIX_TABLE (PREFIX_EVEX_0FD4) },
+ { VEX_W_TABLE (EVEX_W_0FD2) },
+ { VEX_W_TABLE (EVEX_W_0FD3) },
+ { VEX_W_TABLE (EVEX_W_0FD4) },
{ PREFIX_TABLE (PREFIX_VEX_0FD5) },
{ PREFIX_TABLE (PREFIX_EVEX_0FD6) },
{ Bad_Opcode },
@@ -274,20 +274,20 @@ static const struct dis386 evex_table[][256] = {
/* F0 */
{ Bad_Opcode },
{ PREFIX_TABLE (PREFIX_VEX_0FF1) },
- { PREFIX_TABLE (PREFIX_EVEX_0FF2) },
- { PREFIX_TABLE (PREFIX_EVEX_0FF3) },
- { PREFIX_TABLE (PREFIX_EVEX_0FF4) },
+ { VEX_W_TABLE (EVEX_W_0FF2) },
+ { VEX_W_TABLE (EVEX_W_0FF3) },
+ { VEX_W_TABLE (EVEX_W_0FF4) },
{ PREFIX_TABLE (PREFIX_VEX_0FF5) },
{ PREFIX_TABLE (PREFIX_VEX_0FF6) },
{ Bad_Opcode },
/* F8 */
{ PREFIX_TABLE (PREFIX_VEX_0FF8) },
{ PREFIX_TABLE (PREFIX_VEX_0FF9) },
- { PREFIX_TABLE (PREFIX_EVEX_0FFA) },
- { PREFIX_TABLE (PREFIX_EVEX_0FFB) },
+ { VEX_W_TABLE (EVEX_W_0FFA) },
+ { VEX_W_TABLE (EVEX_W_0FFB) },
{ PREFIX_TABLE (PREFIX_VEX_0FFC) },
{ PREFIX_TABLE (PREFIX_VEX_0FFD) },
- { PREFIX_TABLE (PREFIX_EVEX_0FFE) },
+ { VEX_W_TABLE (EVEX_W_0FFE) },
{ Bad_Opcode },
},
/* EVEX_0F38 */
@@ -341,7 +341,7 @@ static const struct dis386 evex_table[][256] = {
{ PREFIX_TABLE (PREFIX_EVEX_0F3828) },
{ PREFIX_TABLE (PREFIX_EVEX_0F3829) },
{ PREFIX_TABLE (PREFIX_EVEX_0F382A) },
- { PREFIX_TABLE (PREFIX_EVEX_0F382B) },
+ { VEX_W_TABLE (EVEX_W_0F382B) },
{ PREFIX_TABLE (PREFIX_EVEX_0F382C) },
{ PREFIX_TABLE (PREFIX_EVEX_0F382D) },
{ Bad_Opcode },
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 58fa21c..55af1eb 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -1431,14 +1431,9 @@ enum
PREFIX_EVEX_0F5D,
PREFIX_EVEX_0F5E,
PREFIX_EVEX_0F5F,
- PREFIX_EVEX_0F62,
PREFIX_EVEX_0F64,
PREFIX_EVEX_0F65,
PREFIX_EVEX_0F66,
- PREFIX_EVEX_0F6A,
- PREFIX_EVEX_0F6B,
- PREFIX_EVEX_0F6C,
- PREFIX_EVEX_0F6D,
PREFIX_EVEX_0F6E,
PREFIX_EVEX_0F6F,
PREFIX_EVEX_0F70,
@@ -1466,9 +1461,6 @@ enum
PREFIX_EVEX_0FC2,
PREFIX_EVEX_0FC4,
PREFIX_EVEX_0FC5,
- PREFIX_EVEX_0FD2,
- PREFIX_EVEX_0FD3,
- PREFIX_EVEX_0FD4,
PREFIX_EVEX_0FD6,
PREFIX_EVEX_0FDB,
PREFIX_EVEX_0FDF,
@@ -1477,12 +1469,6 @@ enum
PREFIX_EVEX_0FE7,
PREFIX_EVEX_0FEB,
PREFIX_EVEX_0FEF,
- PREFIX_EVEX_0FF2,
- PREFIX_EVEX_0FF3,
- PREFIX_EVEX_0FF4,
- PREFIX_EVEX_0FFA,
- PREFIX_EVEX_0FFB,
- PREFIX_EVEX_0FFE,
PREFIX_EVEX_0F380D,
PREFIX_EVEX_0F3810,
PREFIX_EVEX_0F3811,
@@ -1507,7 +1493,6 @@ enum
PREFIX_EVEX_0F3828,
PREFIX_EVEX_0F3829,
PREFIX_EVEX_0F382A,
- PREFIX_EVEX_0F382B,
PREFIX_EVEX_0F382C,
PREFIX_EVEX_0F382D,
PREFIX_EVEX_0F3830,
@@ -1994,12 +1979,12 @@ enum
EVEX_W_0F5E_P_3,
EVEX_W_0F5F_P_1,
EVEX_W_0F5F_P_3,
- EVEX_W_0F62_P_2,
+ EVEX_W_0F62,
EVEX_W_0F66_P_2,
- EVEX_W_0F6A_P_2,
- EVEX_W_0F6B_P_2,
- EVEX_W_0F6C_P_2,
- EVEX_W_0F6D_P_2,
+ EVEX_W_0F6A,
+ EVEX_W_0F6B,
+ EVEX_W_0F6C,
+ EVEX_W_0F6D,
EVEX_W_0F6F_P_1,
EVEX_W_0F6F_P_2,
EVEX_W_0F6F_P_3,
@@ -2024,20 +2009,20 @@ enum
EVEX_W_0F7F_P_3,
EVEX_W_0FC2_P_1,
EVEX_W_0FC2_P_3,
- EVEX_W_0FD2_P_2,
- EVEX_W_0FD3_P_2,
- EVEX_W_0FD4_P_2,
+ EVEX_W_0FD2,
+ EVEX_W_0FD3,
+ EVEX_W_0FD4,
EVEX_W_0FD6_P_2,
EVEX_W_0FE6_P_1,
EVEX_W_0FE6_P_2,
EVEX_W_0FE6_P_3,
EVEX_W_0FE7_P_2,
- EVEX_W_0FF2_P_2,
- EVEX_W_0FF3_P_2,
- EVEX_W_0FF4_P_2,
- EVEX_W_0FFA_P_2,
- EVEX_W_0FFB_P_2,
- EVEX_W_0FFE_P_2,
+ EVEX_W_0FF2,
+ EVEX_W_0FF3,
+ EVEX_W_0FF4,
+ EVEX_W_0FFA,
+ EVEX_W_0FFB,
+ EVEX_W_0FFE,
EVEX_W_0F380D_P_2,
EVEX_W_0F3810_P_1,
EVEX_W_0F3810_P_2,
@@ -2069,7 +2054,7 @@ enum
EVEX_W_0F3829_P_2,
EVEX_W_0F382A_P_1,
EVEX_W_0F382A_P_2,
- EVEX_W_0F382B_P_2,
+ EVEX_W_0F382B,
EVEX_W_0F3830_P_1,
EVEX_W_0F3831_P_1,
EVEX_W_0F3832_P_1,