Commit dc3681e5 authored by pkubaj's avatar pkubaj Committed by Daniel Black

Implement CPU feature checks for FreeBSD/powerpc64

Fixes build on powerpc64 and powerpc64le.

Closes: #1710
parent deadec4e
......@@ -476,6 +476,21 @@ static int arch_ppc_probe(void) {
return arch_ppc_crc32;
}
#elif __FreeBSD_version >= 1200000
#include <machine/cpu.h>
#include <sys/auxv.h>
#include <sys/elf_common.h>
static int arch_ppc_probe(void) {
unsigned long cpufeatures;
arch_ppc_crc32 = 0;
#if defined(__powerpc64__)
elf_aux_info(AT_HWCAP2, &cpufeatures, sizeof(cpufeatures));
if (cpufeatures & PPC_FEATURE2_HAS_VEC_CRYPTO) arch_ppc_crc32 = 1;
#endif /* __powerpc64__ */
return arch_ppc_crc32;
}
#endif // __linux__
static bool isAltiVec() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment