aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Raghavan <arun@arunraghavan.net>2019-07-11 10:57:31 +0530
committerTanu Kaskinen <tanuk@iki.fi>2019-07-15 13:50:16 +0000
commite8fe04b2f6ab248a09176622b062bd934eb49e4c (patch)
tree82e8c6f498b433cb88e20c74addf607419489628
parente34dd0fb8f8ca8e66fc426e2524565c9ed4c8794 (diff)
downloadpulseaudio-e8fe04b2f6ab248a09176622b062bd934eb49e4c.tar.gz
svolume: Mark channel parameter as earlyclobber
For all our MMX/SSE code, we use a temporary channel variable, assigned to the DI register, which is zero'ed as the very first operation in the inline assembly code, before any other code is run. With GCC 9.1, while using -O2, the DI register is also used for the input operand. This is perfectly legal, but causes our code to become incorrect because the output operand that is assigned to DI is not explicitly marked as being clobbered before inputs are read. This change fixes the problem by adding an earlyclobber annotation (&) to the DI output argument.
-rw-r--r--src/pulsecore/svolume_mmx.c4
-rw-r--r--src/pulsecore/svolume_sse.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index 5d39234f..c5848cc0 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -149,7 +149,7 @@ static void pa_volume_s16ne_mmx(int16_t *samples, const int32_t *volumes, unsign
"6: \n\t"
" emms \n\t"
- : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
+ : "+r" (samples), "+r" (volumes), "+r" (length), "=&D" (channel), "=&r" (temp)
#if defined (__i386__)
: "m" (channels)
#else
@@ -228,7 +228,7 @@ static void pa_volume_s16re_mmx(int16_t *samples, const int32_t *volumes, unsign
"6: \n\t"
" emms \n\t"
- : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
+ : "+r" (samples), "+r" (volumes), "+r" (length), "=&D" (channel), "=&r" (temp)
#if defined (__i386__)
: "m" (channels)
#else
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index f6d63820..222ff185 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -147,7 +147,7 @@ static void pa_volume_s16ne_sse2(int16_t *samples, const int32_t *volumes, unsig
" jne 7b \n\t"
"8: \n\t"
- : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
+ : "+r" (samples), "+r" (volumes), "+r" (length), "=&D" (channel), "=&r" (temp)
#if defined (__i386__)
: "m" (channels)
#else
@@ -239,7 +239,7 @@ static void pa_volume_s16re_sse2(int16_t *samples, const int32_t *volumes, unsig
" jne 7b \n\t"
"8: \n\t"
- : "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
+ : "+r" (samples), "+r" (volumes), "+r" (length), "=&D" (channel), "=&r" (temp)
#if defined (__i386__)
: "m" (channels)
#else