From 36cc073ef40f2cb9cb834cdb5d543fbb284f2b32 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 1 Jul 2019 08:23:41 +0200 Subject: [PATCH] x86: remove ModRM.mod decoding layer from AVX512F VMOVS{S,D} Just like their AVX counterparts they can utilize XMVexScalar / EXdVexScalarS / EXqVexScalarS taking care of dropping the middle operand for their memory forms. --- opcodes/ChangeLog | 19 +++++++++++++++++++ opcodes/i386-dis-evex-mod.h | 20 -------------------- opcodes/i386-dis-evex-prefix.h | 8 ++++---- opcodes/i386-dis-evex-w.h | 34 ++++++++-------------------------- opcodes/i386-dis.c | 17 ++++------------- 5 files changed, 35 insertions(+), 63 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 965f7a7bcb5..82172eb2562 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,22 @@ +2019-07-01 Jan Beulich + + * i386-dis.c (EXdScalarS, MOD_EVEX_0F10_PREFIX_1, + MOD_EVEX_0F10_PREFIX_3, MOD_EVEX_0F11_PREFIX_1, + MOD_EVEX_0F11_PREFIX_3, EVEX_W_0F10_P_1_M_0, + EVEX_W_0F10_P_1_M_1, EVEX_W_0F10_P_3_M_0, EVEX_W_0F10_P_3_M_1, + EVEX_W_0F11_P_1_M_0, EVEX_W_0F11_P_1_M_1, EVEX_W_0F11_P_3_M_0, + EVEX_W_0F11_P_3_M_1): Delete. + (EVEX_W_0F10_P_1, EVEX_W_0F10_P_3, EVEX_W_0F11_P_1, + EVEX_W_0F11_P_3): New. + * i386-dis-evex-mod.h: Remove MOD_EVEX_0F10_PREFIX_1, + MOD_EVEX_0F10_PREFIX_3, MOD_EVEX_0F11_PREFIX_1, and + MOD_EVEX_0F11_PREFIX_3 table entries. + * i386-dis-evex-prefix.h: Adjust PREFIX_EVEX_0F10 and + PREFIX_EVEX_0F11 table entries. + * i386-dis-evex-w.h: Replace EVEX_W_0F10_P_1_M_{0,1}, + EVEX_W_0F10_P_3_M_{0,1}, EVEX_W_0F11_P_1_M_{0,1}, and + EVEX_W_0F11_P_3_M_{0,1} table entries. + 2019-07-01 Jan Beulich * i386-dis.c (EXdVex, EXdVexS, EXqVex, EXqVexS, XMVex): diff --git a/opcodes/i386-dis-evex-mod.h b/opcodes/i386-dis-evex-mod.h index 2ae35c3a8f5..37db98abf14 100644 --- a/opcodes/i386-dis-evex-mod.h +++ b/opcodes/i386-dis-evex-mod.h @@ -1,23 +1,3 @@ - { - /* MOD_EVEX_0F10_PREFIX_1 */ - { VEX_W_TABLE (EVEX_W_0F10_P_1_M_0) }, - { VEX_W_TABLE (EVEX_W_0F10_P_1_M_1) }, - }, - { - /* MOD_EVEX_0F10_PREFIX_3 */ - { VEX_W_TABLE (EVEX_W_0F10_P_3_M_0) }, - { VEX_W_TABLE (EVEX_W_0F10_P_3_M_1) }, - }, - { - /* MOD_EVEX_0F11_PREFIX_1 */ - { VEX_W_TABLE (EVEX_W_0F11_P_1_M_0) }, - { VEX_W_TABLE (EVEX_W_0F11_P_1_M_1) }, - }, - { - /* MOD_EVEX_0F11_PREFIX_3 */ - { VEX_W_TABLE (EVEX_W_0F11_P_3_M_0) }, - { VEX_W_TABLE (EVEX_W_0F11_P_3_M_1) }, - }, { /* MOD_EVEX_0F12_PREFIX_0 */ { VEX_W_TABLE (EVEX_W_0F12_P_0_M_0) }, diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h index 248d7a299b9..1f296c1b0df 100644 --- a/opcodes/i386-dis-evex-prefix.h +++ b/opcodes/i386-dis-evex-prefix.h @@ -1,16 +1,16 @@ /* PREFIX_EVEX_0F10 */ { { VEX_W_TABLE (EVEX_W_0F10_P_0) }, - { MOD_TABLE (MOD_EVEX_0F10_PREFIX_1) }, + { VEX_W_TABLE (EVEX_W_0F10_P_1) }, { VEX_W_TABLE (EVEX_W_0F10_P_2) }, - { MOD_TABLE (MOD_EVEX_0F10_PREFIX_3) }, + { VEX_W_TABLE (EVEX_W_0F10_P_3) }, }, /* PREFIX_EVEX_0F11 */ { { VEX_W_TABLE (EVEX_W_0F11_P_0) }, - { MOD_TABLE (MOD_EVEX_0F11_PREFIX_1) }, + { VEX_W_TABLE (EVEX_W_0F11_P_1) }, { VEX_W_TABLE (EVEX_W_0F11_P_2) }, - { MOD_TABLE (MOD_EVEX_0F11_PREFIX_3) }, + { VEX_W_TABLE (EVEX_W_0F11_P_3) }, }, /* PREFIX_EVEX_0F12 */ { diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h index 44e4b483e05..5aa2a634e95 100644 --- a/opcodes/i386-dis-evex-w.h +++ b/opcodes/i386-dis-evex-w.h @@ -2,55 +2,37 @@ { { "vmovups", { XM, EXEvexXNoBcst }, 0 }, }, - /* EVEX_W_0F10_P_1_M_0 */ + /* EVEX_W_0F10_P_1 */ { - { "vmovss", { XMScalar, EXdScalar }, 0 }, - }, - /* EVEX_W_0F10_P_1_M_1 */ - { - { "vmovss", { XMScalar, VexScalar, EXxmm_md }, 0 }, + { "vmovss", { XMVexScalar, VexScalar, EXdScalar }, 0 }, }, /* EVEX_W_0F10_P_2 */ { { Bad_Opcode }, { "vmovupd", { XM, EXEvexXNoBcst }, 0 }, }, - /* EVEX_W_0F10_P_3_M_0 */ - { - { Bad_Opcode }, - { "vmovsd", { XMScalar, EXqScalar }, 0 }, - }, - /* EVEX_W_0F10_P_3_M_1 */ + /* EVEX_W_0F10_P_3 */ { { Bad_Opcode }, - { "vmovsd", { XMScalar, VexScalar, EXxmm_mq }, 0 }, + { "vmovsd", { XMVexScalar, VexScalar, EXqScalar }, 0 }, }, /* EVEX_W_0F11_P_0 */ { { "vmovups", { EXxS, XM }, 0 }, }, - /* EVEX_W_0F11_P_1_M_0 */ + /* EVEX_W_0F11_P_1 */ { - { "vmovss", { EXdScalarS, XMScalar }, 0 }, - }, - /* EVEX_W_0F11_P_1_M_1 */ - { - { "vmovss", { EXxS, Vex, XMScalar }, 0 }, + { "vmovss", { EXdVexScalarS, VexScalar, XMScalar }, 0 }, }, /* EVEX_W_0F11_P_2 */ { { Bad_Opcode }, { "vmovupd", { EXxS, XM }, 0 }, }, - /* EVEX_W_0F11_P_3_M_0 */ - { - { Bad_Opcode }, - { "vmovsd", { EXqScalarS, XMScalar }, 0 }, - }, - /* EVEX_W_0F11_P_3_M_1 */ + /* EVEX_W_0F11_P_3 */ { { Bad_Opcode }, - { "vmovsd", { EXxS, Vex, XMScalar }, 0 }, + { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar }, 0 }, }, /* EVEX_W_0F12_P_0_M_0 */ { diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 5b47b4c7bcc..dc814209256 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -385,7 +385,6 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr) #define EXd { OP_EX, d_mode } #define EXdScalar { OP_EX, d_scalar_mode } #define EXdS { OP_EX, d_swap_mode } -#define EXdScalarS { OP_EX, d_scalar_swap_mode } #define EXq { OP_EX, q_mode } #define EXqScalar { OP_EX, q_scalar_mode } #define EXqScalarS { OP_EX, q_scalar_swap_mode } @@ -932,10 +931,6 @@ enum MOD_VEX_W_0_0F3A33_P_2_LEN_0, MOD_VEX_W_1_0F3A33_P_2_LEN_0, - MOD_EVEX_0F10_PREFIX_1, - MOD_EVEX_0F10_PREFIX_3, - MOD_EVEX_0F11_PREFIX_1, - MOD_EVEX_0F11_PREFIX_3, MOD_EVEX_0F12_PREFIX_0, MOD_EVEX_0F16_PREFIX_0, MOD_EVEX_0F38C6_REG_1, @@ -2042,17 +2037,13 @@ enum VEX_W_0F3ACF_P_2, EVEX_W_0F10_P_0, - EVEX_W_0F10_P_1_M_0, - EVEX_W_0F10_P_1_M_1, + EVEX_W_0F10_P_1, EVEX_W_0F10_P_2, - EVEX_W_0F10_P_3_M_0, - EVEX_W_0F10_P_3_M_1, + EVEX_W_0F10_P_3, EVEX_W_0F11_P_0, - EVEX_W_0F11_P_1_M_0, - EVEX_W_0F11_P_1_M_1, + EVEX_W_0F11_P_1, EVEX_W_0F11_P_2, - EVEX_W_0F11_P_3_M_0, - EVEX_W_0F11_P_3_M_1, + EVEX_W_0F11_P_3, EVEX_W_0F12_P_0_M_0, EVEX_W_0F12_P_0_M_1, EVEX_W_0F12_P_1, -- 2.30.2