aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-03-10 11:07:11 +0100
committerJan Beulich <jbeulich@suse.com>2023-03-10 11:07:11 +0100
commit9b345ce8949ffc997f23c998a18937b359ef50ce (patch)
tree97c45e39a0ddbb182e955d76ca121df96fc65536 /gas
parente959ac942ff3a56df111351b65c5a88b0ac2b5da (diff)
downloadgdb-9b345ce8949ffc997f23c998a18937b359ef50ce.zip
gdb-9b345ce8949ffc997f23c998a18937b359ef50ce.tar.gz
gdb-9b345ce8949ffc997f23c998a18937b359ef50ce.tar.bz2
x86: decouple broadcast type and bytes fields
Keep both representing exclusively what was parsed from input, to avoid the need for (potentially bogus) calculations when processing .insn.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 571fc3a..835fd14 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3743,8 +3743,7 @@ get_broadcast_bytes (const insn_template *t, bool diag)
const i386_operand_type *types;
if (i.broadcast.type)
- return i.broadcast.bytes = ((1 << (t->opcode_modifier.broadcast - 1))
- * i.broadcast.type);
+ return (1 << (t->opcode_modifier.broadcast - 1)) * i.broadcast.type;
gas_assert (intel_syntax);
@@ -3928,7 +3927,8 @@ build_evex_prefix (void)
i.tm.opcode_modifier.evex = EVEX128;
break;
}
- else if (i.broadcast.bytes && op == i.broadcast.operand)
+ else if ((i.broadcast.type || i.broadcast.bytes)
+ && op == i.broadcast.operand)
{
switch (get_broadcast_bytes (&i.tm, true))
{
@@ -3972,7 +3972,7 @@ build_evex_prefix (void)
}
i.vex.bytes[3] |= vec_length;
/* Encode the broadcast bit. */
- if (i.broadcast.bytes)
+ if (i.broadcast.type || i.broadcast.bytes)
i.vex.bytes[3] |= 0x10;
}
else if (i.rounding.type != saeonly)
@@ -4473,6 +4473,7 @@ optimize_encoding (void)
&& !i.types[0].bitfield.zmmword
&& !i.types[1].bitfield.zmmword
&& !i.mask.reg
+ && !i.broadcast.type
&& !i.broadcast.bytes
&& is_evex_encoding (&i.tm)
&& ((i.tm.base_opcode & ~Opcode_SIMD_IntD) == 0x6f
@@ -6559,7 +6560,7 @@ check_VecOperands (const insn_template *t)
if (t->opcode_modifier.disp8memshift
&& i.disp_encoding <= disp_encoding_8bit)
{
- if (i.broadcast.bytes)
+ if (i.broadcast.type || i.broadcast.bytes)
i.memshift = t->opcode_modifier.broadcast - 1;
else if (t->opcode_modifier.disp8memshift != DISP8_SHIFT_VL)
i.memshift = t->opcode_modifier.disp8memshift;