SSE/MMX: Fix problem with highpitched noise on i386
authorDavid Henningsson <david.henningsson@canonical.com>
Fri, 27 May 2011 07:28:57 +0000 (09:28 +0200)
committerColin Guthrie <colin@mageia.org>
Wed, 22 Jun 2011 12:45:55 +0000 (13:45 +0100)
The "rm" basm constraint doesn't work with my version of gcc (4.5.2),
not even in a simple example. Since we usually only have 5 registers
available on i386, force it to be memory on that architecture.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
src/pulsecore/svolume_mmx.c
src/pulsecore/svolume_sse.c

index 7286b4a..28bbfdd 100644 (file)
@@ -155,7 +155,11 @@ static void pa_volume_s16ne_mmx(int16_t *samples, int32_t *volumes, unsigned cha
         " emms                          \n\t"
 
         : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
-        : "rm" ((pa_reg_x86)channels)
+#if defined (__i386__)
+        : "m" ((pa_reg_x86)channels)
+#else
+        : "r" ((pa_reg_x86)channels)
+#endif
         : "cc"
     );
 }
@@ -230,7 +234,11 @@ static void pa_volume_s16re_mmx(int16_t *samples, int32_t *volumes, unsigned cha
         " emms                          \n\t"
 
         : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
-        : "rm" ((pa_reg_x86)channels)
+#if defined (__i386__)
+        : "m" ((pa_reg_x86)channels)
+#else
+        : "r" ((pa_reg_x86)channels)
+#endif
         : "cc"
     );
 }
index 8fed69b..dcd71c4 100644 (file)
@@ -154,7 +154,11 @@ static void pa_volume_s16ne_sse2(int16_t *samples, int32_t *volumes, unsigned ch
         "8:                             \n\t"
 
         : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
-        : "rm" ((pa_reg_x86)channels)
+#if defined (__i386__)
+        : "m" ((pa_reg_x86)channels)
+#else
+        : "r" ((pa_reg_x86)channels)
+#endif
         : "cc"
     );
 }
@@ -242,7 +246,11 @@ static void pa_volume_s16re_sse2(int16_t *samples, int32_t *volumes, unsigned ch
         "8:                             \n\t"
 
         : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
-        : "rm" ((pa_reg_x86)channels)
+#if defined (__i386__)
+        : "m" ((pa_reg_x86)channels)
+#else
+        : "r" ((pa_reg_x86)channels)
+#endif
         : "cc"
     );
 }