diff options
author | Jason Garrett-Glaser <jason@x264.com> | 2011-09-26 14:44:47 -0700 |
---|---|---|
committer | Jason Garrett-Glaser <jason@x264.com> | 2011-09-26 15:30:31 -0700 |
commit | 96a59cf37b080080b7e45dd57828b40a7a2bbfe7 (patch) | |
tree | 7413dbd8c358ea9ae07dd048eed3f4ea5c3d3d16 /libavutil/x86 | |
parent | 3d371f417e634e23ad096cb004046d36b1fc7c88 (diff) | |
download | ffmpeg-96a59cf37b080080b7e45dd57828b40a7a2bbfe7.tar.gz |
x86: XOP/FMA4 CPU detection support
Diffstat (limited to 'libavutil/x86')
-rw-r--r-- | libavutil/x86/cpu.c | 9 |
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)) { |