ifunc resolver is loosely based on the equivalent resolver for amd64.
Sponsored by: Arm Ltd
Differential D54560
libc/aarch64: Use MOPS implementations of memcpy/memmove/memset where availble Authored by sarah.walker2_arm.com on Tue, Jan 6, 3:41 PM. Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions I'm not sure if it is a good idea to copy the amd64 design pattern for ARM. We have ARCHLEVEL support there mainly to opt out of using SIMD, but it doesn't seem like that is salient point on AArch64. I would strongly favour a refactor that does target selection just for this one function only, with no ARCHLEVEL framework. You can write the resolve in C in a separate translation unit if needed (though it should be easy to do in assembly). If a framework is desired, it should probably follow ARM architecture levels, so 8.0, 8.1, ..., 9.0, ... instead of individual extensions. Please also document this change in simd(7), you can add a new key (maybe M) to the table to mean “function uses MOPS.”
Comment Actions This doesn't build for me: lib/libc/aarch64/string/memcpy_resolver.c:11:6: error: use of undeclared identifier 'ifunc_arg'
11 | if (ifunc_arg->_hwcap2 & HWCAP2_MOPS)
| ^
1 error generated.
*** Error code 1Comment Actions I think this is because our ifunc framework does not currently support fetching hwcap2 from the second argument and we have not yet decided how we want to support that (I dimly recall having discussed this with @jrtc27 at EuroBSDcon 2024). It might be easiest to grab hwcap2 using elf_aux_info() for now. Comment Actions No objections to this design from my side, though I can't test further on account of not having any HW with MOPS support (donations welcome :-) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||