On 23/02/2026 4:21 pm, Jan Beulich wrote:
> On 23.02.2026 17:06, Andrew Cooper wrote:
>> On 23/02/2026 4:02 pm, Jan Beulich wrote:
>>> On 23.02.2026 11:04, Edwin Török wrote:
>>>> clang-21's built-in assembler is enabled by default, but it doesn't
>>>> support some mnemonics:
>>>> ```
>>>> test_x86_emulator.c:2636:36: error: invalid instruction mnemonic 'fsaves'
>>>>  2636 |                        "fidivs %1\n\t"
>>>> test_x86_emulator.c:2640:24: error: invalid instruction mnemonic 'frstors'
>>>>  2640 |         asm volatile ( "frstors %0" :: "m" (res[25]) : "memory" );
>>>>       |                        ^
>>>> test_x86_emulator.c:4251:24: error: invalid instruction mnemonic 
>>>> 'vpcmpestriq'
>>>>  4251 |                        put_insn(vpcmpestri,
>>>>       |                        ^
>>>> ```
>>> Was this reported to them as a bug (or perhaps even two)?
>> Looking at just one of these, the mnemonic is FRSTOR without an S, and
>> Clang 21 is happy with that.
>>
>> What is the trailing S supposed to signify to GAS?
> "short", i.e. the want for a 16-bit operand size prefix.

But that is normally spelled 'w', not 's' in AT&T syntax.

Not that it matters; Clang doesn't like 'w' either.

>  Just like in
> vpcmpestriq the request is for a REX64 prefix. Suffixes are the way to
> go in AT&T syntax when operands alone can't disambiguate operand size.
> The less nice alternative are data16 prefixes; not sure if Clang would
> support those.

data16 seems to be tolerated.

https://godbolt.org/z/MWGjnfWs7

Interestingly Clang automatically inserts a WAIT, although that's a side
effect of the FSAVE it turns into FNSAVE.  

Compiling to a full binary removes the WAIT and reinstates FSAVE, which
I suspect means it's switching back to no-IAS/binutils behind the scenes.

~Andrew

Reply via email to