x86: Determine vector length from the last vector operand
Determine VEX/EVEXE vector length from the last multi-length vector operand. * config/tc-i386.c (build_vex_prefix): Determine vector length from the last multi-length vector operand. (build_evex_prefix): Likewise.
This commit is contained in:
parent
17cbafdbbe
commit
c7213af9b3
|
@ -1,3 +1,9 @@
|
|||
2018-07-22 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/tc-i386.c (build_vex_prefix): Determine vector
|
||||
length from the last multi-length vector operand.
|
||||
(build_evex_prefix): Likewise.
|
||||
|
||||
2018-07-20 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* config/tc-i386.c (match_simd_size): Break long line.
|
||||
|
|
|
@ -3363,10 +3363,12 @@ build_vex_prefix (const insn_template *t)
|
|||
vector_length = 1;
|
||||
else
|
||||
{
|
||||
unsigned int op;
|
||||
int op;
|
||||
|
||||
/* Determine vector length from the last multi-length vector
|
||||
operand. */
|
||||
vector_length = 0;
|
||||
for (op = 0; op < t->operands; ++op)
|
||||
for (op = t->operands - 1; op >= 0; op--)
|
||||
if (t->operand_types[op].bitfield.xmmword
|
||||
&& t->operand_types[op].bitfield.ymmword
|
||||
&& i.types[op].bitfield.ymmword)
|
||||
|
@ -3611,20 +3613,31 @@ build_evex_prefix (void)
|
|||
if (!i.tm.opcode_modifier.evex
|
||||
|| i.tm.opcode_modifier.evex == EVEXDYN)
|
||||
{
|
||||
unsigned int op;
|
||||
int op;
|
||||
|
||||
/* Determine vector length from the last multi-length vector
|
||||
operand. */
|
||||
vec_length = 0;
|
||||
for (op = 0; op < i.tm.operands; ++op)
|
||||
for (op = i.operands - 1; op >= 0; op--)
|
||||
if (i.tm.operand_types[op].bitfield.xmmword
|
||||
+ i.tm.operand_types[op].bitfield.ymmword
|
||||
+ i.tm.operand_types[op].bitfield.zmmword > 1)
|
||||
{
|
||||
if (i.types[op].bitfield.zmmword)
|
||||
{
|
||||
i.tm.opcode_modifier.evex = EVEX512;
|
||||
break;
|
||||
}
|
||||
else if (i.types[op].bitfield.ymmword)
|
||||
{
|
||||
i.tm.opcode_modifier.evex = EVEX256;
|
||||
break;
|
||||
}
|
||||
else if (i.types[op].bitfield.xmmword)
|
||||
{
|
||||
i.tm.opcode_modifier.evex = EVEX128;
|
||||
break;
|
||||
}
|
||||
else if (i.broadcast && (int) op == i.broadcast->operand)
|
||||
{
|
||||
switch ((i.tm.operand_types[op].bitfield.dword ? 4 : 8)
|
||||
|
@ -3640,14 +3653,16 @@ build_evex_prefix (void)
|
|||
i.tm.opcode_modifier.evex = EVEX128;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (op < 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
switch (i.tm.opcode_modifier.evex)
|
||||
{
|
||||
case EVEXLIG: /* LL' is ignored */
|
||||
|
|
Loading…
Reference in New Issue