[PATCH] AArch64: Optimise SVE scalar callbacks
Florian Weimer
fweimer@redhat.com
Mon Sep 22 16:17:53 GMT 2025
* Joe Ramsay:
> Instead of using SVE instructions to marshall special results into the
> correct lane, just write the entire vector (and the predicate) to
> memory, then use cheaper scalar operations.
>
> -fno-stack-protector is added to the CFLAGS for SVE routines, as the
> fallbacks incur a small stack allocation. sv_call_* allocates VL + VL
> / 8 bytes, and sv_call2_* allocates 2 * VL + VL / 8, where VL is the
> SVE vector length in bytes. The maximum VL is 256, so the largest
> possible stack allocation from the new handlers is 544 bytes.
Can you use fixed-size arrays instead? (I assume you currently use
VLAs.) If you are worried about the -fstack-protector-strong impact,
-fstack-clash-protection might be worse for a VLA.
(I expect that most distributions build glibc with -fstack-clash-protection.)
Thanks,
Florian
More information about the Libc-alpha
mailing list