From 4726e9a47938baa67a8e41c704bfdde1f123c01e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 14 Jul 2020 10:29:25 +0200 Subject: x86: extend %BW use to VP{COMPRESS,EXPAND}{B,W} Unlike the earlier ones these also need their operands adjusted. Replace the (mis-described: there's nothing "scalar" here) {b,w}_scalar_mode by a single new mode, with the actual unit width controlled by EVEX.W. --- opcodes/ChangeLog | 13 +++++++++++++ opcodes/i386-dis-evex-prefix.h | 4 ++-- opcodes/i386-dis-evex-w.h | 10 ---------- opcodes/i386-dis.c | 19 +++++++------------ 4 files changed, 22 insertions(+), 24 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index cfce6b7..f0b4d8c 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,18 @@ 2020-07-14 Jan Beulich + * i386-dis.c (EVEX_W_0F3862_P_2, EVEX_W_0F3863_P_2): Delete. + (EXbScalar, EXwScalar): Fold to ... + (EXbwUnit): ... this. + (b_scalar_mode, w_scalar_mode): Fold to ... + (bw_unit_mode): ... this. + (intel_operand_size, OP_E_memory): Replace b_scalar_mode / + w_scalar_mode handling by bw_unit_mode one. + * i386-dis-evex-w.h: Move entries for opcodes 0F3862 and 0F3863 + ... + * i386-dis-evex-prefix.h: ... here. + +2020-07-14 Jan Beulich + * i386-dis.c (PCMPESTR_Fixup): Delete. (dis386): Adjust "LQ" description. (prefix_table): Make %LQ apply to AT&T case only for cvtsi2ss, diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h index 1929f24..04c9381 100644 --- a/opcodes/i386-dis-evex-prefix.h +++ b/opcodes/i386-dis-evex-prefix.h @@ -723,13 +723,13 @@ { { Bad_Opcode }, { Bad_Opcode }, - { VEX_W_TABLE (EVEX_W_0F3862_P_2) }, + { "vpexpand%BW", { XM, EXbwUnit }, 0 }, }, /* PREFIX_EVEX_0F3863 */ { { Bad_Opcode }, { Bad_Opcode }, - { VEX_W_TABLE (EVEX_W_0F3863_P_2) }, + { "vpcompress%BW", { EXbwUnit, XM }, 0 }, }, /* PREFIX_EVEX_0F3864 */ { diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h index 2d92290..695cf81 100644 --- a/opcodes/i386-dis-evex-w.h +++ b/opcodes/i386-dis-evex-w.h @@ -522,16 +522,6 @@ { MOD_TABLE (MOD_EVEX_0F385B_P_2_W_0) }, { MOD_TABLE (MOD_EVEX_0F385B_P_2_W_1) }, }, - /* EVEX_W_0F3862_P_2 */ - { - { "vpexpandb", { XM, EXbScalar }, 0 }, - { "vpexpandw", { XM, EXwScalar }, 0 }, - }, - /* EVEX_W_0F3863_P_2 */ - { - { "vpcompressb", { EXbScalar, XM }, 0 }, - { "vpcompressw", { EXwScalar, XM }, 0 }, - }, /* EVEX_W_0F3870_P_2 */ { { Bad_Opcode }, diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 5a0282b..b68e737 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -358,9 +358,8 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr) #define EMS { OP_EM, v_swap_mode } #define EMd { OP_EM, d_mode } #define EMx { OP_EM, x_mode } -#define EXbScalar { OP_EX, b_scalar_mode } +#define EXbwUnit { OP_EX, bw_unit_mode } #define EXw { OP_EX, w_mode } -#define EXwScalar { OP_EX, w_scalar_mode } #define EXd { OP_EX, d_mode } #define EXdS { OP_EX, d_swap_mode } #define EXq { OP_EX, q_mode } @@ -488,6 +487,8 @@ enum x_mode, /* Similar to x_mode, but with different EVEX mem shifts. */ evex_x_gscat_mode, + /* Similar to x_mode, but with yet different EVEX mem shifts. */ + bw_unit_mode, /* Similar to x_mode, but with disabled broadcast. */ evex_x_nobcst_mode, /* Similar to x_mode, but with operands swapped and disabled broadcast @@ -579,10 +580,6 @@ enum /* scalar, ignore vector length. */ scalar_mode, - /* like b_mode, ignore vector length. */ - b_scalar_mode, - /* like w_mode, ignore vector length. */ - w_scalar_mode, /* like d_swap_mode, ignore vector length. */ d_scalar_swap_mode, /* like q_swap_mode, ignore vector length. */ @@ -2183,8 +2180,6 @@ enum EVEX_W_0F3859_P_2, EVEX_W_0F385A_P_2, EVEX_W_0F385B_P_2, - EVEX_W_0F3862_P_2, - EVEX_W_0F3863_P_2, EVEX_W_0F3870_P_2, EVEX_W_0F3872_P_1, EVEX_W_0F3872_P_2, @@ -14109,8 +14104,7 @@ intel_operand_size (int bytemode, int sizeflag) case x_swap_mode: case evex_x_gscat_mode: case evex_x_nobcst_mode: - case b_scalar_mode: - case w_scalar_mode: + case bw_unit_mode: if (need_vex) { switch (vex.length) @@ -14592,11 +14586,12 @@ OP_E_memory (int bytemode, int sizeflag) case d_scalar_swap_mode: shift = 2; break; - case w_scalar_mode: + case bw_unit_mode: + shift = vex.w ? 1 : 0; + break; case xmm_mw_mode: shift = 1; break; - case b_scalar_mode: case xmm_mb_mode: shift = 0; break; -- cgit v1.1