x86: add disassembler support for XOP VPCOM* pseudo-ops

Matching up with the assembler, which already supports them.
This commit is contained in:
Jan Beulich 2017-11-14 08:43:26 +01:00 committed by Jan Beulich
parent 2645e1d079
commit be92cb147d
6 changed files with 1266 additions and 1202 deletions

View File

@ -1,3 +1,8 @@
2017-11-14 Jan Beulich <jbeulich@suse.com>
* testsuite/gas/i386/x86-64-xop.d, testsuite/gas/i386/xop.d,
testsuite/gas/i386/xop32reg.d: Adjust expectations.
2017-11-14 Jan Beulich <jbeulich@suse.com>
* testsuite/gas/i386/avx512bw.s: Add vpcmp* pseudo tests.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,6 @@ Disassembly of section \.text:
0+ <_start>:
[ ]*[a-f0-9]+: 8f e9 78 e1 4d c2[ ]+vphsubbw -0x3e\(%ebp\),%xmm1
[ ]*[a-f0-9]+: 8f c9 78 e1 4d c2[ ]+vphsubbw -0x3e\(%ebp\),%xmm1
[ ]*[a-f0-9]+: 8f e8 40 cd 04 08 07[ ]+vpcomw \$0x7,\(%eax,%ecx,1\),%xmm7,%xmm0
[ ]*[a-f0-9]+: 8f c8 40 cd 04 08 07[ ]+vpcomw \$0x7,\(%eax,%ecx,1\),%xmm7,%xmm0
[ ]*[a-f0-9]+: 8f e8 40 cd 04 08 07[ ]+vpcomtruew \(%eax,%ecx,1\),%xmm7,%xmm0
[ ]*[a-f0-9]+: 8f c8 40 cd 04 08 07[ ]+vpcomtruew \(%eax,%ecx,1\),%xmm7,%xmm0
#pass

View File

@ -1,3 +1,8 @@
2017-11-14 Jan Beulich <jbeulich@suse.com>
* i386-dis.c (VPCOM_Fixup, VPCOM, xop_cmp_op): New.
(vex_len_table): Use VPCOM.
2017-11-14 Jan Beulich <jbeulich@suse.com>
* i386-dis-evex.h (evex_table[EVEX_W_0F3A3E_P_2]): Use VPCMP.

View File

@ -99,6 +99,7 @@ static void VEXI4_Fixup (int, int);
static void VZERO_Fixup (int, int);
static void VCMP_Fixup (int, int);
static void VPCMP_Fixup (int, int);
static void VPCOM_Fixup (int, int);
static void OP_0f07 (int, int);
static void OP_Monitor (int, int);
static void OP_Mwait (int, int);
@ -441,6 +442,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
#define VZERO { VZERO_Fixup, 0 }
#define VCMP { VCMP_Fixup, 0 }
#define VPCMP { VPCMP_Fixup, 0 }
#define VPCOM { VPCOM_Fixup, 0 }
#define EXxEVexR { OP_Rounding, evex_rounding_mode }
#define EXxEVexS { OP_Rounding, evex_sae_mode }
@ -10192,42 +10194,42 @@ static const struct dis386 vex_len_table[][2] = {
/* VEX_LEN_0FXOP_08_CC */
{
{ "vpcomb", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomb", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_CD */
{
{ "vpcomw", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomw", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_CE */
{
{ "vpcomd", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomd", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_CF */
{
{ "vpcomq", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomq", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_EC */
{
{ "vpcomub", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomub", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_ED */
{
{ "vpcomuw", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomuw", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_EE */
{
{ "vpcomud", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomud", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_08_EF */
{
{ "vpcomuq", { XM, Vex128, EXx, Ib }, 0 },
{ "vpcomuq", { XM, Vex128, EXx, VPCOM }, 0 },
},
/* VEX_LEN_0FXOP_09_80 */
@ -17621,6 +17623,58 @@ VPCMP_Fixup (int bytemode ATTRIBUTE_UNUSED,
}
}
static const struct op xop_cmp_op[] =
{
{ STRING_COMMA_LEN ("lt") },
{ STRING_COMMA_LEN ("le") },
{ STRING_COMMA_LEN ("gt") },
{ STRING_COMMA_LEN ("ge") },
{ STRING_COMMA_LEN ("eq") },
{ STRING_COMMA_LEN ("neq") },
{ STRING_COMMA_LEN ("false") },
{ STRING_COMMA_LEN ("true") }
};
static void
VPCOM_Fixup (int bytemode ATTRIBUTE_UNUSED,
int sizeflag ATTRIBUTE_UNUSED)
{
unsigned int cmp_type;
FETCH_DATA (the_info, codep + 1);
cmp_type = *codep++ & 0xff;
if (cmp_type < ARRAY_SIZE (xop_cmp_op))
{
char suffix[3];
char *p = mnemonicendp - 2;
/* vpcom* can have both one- and two-lettered suffix. */
if (p[0] == 'm')
{
p++;
suffix[0] = p[0];
suffix[1] = '\0';
}
else
{
suffix[0] = p[0];
suffix[1] = p[1];
suffix[2] = '\0';
}
sprintf (p, "%s%s", xop_cmp_op[cmp_type].name, suffix);
mnemonicendp += xop_cmp_op[cmp_type].len;
}
else
{
/* We have a reserved extension byte. Output it directly. */
scratchbuf[0] = '$';
print_operand_value (scratchbuf + 1, 1, cmp_type);
oappend_maybe_intel (scratchbuf);
scratchbuf[0] = '\0';
}
}
static const struct op pclmul_op[] =
{
{ STRING_COMMA_LEN ("lql") },