Go to the documentation of this file.
22 #include <sys/sysctl.h>
23 #elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
25 #include <machine/cpu.h>
28 #elif defined(__linux__)
29 #include <asm/cputable.h>
30 #include <linux/auxvec.h>
35 #elif defined(__NetBSD__) || defined(__OpenBSD__)
36 #include <sys/types.h>
37 #include <sys/sysctl.h>
38 #include <machine/cpu.h>
39 #elif defined(__AMIGAOS4__)
40 #include <exec/exec.h>
41 #include <interfaces/exec.h>
42 #include <proto/exec.h>
56 #define HWCAP_PPC_VSX (1U << 7)
57 #define HWCAP_PPC_ALTIVEC (1U << 28)
58 #define HWCAP2_PPC_ARCH_2_07 (1U << 31)
69 extern struct ExecIFace *IExec;
71 IExec->GetCPUInfoTags(GCIT_VectorUnit, &
result, TAG_DONE);
72 if (
result == VECTORTYPE_ALTIVEC)
75 #elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
89 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
90 #if defined(__NetBSD__) || defined(__OpenBSD__)
91 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
93 int sels[2] = {CTL_HW, HW_VECTORUNIT};
96 size_t len =
sizeof(has_vu);
99 err = sysctl(sels, 2, &has_vu, &
len,
NULL, 0);
104 #elif defined(__linux__)
108 int fd = open(
"/proc/self/auxv", O_RDONLY);
109 unsigned long buf[64] = { 0 };
115 while ((count =
read(fd, buf,
sizeof(buf))) > 0) {
116 for (
i = 0;
i < count /
sizeof(*buf);
i += 2) {
117 if (buf[
i] == AT_NULL)
137 #elif CONFIG_RUNTIME_CPUDETECT && defined(__linux__)
138 #define PVR_G4_7400 0x000C
139 #define PVR_G5_970 0x0039
140 #define PVR_G5_970FX 0x003C
141 #define PVR_G5_970MP 0x0044
142 #define PVR_G5_970GX 0x0045
143 #define PVR_POWER6 0x003E
144 #define PVR_POWER7 0x003F
145 #define PVR_POWER8 0x004B
146 #define PVR_CELL_PPU 0x0070
150 __asm__ volatile(
"mfspr %0, 287" :
"=r" (proc_ver));
152 if (proc_ver & 0x8000 ||
153 proc_ver == PVR_G4_7400 ||
154 proc_ver == PVR_G5_970 ||
155 proc_ver == PVR_G5_970FX ||
156 proc_ver == PVR_G5_970MP ||
157 proc_ver == PVR_G5_970GX ||
158 proc_ver == PVR_POWER6 ||
159 proc_ver == PVR_POWER7 ||
160 proc_ver == PVR_POWER8 ||
161 proc_ver == PVR_CELL_PPU)
163 if (proc_ver == PVR_POWER7 ||
164 proc_ver == PVR_POWER8)
166 if (proc_ver == PVR_POWER8)
#define HWCAP_PPC_ALTIVEC
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define AV_CPU_FLAG_VSX
ISA 2.06.
#define HWCAP2_PPC_ARCH_2_07
#define av_assert0(cond)
assert() equivalent, that is always enabled.
unsigned long ff_getauxval(unsigned long type)
and forward the result(frame or status change) to the corresponding input. If nothing is possible
#define AV_CPU_FLAG_ALTIVEC
standard
#define i(width, name, range_min, range_max)
int ff_get_cpu_flags_ppc(void)
This function MAY rely on signal() or fork() in order to make sure AltiVec is present.
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
#define AV_CPU_FLAG_POWER8
ISA 2.07.
size_t ff_get_cpu_max_align_ppc(void)
#define flags(name, subs,...)
static uint32_t BS_FUNC() read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.