#include <stdlib.h>
#include <string.h>
-#include "libavutil/x86_cpu.h"
+#include "libavutil/x86/asm.h"
#include "libavutil/cpu.h"
#if HAVE_INLINE_ASM
} while (0)
#endif /* HAVE_XGETBV */
+#if HAVE_INLINE_ASM
+
#define get_eflags(x) \
__asm__ volatile ("pushfl \n" \
"pop %0 \n" \
"popfl \n" \
:: "r"(x))
+#elif HAVE_RWEFLAGS
+
+#include <intrin.h>
+
+#define get_eflags(x) \
+ x = __readeflags()
+
+#define set_eflags(x) \
+ __writeeflags(x)
+
+#endif /* HAVE_INLINE_ASM */
+
/* Function to test if multimedia instructions are supported... */
int ff_get_cpu_flags_x86(void)
{
if (std_caps & (1 << 23))
rval |= AV_CPU_FLAG_MMX;
if (std_caps & (1 << 25))
- rval |= AV_CPU_FLAG_MMX2;
+ rval |= AV_CPU_FLAG_MMXEXT;
#if HAVE_SSE
if (std_caps & (1 << 25))
rval |= AV_CPU_FLAG_SSE;
if ((eax & 0x6) == 0x6)
rval |= AV_CPU_FLAG_AVX;
}
-#endif
-#endif
+#endif /* HAVE_AVX */
+#endif /* HAVE_SSE */
}
cpuid(0x80000000, max_ext_level, ebx, ecx, edx);
if (ext_caps & (1 << 23))
rval |= AV_CPU_FLAG_MMX;
if (ext_caps & (1 << 22))
- rval |= AV_CPU_FLAG_MMX2;
+ rval |= AV_CPU_FLAG_MMXEXT;
/* Allow for selectively disabling SSE2 functions on AMD processors
with SSE2 support but not SSE4a. This includes Athlon64, some