[PATCH v2] Support Intel FRED LKGS

Jan Beulich jbeulich@suse.com
Fri May 26 07:00:09 GMT 2023


On 26.05.2023 08:50, Jiang, Haochen wrote:
> 
>>> I just take a look at the whole thing.
>>>
>>> From my perspective, if we are going to use the same pattern like SLDT
>>> and STR. Does that mean for the instruction below:
>>>
>>> lldt %ax
>>>
>>> We will need to add a 66 prefix for gas to make it happen or it will drop
>> to %eax?
>>>
>>> It will change the current assembler behavior. Is my understanding correct?
>>
>> No. The assembler was changed already. The disassembler simply wants to
>> follow suit. IOW the assembler already avoids emitting any unnecessary
>> prefixes. The disassembler, otoh, should correctly represent redundant
>> prefixes (and preferably not as raw ones, e.g. not "data16" but a 16-bit sized
>> register or an insn suffix for AT&T memory operands).
> 
> So for all the registers, is the ideal case that we should not emit suffixes since the
> register will always be 16 bit?

The _part of the register that's used_ is always 16 bits. That doesn't mean
that's what we need to print. See e.g. pextrw/pinsrw. Imo GPRs here (like
elsewhere) should be printed according to the present prefixes: 16-bit when
a data size prefix is present, 32-bit when no size prefix is present, and
64-bit when REX.W is present. (Obviously adjusted when dealing with 16-bit
code.) This then eliminates the need for any insn suffix; that'll be needed
only for suffix-always mode, and specifically not for memory operands (which
are always 16-bit) outside of suffix-always mode. If this isn't what Sv + D
do, then it probably needs adjusting.

Jan

> If we are using D, I suppose we will emit suffixes under the current scenario.
> 

> Haochen
> 
>>
>> Jan



More information about the Binutils mailing list