Hi Richard, > +/* Maximum bytes set for an inline memset expansion. With -Os use 3 STP > + and 1 MOVI/DUP (same size as a call). */ > +#define MAX_SET_SIZE(speed) (speed ? 256 : 96)
> So it looks like this assumes we have AdvSIMD. What about > -mgeneral-regs-only? After my strictalign bugfix (https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635309.html) aarch64_expand_setmem starts with: /* Variable-sized or strict-align memset may use the MOPS expansion. */ if (!CONST_INT_P (operands[1]) || !TARGET_SIMD || (STRICT_ALIGNMENT && align < 16)) return aarch64_expand_setmem_mops (operands); Generating perfect code for every STRICT_ALIGNMENT x TARGET_SIMD x AARCH64_EXTRA_TUNE_NO_LDP_STP_QREGS x speed/size combination would require a huge rewrite - and that's not the goal of this patch. Cheers, Wilco