[libc-commits] [libc] [libc] Add support for string/memory_utils functions for AArch64 without HW FP/SIMD (PR #137592)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Mon Apr 28 02:52:24 PDT 2025


gchatelet wrote:

I meant something along those lines
```c++
#ifdef __ARM_NEON
[[maybe_unused]] bool inline_bcmp_aarch64_with_fp(...) { ... }
#endif

[[maybe_unused]] bool inline_bcmp_aarch64_no_fp(...) { ... }

[[gnu::flatten]] bool inline_bcmp_aarch64_dispatch(...) {
#ifdef __ARM_NEON
    return inline_bcmp_aarch64_with_fp(...);
#else
    return inline_bcmp_aarch64_no_fp(...);
#endif
}
```

Then in [libc/src/string/memory_utils/inline_bcmp.h](https://github.com/llvm/llvm-project/blob/main/libc/src/string/memory_utils/inline_bcmp.h) we need to change `inline_bcmp_aarch64` into `inline_bcmp_aarch64_dispatch`. This conveys the fact that there are several implementations for `aarch64`.

Sorry for what looks like nitpicking but I'm currently working on memory function implementations for armv6/v7 and this approach seems to scale.

---

Also, now that I think it through, I'm a bit puzzled. aarch64 is supposed to be armv8/v9 and AFAIU armv8 has to have Advanced [SIMD](https://en.wikipedia.org/wiki/Single_instruction,_multiple_data) (Neon). What is the exact CPU you're targeting? Isn't it more of an issue about 32/64 bit support rather than neon/non-neon?

https://github.com/llvm/llvm-project/pull/137592


More information about the libc-commits mailing list