svolume: add CPU guards around code
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 19 Aug 2009 14:09:48 +0000 (16:09 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 20 Aug 2009 09:31:03 +0000 (11:31 +0200)
Mark code that should only be compiled on x86 CPUs with proper defines.

src/pulsecore/svolume_mmx.c
src/pulsecore/svolume_sse.c

index 5243b44..fb4c82c 100644 (file)
@@ -35,6 +35,7 @@
 #include "sample-util.h"
 #include "endianmacros.h"
 
+#if defined (__i386__) || defined (__amd64__)
 /* in s: 2 int16_t samples
  * in v: 2 int32_t volumes, fixed point 16:16
  * out s: contains scaled and clamped int16_t samples.
@@ -295,7 +296,11 @@ static void run_test (void) {
 }
 #endif
 
+#endif /* defined (__i386__) || defined (__amd64__) */
+
+
 void pa_volume_func_init_mmx (pa_cpu_x86_flag_t flags) {
+#if defined (__i386__) || defined (__amd64__)
   pa_log_info("Initialising MMX optimized functions.");
 
 #ifdef RUN_TEST
@@ -304,4 +309,5 @@ void pa_volume_func_init_mmx (pa_cpu_x86_flag_t flags) {
 
   pa_set_volume_func (PA_SAMPLE_S16NE,     (pa_do_volume_func_t) pa_volume_s16ne_mmx);
   pa_set_volume_func (PA_SAMPLE_S16RE,     (pa_do_volume_func_t) pa_volume_s16re_mmx);
+#endif /* defined (__i386__) || defined (__amd64__) */
 }
index 98f828c..141c466 100644 (file)
@@ -35,6 +35,8 @@
 #include "sample-util.h"
 #include "endianmacros.h"
 
+#if defined (__i386__) || defined (__amd64__)
+
 #define VOLUME_32x16(s,v)                  /* .. |   vh  |   vl  | */                   \
       " pxor %%xmm4, %%xmm4          \n\t" /* .. |    0  |    0  | */                   \
       " punpcklwd %%xmm4, "#s"       \n\t" /* .. |    0  |   p0  | */                   \
@@ -293,8 +295,10 @@ static void run_test (void) {
   pa_log_info("ref: %llu usec.", (long long unsigned int)pa_timeval_diff (&stop, &start));
 }
 #endif
+#endif /* defined (__i386__) || defined (__amd64__) */
 
 void pa_volume_func_init_sse (pa_cpu_x86_flag_t flags) {
+#if defined (__i386__) || defined (__amd64__)
   pa_log_info("Initialising SSE optimized functions.");
 
 #ifdef RUN_TEST
@@ -303,4 +307,5 @@ void pa_volume_func_init_sse (pa_cpu_x86_flag_t flags) {
 
   pa_set_volume_func (PA_SAMPLE_S16NE,     (pa_do_volume_func_t) pa_volume_s16ne_sse);
   pa_set_volume_func (PA_SAMPLE_S16RE,     (pa_do_volume_func_t) pa_volume_s16re_sse);
+#endif /* defined (__i386__) || defined (__amd64__) */
 }