20 #include <sys/sysctl.h>
21 #elif defined(__OpenBSD__)
22 #include <sys/param.h>
23 #include <sys/sysctl.h>
24 #include <machine/cpu.h>
25 #elif defined(__AMIGAOS4__)
26 #include <exec/exec.h>
27 #include <interfaces/exec.h>
28 #include <proto/exec.h>
44 extern struct ExecIFace *IExec;
46 IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
47 if (result == VECTORTYPE_ALTIVEC)
50 #elif defined(__APPLE__) || defined(__OpenBSD__)
52 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
54 int sels[2] = {CTL_HW, HW_VECTORUNIT};
57 size_t len =
sizeof(has_vu);
60 err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
65 #elif CONFIG_RUNTIME_CPUDETECT && defined(__linux__) && !ARCH_PPC64
68 __asm__
volatile(
"mfspr %0, 287" :
"=r" (proc_ver));
70 if (proc_ver & 0x8000 ||
72 proc_ver == 0x0039 || proc_ver == 0x003c ||
73 proc_ver == 0x0044 || proc_ver == 0x0045 ||