Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Garrett-Glaser <jason@x264.com>2011-09-27 01:44:47 +0400
committerJason Garrett-Glaser <jason@x264.com>2011-09-27 02:30:31 +0400
commit96a59cf37b080080b7e45dd57828b40a7a2bbfe7 (patch)
tree7413dbd8c358ea9ae07dd048eed3f4ea5c3d3d16 /libavutil/x86
parent3d371f417e634e23ad096cb004046d36b1fc7c88 (diff)
x86: XOP/FMA4 CPU detection support
Diffstat (limited to 'libavutil/x86')
-rw-r--r--libavutil/x86/cpu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index f747e4dba8..3975e68533 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -133,6 +133,15 @@ int ff_get_cpu_flags_x86(void)
rval & AV_CPU_FLAG_SSE2 && !(ecx & 0x00000040)) {
rval |= AV_CPU_FLAG_SSE2SLOW;
}
+
+ /* XOP and FMA4 use the AVX instruction coding scheme, so they can't be
+ * used unless the OS has AVX support. */
+ if (rval & AV_CPU_FLAG_AVX) {
+ if (ecx & 0x00000800)
+ rval |= AV_CPU_FLAG_XOP;
+ if (ecx & 0x00010000)
+ rval |= AV_CPU_FLAG_FMA4;
+ }
}
if (!strncmp(vendor.c, "GenuineIntel", 12)) {