From 563cb2dea9f7f73180e2b8cc8d45b0df9358c936 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 13 Aug 2009 17:12:44 +0200 Subject: main: hook up cpu detection code Add CPU detection code to activate the various optimisations. Move some method definitions around. Use compatibility macros when we can. --- src/pulsecore/svolume_mmx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/pulsecore/svolume_mmx.c') diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c index 3c229456..e56f7c31 100644 --- a/src/pulsecore/svolume_mmx.c +++ b/src/pulsecore/svolume_mmx.c @@ -31,6 +31,8 @@ #include #include +#include "cpu-x86.h" + #include "sample-util.h" #include "endianmacros.h" @@ -142,7 +144,7 @@ pa_volume_ulaw_mmx (uint8_t *samples, int32_t *volumes, unsigned channels, unsig static void pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) { - int64_t channel, temp; + pa_reg_x86 channel, temp; /* the max number of samples we process at a time, this is also the max amount * we overread the volume array, which should have enough padding. */ @@ -203,8 +205,8 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi "6: \n\t" " emms \n\t" - : "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((int64_t)channel), "=&r" (temp) - : "r" ((int64_t)channels) + : "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((pa_reg_x86)channel), "=&r" (temp) + : "r" ((pa_reg_x86)channels) : "cc" ); } @@ -212,7 +214,7 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi static void pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) { - int64_t channel, temp; + pa_reg_x86 channel, temp; /* the max number of samples we process at a time, this is also the max amount * we overread the volume array, which should have enough padding. */ @@ -279,8 +281,8 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi "6: \n\t" " emms \n\t" - : "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((int64_t)channel), "=&r" (temp) - : "r" ((int64_t)channels) + : "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((pa_reg_x86)channel), "=&r" (temp) + : "r" ((pa_reg_x86)channels) : "cc" ); } @@ -443,7 +445,7 @@ pa_volume_s24_32re_mmx (uint32_t *samples, int32_t *volumes, unsigned channels, } #endif -#define RUN_TEST +#undef RUN_TEST #ifdef RUN_TEST #define CHANNELS 2 @@ -486,7 +488,7 @@ static void run_test (void) { } #endif -void pa_volume_func_init_mmx (void) { +void pa_volume_func_init_mmx (pa_cpu_x86_flag_t flags) { pa_log_info("Initialising MMX optimized functions."); #ifdef RUN_TEST -- cgit