[PATCH v3 8/9] Support APX NDD optimized encoding.
Jan Beulich
jbeulich@suse.com
Tue Dec 12 08:45:36 GMT 2023
On 12.12.2023 04:18, Hu, Lin1 wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@suse.com>
>> Sent: Monday, December 11, 2023 8:28 PM
>>
>> On 24.11.2023 08:02, Cui, Lili wrote:
>>> --- a/gas/config/tc-i386.c
>>> +++ b/gas/config/tc-i386.c
>>> @@ -7148,6 +7148,58 @@ check_APX_operands (const insn_template *t)
>>> return 0;
>>> }
>>>
>>> +/* Check if the instruction use the REX registers. */ static bool
>>> +check_RexOperands () {
>>> + for (unsigned int op = 0; op < i.operands; op++)
>>> + {
>>> + if (i.types[op].bitfield.class != Reg)
>>> + continue;
>>> +
>>> + if (i.op[op].regs->reg_flags & (RegRex | RegRex64))
>>> + return true;
>>> + }
>>> +
>>> + if ((i.index_reg && (i.index_reg->reg_flags & (RegRex | RegRex64)))
>>> + || (i.base_reg && (i.base_reg->reg_flags & (RegRex | RegRex64))))
>>> + return true;
>>> +
>>> + /* Check pseudo prefix {rex} are valid. */ return i.rex_encoding;
>>
>> Can this actually happen, when we're converting from EVEX to legacy?
>> (Initially I wanted to ask about "rex" and alike prefixes, i.e. the non- pseudo
>> ones.)
>>
>
> This is to align with check_EgprOperands. I hope the function be more general. Not just for this optimization problem.
But then the comment shouldn't say "REX registers", and "Operands" in
its name isn't quite right either.
Also you want to make the function be a proper modern declaration, by
adding "void" between the parentheses.
Jan
More information about the Binutils
mailing list