From 066f82b96a4902b9f4f76dfc8d24f8d73ceeef0f Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 10 Mar 2021 08:18:24 +0100 Subject: [PATCH] x86: reuse VEX entries for EVEX vperm{q,pd} By matching VEX decode order (L before W), some EVEX entries can refer back to VEX ones instead of carrying duplicates. --- opcodes/ChangeLog | 10 ++++++++++ opcodes/i386-dis-evex-len.h | 12 ++++++------ opcodes/i386-dis-evex-w.h | 10 ---------- opcodes/i386-dis-evex.h | 4 ++-- opcodes/i386-dis.c | 6 ++---- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 1fbd3775940..c40ca0f87d4 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,13 @@ +2021-03-10 Jan Beulich + + * opcodes/i386-dis.c (EVEX_LEN_0F3A00_W_1, EVEX_LEN_0F3A01_W_1): + Rename to EVEX_LEN_0F3A00 and EVEX_LEN_0F3A01 respectively. + EVEX_W_0F3A00, EVEX_W_0F3A01): Delete. + * i386-dis-evex.h (evex_table): Adjust opcode 0F3A00 and 0F3A01 + entries. + * i386-dis-evex-len.h (evex_len_table): Likewise. + * i386-dis-evex-w.h: Remove opcode 0F3A00 and 0F3A01 entries. + 2021-03-10 Jan Beulich * opcodes/i386-dis.c (REG_EVEX_0F38C6, REG_EVEX_0F38C7, diff --git a/opcodes/i386-dis-evex-len.h b/opcodes/i386-dis-evex-len.h index cef8ad9c2dd..01a8ee568d0 100644 --- a/opcodes/i386-dis-evex-len.h +++ b/opcodes/i386-dis-evex-len.h @@ -92,18 +92,18 @@ static const struct dis386 evex_len_table[][3] = { { VEX_W_TABLE (EVEX_W_0F38C7_M_0_L_2) }, }, - /* EVEX_LEN_0F3A00_W_1 */ + /* EVEX_LEN_0F3A00 */ { { Bad_Opcode }, - { "vpermq", { XM, EXx, Ib }, PREFIX_DATA }, - { "vpermq", { XM, EXx, Ib }, PREFIX_DATA }, + { VEX_W_TABLE (VEX_W_0F3A00_L_1) }, + { VEX_W_TABLE (VEX_W_0F3A00_L_1) }, }, - /* EVEX_LEN_0F3A01_W_1 */ + /* EVEX_LEN_0F3A01 */ { { Bad_Opcode }, - { "vpermpd", { XM, EXx, Ib }, PREFIX_DATA }, - { "vpermpd", { XM, EXx, Ib }, PREFIX_DATA }, + { VEX_W_TABLE (VEX_W_0F3A01_L_1) }, + { VEX_W_TABLE (VEX_W_0F3A01_L_1) }, }, /* EVEX_LEN_0F3A14 */ diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h index e28c8459e5c..0b9c25927bb 100644 --- a/opcodes/i386-dis-evex-w.h +++ b/opcodes/i386-dis-evex-w.h @@ -580,16 +580,6 @@ { REG_TABLE (REG_EVEX_0F38C7_M_0_L_2_W_0) }, { REG_TABLE (REG_EVEX_0F38C7_M_0_L_2_W_1) }, }, - /* EVEX_W_0F3A00 */ - { - { Bad_Opcode }, - { EVEX_LEN_TABLE (EVEX_LEN_0F3A00_W_1) }, - }, - /* EVEX_W_0F3A01 */ - { - { Bad_Opcode }, - { EVEX_LEN_TABLE (EVEX_LEN_0F3A01_W_1) }, - }, /* EVEX_W_0F3A05 */ { { Bad_Opcode }, diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h index 013a338ecbb..27446c43c83 100644 --- a/opcodes/i386-dis-evex.h +++ b/opcodes/i386-dis-evex.h @@ -584,8 +584,8 @@ static const struct dis386 evex_table[][256] = { /* EVEX_0F3A */ { /* 00 */ - { VEX_W_TABLE (EVEX_W_0F3A00) }, - { VEX_W_TABLE (EVEX_W_0F3A01) }, + { EVEX_LEN_TABLE (EVEX_LEN_0F3A00) }, + { EVEX_LEN_TABLE (EVEX_LEN_0F3A01) }, { Bad_Opcode }, { "valign%DQ", { XM, Vex, EXx, Ib }, PREFIX_DATA }, { VEX_W_TABLE (VEX_W_0F3A04) }, diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 25b9c44359a..1a5ea0e62a0 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1349,8 +1349,8 @@ enum EVEX_LEN_0F385B_M_0, EVEX_LEN_0F38C6_M_0, EVEX_LEN_0F38C7_M_0, - EVEX_LEN_0F3A00_W_1, - EVEX_LEN_0F3A01_W_1, + EVEX_LEN_0F3A00, + EVEX_LEN_0F3A01, EVEX_LEN_0F3A14, EVEX_LEN_0F3A15, EVEX_LEN_0F3A16, @@ -1614,8 +1614,6 @@ enum EVEX_W_0F38A3, EVEX_W_0F38C7_M_0_L_2, - EVEX_W_0F3A00, - EVEX_W_0F3A01, EVEX_W_0F3A05, EVEX_W_0F3A08, EVEX_W_0F3A09, -- 2.30.2