[PATCH 1/5] x86/Intel: adjust representation of embedded broadcast
Jan Beulich
jbeulich@suse.com
Wed May 4 11:57:29 GMT 2022
MASM doesn't support the {1to<n>} form; DWORD BCST (paralleling
DWORD PTR) and alike are to be used there instead. Make the disassembler
follow this first, before also adjusting the assembler (such that it'll
be easy to see that the assembler change doesn't alter generated code).
For VFPCLASSP{S,D,H} and vector conversions with shrinking element sizes
the original {1to<n>} operand suffix is retained, to disambiguate
output. I have no insight (yet) into how MASM expects those to be
disambiguated.
---
Presenting only the non-testsuite changes inline. See attachment for the
full patch.
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -267,6 +267,7 @@ struct instr_info
#define EVEX_b_used 1
+#define EVEX_len_used 2
/* Flags stored in PREFIXES. */
#define PREFIX_REPZ 1
@@ -10931,14 +10932,14 @@ intel_operand_size (instr_info *ins, int
case x_mode:
case evex_half_bcst_xmmq_mode:
if (ins->vex.w)
- oappend (ins, "QWORD PTR ");
+ oappend (ins, "QWORD BCST ");
else
- oappend (ins, "DWORD PTR ");
+ oappend (ins, "DWORD BCST ");
break;
case xh_mode:
case evex_half_bcst_xmmqh_mode:
case evex_half_bcst_xmmqdh_mode:
- oappend (ins, "WORD PTR ");
+ oappend (ins, "WORD BCST ");
break;
default:
ins->vex.no_broadcast = true;
@@ -11768,7 +11769,8 @@ OP_E_memory (instr_info *ins, int bytemo
if (ins->obufp == ins->op_out[0])
ins->vex.no_broadcast = true;
- if (!ins->vex.no_broadcast)
+ if (!ins->vex.no_broadcast
+ && (!ins->intel_syntax || !(ins->evex_used & EVEX_len_used)))
{
if (bytemode == xh_mode)
{
@@ -12484,6 +12486,7 @@ print_vector_reg (instr_info *ins, unsig
break;
case 512:
names = att_names_ymm;
+ ins->evex_used |= EVEX_len_used;
break;
default:
abort ();
@@ -12512,6 +12515,7 @@ print_vector_reg (instr_info *ins, unsig
&& bytemode != d_mode
&& bytemode != q_mode)
{
+ ins->evex_used |= EVEX_len_used;
switch (ins->vex.length)
{
case 128:
@@ -13237,6 +13241,7 @@ OP_VEX (instr_info *ins, int bytemode, i
{
case x_mode:
names = att_names_xmm;
+ ins->evex_used |= EVEX_len_used;
break;
case dq_mode:
if (ins->rex & REX_W)
@@ -13263,6 +13268,7 @@ OP_VEX (instr_info *ins, int bytemode, i
{
case x_mode:
names = att_names_ymm;
+ ins->evex_used |= EVEX_len_used;
break;
case mask_bd_mode:
case mask_mode:
@@ -13281,6 +13287,7 @@ OP_VEX (instr_info *ins, int bytemode, i
break;
case 512:
names = att_names_zmm;
+ ins->evex_used |= EVEX_len_used;
break;
default:
abort ();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-master-x86-AVX512-broadcast-Intel-dis.patch.bz2
Type: application/octet-stream
Size: 207876 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20220504/45c9b391/attachment-0001.obj>
More information about the Binutils
mailing list