set(CMAKE_REQUIRED_FLAGS "${PPCFLAGS} ${NATIVEFLAG}")
check_c_source_compiles(
"#include <sys/auxv.h>
+ #ifdef __FreeBSD__
+ #include <machine/cpu.h>
+ #endif
int main() {
+ #ifdef __FreeBSD__
+ unsigned long hwcap;
+ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
+ return (hwcap & PPC_FEATURE_HAS_ALTIVEC);
+ #else
return (getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC);
+ #endif
}"
HAVE_VMX
)
set(CMAKE_REQUIRED_FLAGS "${POWER8FLAG} ${NATIVEFLAG}")
check_c_source_compiles(
"#include <sys/auxv.h>
+ #ifdef __FreeBSD__
+ #include <machine/cpu.h>
+ #endif
int main() {
+ #ifdef __FreeBSD__
+ unsigned long hwcap;
+ elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
+ return (hwcap & PPC_FEATURE2_ARCH_2_07);
+ #else
return (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07);
+ #endif
}"
HAVE_POWER8_INTRIN
)