diff options
author | James Almer <jamrial@gmail.com> | 2014-02-22 04:54:01 +0000 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2014-02-23 15:29:36 +0100 |
commit | 1b932eb1508f550fac9e911923a0383efda53aa3 (patch) | |
tree | 1dadb7a0429d30648b3e22a7926bf8b1b03e4ac9 /libavutil/x86/cpu.c | |
parent | 10b0161d78148f46eaffb29ea022378947eaef2c (diff) |
x86: add detection for FMA3 instruction set
Based on x264 code
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/x86/cpu.c')
-rw-r--r-- | libavutil/x86/cpu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index 0e06d5deb2..95359eeb7b 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -131,8 +131,11 @@ int ff_get_cpu_flags_x86(void) if ((ecx & 0x18000000) == 0x18000000) { /* Check for OS support */ xgetbv(0, eax, edx); - if ((eax & 0x6) == 0x6) + if ((eax & 0x6) == 0x6) { rval |= AV_CPU_FLAG_AVX; + if (ecx & 0x00001000) + rval |= AV_CPU_FLAG_FMA3; + } } #if HAVE_AVX2 if (max_std_level >= 7) { |