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__)
37#include <sys/sysctl.h>
38#include <machine/cpu.h>
39#elif defined(__AMIGAOS4__)
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)
static av_cold void close(AVCodecParserContext *s)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
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.
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
size_t ff_get_cpu_max_align_ppc(void)
int ff_get_cpu_flags_ppc(void)
This function MAY rely on signal() or fork() in order to make sure AltiVec is present.
unsigned long ff_getauxval(unsigned long type)
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 AV_CPU_FLAG_POWER8
ISA 2.07.
#define AV_CPU_FLAG_ALTIVEC
standard
#define HWCAP2_PPC_ARCH_2_07
#define HWCAP_PPC_ALTIVEC