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.
This commit is contained in:
Diego Biurrun
2012-08-29 19:01:05 +02:00
parent 6a0200f24d
commit e0c6cce447
21 changed files with 133 additions and 156 deletions

View File

@@ -21,6 +21,7 @@
#include "config.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/sbrdsp.h"
float ff_sbr_sum_square_sse(float (*x)[2], int n);
@@ -29,12 +30,10 @@ void ff_sbr_hf_g_filt_sse(float (*Y)[2], const float (*X_high)[40][2],
void ff_sbrdsp_init_x86(SBRDSPContext *s)
{
if (HAVE_YASM) {
int mm_flags = av_get_cpu_flags();
int mm_flags = av_get_cpu_flags();
if (mm_flags & AV_CPU_FLAG_SSE) {
s->sum_square = ff_sbr_sum_square_sse;
s->hf_g_filt = ff_sbr_hf_g_filt_sse;
}
if (EXTERNAL_SSE(mm_flags)) {
s->sum_square = ff_sbr_sum_square_sse;
s->hf_g_filt = ff_sbr_hf_g_filt_sse;
}
}