[PATCH] x86: Add {load}/{store} tests for apx instructions.

Jan Beulich jbeulich@suse.com
Tue Jul 2 11:55:02 GMT 2024


On 02.07.2024 10:22, Jan Beulich wrote:
> On 02.07.2024 09:09, Cui, Lili wrote:
>>> On 01.07.2024 15:42, Cui, Lili wrote:
>>>> I met some issues when adding CTESTcc and CCMPcc.
>>>>
>>>> For example, the disassembler for "{load} ccmpbl %edx, %eax" now looks a bit
>>> weird.
>>>>
>>>> "ccmpbl {dfv=}.s %edx,%eax"
>>>
>>> Well ... Something clearly needs doing about this. I'm now even more convinced
>>> we want tests for these.
>>>
>> Indeed, I added a macro %SW to indicate operands were swapped when suffix_always is true.  Are you ok with it?
> 
> In principle (and if then used consistently), why not. However, as long
> as you use it only for ...
> 
>> --- a/opcodes/i386-dis-evex.h
>> +++ b/opcodes/i386-dis-evex.h
>> @@ -940,8 +940,8 @@ static const struct dis386 evex_table[][256] = {
>>      /* 38 */
>>      { "%NEccmp%SCB%DF",                { Eb, Gb }, 0 },
>>      { "%NEccmp%SCS%DF",                { Ev, Gv }, PREFIX_NP_OR_DATA },
>> -    { "%NEccmp%SCB%DF",                { Gb, EbS }, 0 },
>> -    { "%NEccmp%SCS%DF",                { Gv, EvS }, PREFIX_NP_OR_DATA },
>> +    { "%NEccmp%SCB%SW%DF",     { Gb, Eb }, 0 },
>> +    { "%NEccmp%SCS%SW%DF",     { Gv, Ev }, PREFIX_NP_OR_DATA },
> 
> ... CCMPcc / CTESTcc, couldn't you make %DF fulfill this job as well?

I'm sorry, this was half rubbish, I'm afraid. TEST (and hence CTESTcc) has
only a single encoding, and hence would never get .s suffixes. So if there's
no better way, a new %SW macro (just for CCMPcc as you have it above) it is
then. An alternative might be to convert %DF to a DFV_Fixup() handler (to
defer that output enough so that normal .s printing would come first), yet
that may be more overhead than what we have right now for the {dfv=...}
printing.

Jan


More information about the Binutils mailing list