diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-02-11 16:04:43 +0100 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-02-12 18:56:06 +0100 |
commit | b223035511d3431853c1e678d49e2630152c591a (patch) | |
tree | 61afbfacc486e1268acc93675321c8d01560b0a5 /libavutil | |
parent | cd1c12b5c5b79195140a93d59cbf990d034f61d8 (diff) | |
download | ffmpeg-b223035511d3431853c1e678d49e2630152c591a.tar.gz |
Detect and check for CMOV.
Some MMX-only CPUs do not have support for CMOV.
All SSE/MMX2 CPUs should be fine, thus no check was
added to those functions.
See also https://sourceforge.net/tracker/?func=detail&aid=3358347&group_id=205275&atid=992986
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/cpu.h | 1 | ||||
-rw-r--r-- | libavutil/x86/cpu.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/cpu.h b/libavutil/cpu.h index 5f7eed2b60..691ee9c8c1 100644 --- a/libavutil/cpu.h +++ b/libavutil/cpu.h @@ -38,6 +38,7 @@ #define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions #define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions #define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used +#define AV_CPU_FLAG_CMOV 0x1000000 ///< supports cmov instruction #define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions #define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions #define AV_CPU_FLAG_IWMMXT 0x0100 ///< XScale IWMMXT diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index 93df737c28..b53379bbd3 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -83,6 +83,8 @@ int ff_get_cpu_flags_x86(void) cpuid(1, eax, ebx, ecx, std_caps); family = ((eax>>8)&0xf) + ((eax>>20)&0xff); model = ((eax>>4)&0xf) + ((eax>>12)&0xf0); + if (std_caps & (1<<15)) + rval |= AV_CPU_FLAG_CMOV; if (std_caps & (1<<23)) rval |= AV_CPU_FLAG_MMX; if (std_caps & (1<<25)) |