[PATCH v6 1/3] aarch64: define macro for calling __libc_arm_za_disable

Yury Khrustalev yury.khrustalev@arm.com
Wed Oct 8 08:55:40 GMT 2025


On Tue, Oct 07, 2025 at 10:16:55AM -0300, Adhemerval Zanella Netto wrote:
> > ...
> > +/* Clear ZA state of SME (ASM version).  */
> > +/* The __libc_arm_za_disable function has special calling convention
> > +   that allows to call it without stack manipulation and preserving
> > +   most of the registers.  */
> > +# define CALL_LIBC_ARM_ZA_DISABLE		\
> > +    mov			x13, x30;		\
> > +    .cfi_register	x30, x13;		\
> > +    bl			__libc_arm_za_disable;	\
> > +    mov			x30, x13;		\
> > +    .cfi_register	x13, x30;
> > +
> >  #else /* not __ASSEMBLER__ */
> 
> I think it would be better to be a proper gas macro instead of a C
> macro, even if the sequence does not use internal labels or control
> flow:
> 
>         .macro CALL_LIBC_ARM_ZA_DISABLE
>         mov             x13, x30
>         .cfi_register   x30, x13
>         bl              __libc_arm_za_disable
>         mov             x30, x13
>         .cfi_register   x13, x30
>         .endm
> 
> It is a slight clear syntax, do not pollute the global namespace, and
> have better error messages.

I think it's a very good suggestion, thanks, I'll do that.

Yury



More information about the Libc-alpha mailing list