[PATCH] x86-64: Support APX NF TLS IE with 2 operands

Jan Beulich jbeulich@suse.com
Wed Jul 3 10:42:28 GMT 2024


On 03.07.2024 12:20, H.J. Lu wrote:
> On Wed, Jul 3, 2024, 6:11 PM Jan Beulich <jbeulich@suse.com> wrote:
> 
>> On 03.07.2024 11:43, H.J. Lu wrote:
>>> On Wed, Jul 3, 2024, 5:23 PM Jan Beulich <jbeulich@suse.com> wrote:
>>>
>>>> On 03.07.2024 09:49, H.J. Lu wrote:
>>>>> Have I missed something? I haven't seen any testcases.
>>>>
>>>> From my description you could have made one yourself, if you really
>> didn't
>>>> believe what I was saying. Here you go:
>>>>
>>>>         .text
>>>> gottpoff:
>>>>         .irp op, add, sub
>>>>         \op     foo@gottpoff(%rip), %rax
>>>>         \op     foo@gottpoff(%rip), %r16
>>>>         \op     foo@gottpoff(%rip), %rax, %rcx
>>>>         \op     %rax, foo@gottpoff(%rip), %rcx
>>>>         {nf} \op foo@gottpoff(%rip), %rax
>>>>         .endr
>>>>
>>>>         popcnt  foo@gottpoff(%rip), %rax
>>>>         popcnt  foo@gottpoff(%rip), %r16
>>>>         {nf} popcnt foo@gottpoff(%rip), %rax
>>>>
>>>>         adox    foo@gottpoff(%rip), %rax
>>>>         adox    foo@gottpoff(%rip), %r16
>>>
>>> What are the issues?
>>
>> Can you just explain the resulting behavior please, as to where errors are
>> raised and where insns assemble without any diagnostic? Did you even try
>> to hand this to the assembler? Because if you did, didn't it occur to you
>> that the set of diagnostics you got is completely arbitrary?
>>
> 
> foo@gottpoff(%rip) was added for TLS IE with ADD and MOV.  Any other usages
> are undefined.

Yet gas behaves inconsistently in this regard. It accepts (taking just the
example above) SUB, POPCNT, and ADOX, just as long as they're legacy
encoded.

> If clarifications are needed, please raise the issue at x86-64 psABI group.

I don't think clarification is needed there. We simply need to get gas into
a mode where it behaves consistently. That could be consistently more lax
or consistently more strict. I'm tending towards the former, as indicated.

Jan


More information about the Binutils mailing list