crc32 feature detection from auxiliary vectors on FreeBSD

This commit is contained in:
David Carlier 2021-06-04 19:29:27 +01:00 committed by Nikita Popov
parent e11468a79b
commit 67b0e435f3

View file

@ -26,6 +26,15 @@
# include <asm/hwcap.h>
# elif defined(__APPLE__)
# include <sys/sysctl.h>
# elif defined(__FreeBSD__)
# include <sys/auxv.h>
static unsigned long getauxval(unsigned long key) {
unsigned long ret = 0;
if (elf_aux_info(key, &ret, sizeof(ret)) != 0)
return 0;
return ret;
}
# endif
static inline int has_crc32_insn() {