summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-remap_neon-use-register-r12-instead-of-r7.patch
blob: aaa162f9b052ac79647c27fd718a3f91609e3104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 4a1668f341f0228904105f77fe5871b9d59b2663 Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <tanuk@iki.fi>
Date: Mon, 13 Jul 2020 12:42:14 +0300
Subject: [PATCH] remap_neon: use register r12 instead of r7

When the Thumb instructions set is used and frame pointers are enabled
(-fno-omit-frame-pointer), r7 can't be used, because it's used for the
frame pointer. Trying to use r7 caused the compilation to fail.

Thanks to Andre McCurdy for suggesting[1] this fix, all I had to do was to
test that it works. The code builds now, and cpu-remap-test also
succeeds.

[1] https://lists.openembedded.org/g/openembedded-core/message/136786

Upstream-Status: Submitted [https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/324]

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
---
 src/pulsecore/remap_neon.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/pulsecore/remap_neon.c b/src/pulsecore/remap_neon.c
index ca3b95b48..6f71345f8 100644
--- a/src/pulsecore/remap_neon.c
+++ b/src/pulsecore/remap_neon.c
@@ -52,11 +52,15 @@ static void remap_mono_to_stereo_float32ne_generic_arm(pa_remap_t *m, float *dst
         __asm__ __volatile__ (
             "ldm        %[src]!, {r4,r6}        \n\t"
             "mov        r5, r4                  \n\t"
-            "mov        r7, r6                  \n\t"
-            "stm        %[dst]!, {r4-r7}        \n\t"
+
+            /* We use r12 instead of r7 here, because r7 is reserved for the
+             * frame pointer when using Thumb. */
+            "mov        r12, r6                 \n\t"
+
+            "stm        %[dst]!, {r4-r6,r12}    \n\t"
             : [dst] "+r" (dst), [src] "+r" (src) /* output operands */
             : /* input operands */
-            : "memory", "r4", "r5", "r6", "r7" /* clobber list */
+            : "memory", "r4", "r5", "r6", "r12" /* clobber list */
         );
     }
 
-- 
2.20.1