calamity-inc / Soup

The everything library for C++ 17 and beyond with bindings for other languages.
MIT License
11 stars 3 forks source link

Leverage CRC32 instrinsics on ARM #112

Closed Sainan closed 5 months ago

Sainan commented 5 months ago

First will need some way to check for processor support. On Windows, we can use IsProcessorFeaturePresent.

On Linux, we can read ID_AA64ISAR0_EL1 if getauxval(AT_HWCAP) & HWCAP_CPUID, although there's little reason to do this, since we can also read the feature flags without ASM here: https://docs.kernel.org/arch/arm64/elf_hwcaps.html

Would be easier if this architecture allowed reading feature bits in userland...