[PATCH] x86: Clean up and improve FPU inline assembly

Uros Bizjak ubizjak@gmail.com
Fri Sep 19 18:44:09 GMT 2025


On Fri, Sep 19, 2025 at 8:35 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Uros Bizjak:
>
> > Clean up and improve x86 FPU inline assembly:
> >
> >   * Remove obsolete "*&" GCC asm memory operand workaround
> >
> >   * Use %v prefix to emit VEX prefixed insns for AVX targets
> >
> >   * Use \t and \n\t separators consistently
> >
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
>
> Reviewed-by: Florian Weimer <fweimer@redhat.com>
>
> I'm not particularly fond of the \t, but I probably won't change any of
> this code, so it doesn't matter to me.

Insn stream looks somewhat nicer in the assembly dumps.

> The %v changes make the VEX prefix more consistent.  I suppose that's
> okay.  But it's puzzling to me my the VEX variant is advantageous, given
> that its encoding is one byte longer.  I wouldn't consider it a SIMD
> instruction, so the VEX vs legacy mixing shouldn't apply?

Actually, it avoids mode switching penalties, especially since the
decoder doesn’t have to switch between legacy and VEX instruction
decode paths.

Uros.


More information about the Libc-alpha mailing list