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)
#define HWCAP_PPC_ALTIVEC
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static av_cold void close(AVCodecParserContext *s)
#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.
#define AV_CPU_FLAG_POWER8
ISA 2.07.
size_t ff_get_cpu_max_align_ppc(void)
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.