From e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 29 Aug 2012 19:01:05 +0200 Subject: x86: Replace checks for CPU extensions and flags by convenience macros This separates code relying on inline from that relying on external assembly and fixes instances where the coalesced check was incorrect. --- libavcodec/x86/fmtconvert_init.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libavcodec/x86/fmtconvert_init.c') diff --git a/libavcodec/x86/fmtconvert_init.c b/libavcodec/x86/fmtconvert_init.c index e781adbd41..b97fbf9863 100644 --- a/libavcodec/x86/fmtconvert_init.c +++ b/libavcodec/x86/fmtconvert_init.c @@ -24,6 +24,7 @@ #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/fmtconvert.h" #include "libavcodec/dsputil.h" @@ -117,27 +118,27 @@ void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx) #if HAVE_YASM int mm_flags = av_get_cpu_flags(); - if (mm_flags & AV_CPU_FLAG_MMX) { + if (EXTERNAL_MMX(mm_flags)) { c->float_interleave = float_interleave_mmx; - if (HAVE_AMD3DNOW && mm_flags & AV_CPU_FLAG_3DNOW) { + if (EXTERNAL_AMD3DNOW(mm_flags)) { if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ c->float_to_int16 = ff_float_to_int16_3dnow; c->float_to_int16_interleave = float_to_int16_interleave_3dnow; } } - if (HAVE_AMD3DNOWEXT && mm_flags & AV_CPU_FLAG_3DNOWEXT) { + if (EXTERNAL_AMD3DNOWEXT(mm_flags)) { if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ c->float_to_int16_interleave = float_to_int16_interleave_3dnowext; } } - if (HAVE_SSE && mm_flags & AV_CPU_FLAG_SSE) { + if (EXTERNAL_SSE(mm_flags)) { c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse; c->float_to_int16 = ff_float_to_int16_sse; c->float_to_int16_interleave = float_to_int16_interleave_sse; c->float_interleave = float_interleave_sse; } - if (HAVE_SSE && mm_flags & AV_CPU_FLAG_SSE2) { + if (EXTERNAL_SSE2(mm_flags)) { c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2; c->float_to_int16 = ff_float_to_int16_sse2; c->float_to_int16_interleave = float_to_int16_interleave_sse2; -- cgit v1.2.3