diff options
author | Dave Hooper <dave@beermex.com> | 2009-08-29 12:07:32 +0000 |
---|---|---|
committer | Dave Hooper <dave@beermex.com> | 2009-08-29 12:07:32 +0000 |
commit | e9dcb0f1457f83b33bd9778e9df4caff44ead6c1 (patch) | |
tree | 77545c7ed0505e7be74110e68561a383aa4a12de | |
parent | 59cdbf5efca64962fe6a6c85eb03b64552eae6d2 (diff) | |
download | rockbox-e9dcb0f1457f83b33bd9778e9df4caff44ead6c1.tar.gz rockbox-e9dcb0f1457f83b33bd9778e9df4caff44ead6c1.zip |
Fix condition code clobbers (and one TAB) for inline arm code in lib and libtremor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22526 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/lib/asm_arm.h | 30 | ||||
-rw-r--r-- | apps/codecs/libtremor/asm_arm.h | 28 |
2 files changed, 21 insertions, 37 deletions
diff --git a/apps/codecs/lib/asm_arm.h b/apps/codecs/lib/asm_arm.h index 0db868dcb3..89606184da 100644 --- a/apps/codecs/lib/asm_arm.h +++ b/apps/codecs/lib/asm_arm.h | |||
@@ -23,8 +23,7 @@ static inline int32_t MULT32(int32_t x, int32_t y) { | |||
23 | int lo,hi; | 23 | int lo,hi; |
24 | asm volatile("smull\t%0, %1, %2, %3" | 24 | asm volatile("smull\t%0, %1, %2, %3" |
25 | : "=&r"(lo),"=&r"(hi) | 25 | : "=&r"(lo),"=&r"(hi) |
26 | : "%r"(x),"r"(y) | 26 | : "%r"(x),"r"(y) ); |
27 | : "cc"); | ||
28 | return(hi); | 27 | return(hi); |
29 | } | 28 | } |
30 | 29 | ||
@@ -39,23 +38,20 @@ static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) { | |||
39 | "adc %1, %0, %1, lsl #17\n\t" | 38 | "adc %1, %0, %1, lsl #17\n\t" |
40 | : "=&r"(lo),"=&r"(hi) | 39 | : "=&r"(lo),"=&r"(hi) |
41 | : "%r"(x),"r"(y) | 40 | : "%r"(x),"r"(y) |
42 | : "cc"); | 41 | : "cc" ); |
43 | return(hi); | 42 | return(hi); |
44 | } | 43 | } |
45 | 44 | ||
46 | #define MB() asm volatile ("" : : : "memory") | ||
47 | |||
48 | #define XPROD32(a, b, t, v, x, y) \ | 45 | #define XPROD32(a, b, t, v, x, y) \ |
49 | { \ | 46 | { \ |
50 | long l; \ | 47 | long l; \ |
51 | asm( "smull %0, %1, %4, %6\n\t" \ | 48 | asm( "smull %0, %1, %4, %6\n\t" \ |
52 | "smlal %0, %1, %5, %7\n\t" \ | ||
53 | "rsb %3, %4, #0\n\t" \ | 49 | "rsb %3, %4, #0\n\t" \ |
50 | "smlal %0, %1, %5, %7\n\t" \ | ||
54 | "smull %0, %2, %5, %6\n\t" \ | 51 | "smull %0, %2, %5, %6\n\t" \ |
55 | "smlal %0, %2, %3, %7" \ | 52 | "smlal %0, %2, %3, %7" \ |
56 | : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ | 53 | : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ |
57 | : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) \ | 54 | : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) ); \ |
58 | : "cc" ); \ | ||
59 | } | 55 | } |
60 | 56 | ||
61 | static inline void XPROD31(int32_t a, int32_t b, | 57 | static inline void XPROD31(int32_t a, int32_t b, |
@@ -64,15 +60,13 @@ static inline void XPROD31(int32_t a, int32_t b, | |||
64 | { | 60 | { |
65 | int x1, y1, l; | 61 | int x1, y1, l; |
66 | asm( "smull %0, %1, %4, %6\n\t" | 62 | asm( "smull %0, %1, %4, %6\n\t" |
67 | "smlal %0, %1, %5, %7\n\t" | ||
68 | "rsb %3, %4, #0\n\t" | 63 | "rsb %3, %4, #0\n\t" |
64 | "smlal %0, %1, %5, %7\n\t" | ||
69 | "smull %0, %2, %5, %6\n\t" | 65 | "smull %0, %2, %5, %6\n\t" |
70 | "smlal %0, %2, %3, %7" | 66 | "smlal %0, %2, %3, %7" |
71 | : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) | 67 | : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) |
72 | : "3" (a), "r" (b), "r" (t), "r" (v) | 68 | : "3" (a), "r" (b), "r" (t), "r" (v) ); |
73 | : "cc" ); | ||
74 | *x = x1 << 1; | 69 | *x = x1 << 1; |
75 | MB(); | ||
76 | *y = y1 << 1; | 70 | *y = y1 << 1; |
77 | } | 71 | } |
78 | 72 | ||
@@ -81,16 +75,14 @@ static inline void XNPROD31(int32_t a, int32_t b, | |||
81 | int32_t *x, int32_t *y) | 75 | int32_t *x, int32_t *y) |
82 | { | 76 | { |
83 | int x1, y1, l; | 77 | int x1, y1, l; |
84 | asm( "rsb %2, %4, #0\n\t" | 78 | asm( "smull %0, %1, %3, %5\n\t" |
85 | "smull %0, %1, %3, %5\n\t" | 79 | "rsb %2, %4, #0\n\t" |
86 | "smlal %0, %1, %2, %6\n\t" | 80 | "smlal %0, %1, %2, %6\n\t" |
87 | "smull %0, %2, %4, %5\n\t" | 81 | "smull %0, %2, %4, %5\n\t" |
88 | "smlal %0, %2, %3, %6" | 82 | "smlal %0, %2, %3, %6" |
89 | : "=&r" (l), "=&r" (x1), "=&r" (y1) | 83 | : "=&r" (l), "=&r" (x1), "=&r" (y1) |
90 | : "r" (a), "r" (b), "r" (t), "r" (v) | 84 | : "r" (a), "r" (b), "r" (t), "r" (v) ); |
91 | : "cc" ); | ||
92 | *x = x1 << 1; | 85 | *x = x1 << 1; |
93 | MB(); | ||
94 | *y = y1 << 1; | 86 | *y = y1 << 1; |
95 | } | 87 | } |
96 | 88 | ||
@@ -158,7 +150,7 @@ void vect_mult_fw(int32_t *data, int32_t *window, int n) | |||
158 | : [d] "+r" (data), [w] "+r" (window) | 150 | : [d] "+r" (data), [w] "+r" (window) |
159 | : : "r0", "r1", "r2", "r3", | 151 | : : "r0", "r1", "r2", "r3", |
160 | "r4", "r5", "r6", "r7", "r8", "r9", | 152 | "r4", "r5", "r6", "r7", "r8", "r9", |
161 | "memory", "cc"); | 153 | "memory" ); |
162 | n -= 4; | 154 | n -= 4; |
163 | } | 155 | } |
164 | while(n>0) { | 156 | while(n>0) { |
@@ -187,7 +179,7 @@ void vect_mult_bw(int32_t *data, int32_t *window, int n) | |||
187 | : [d] "+r" (data), [w] "+r" (window) | 179 | : [d] "+r" (data), [w] "+r" (window) |
188 | : : "r0", "r1", "r2", "r3", | 180 | : : "r0", "r1", "r2", "r3", |
189 | "r4", "r5", "r6", "r7", "r8", "r9", | 181 | "r4", "r5", "r6", "r7", "r8", "r9", |
190 | "memory", "cc"); | 182 | "memory" ); |
191 | n -= 4; | 183 | n -= 4; |
192 | } | 184 | } |
193 | while(n>0) { | 185 | while(n>0) { |
diff --git a/apps/codecs/libtremor/asm_arm.h b/apps/codecs/libtremor/asm_arm.h index 5a8109841f..577dc91566 100644 --- a/apps/codecs/libtremor/asm_arm.h +++ b/apps/codecs/libtremor/asm_arm.h | |||
@@ -24,8 +24,7 @@ static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { | |||
24 | int lo,hi; | 24 | int lo,hi; |
25 | asm volatile("smull\t%0, %1, %2, %3" | 25 | asm volatile("smull\t%0, %1, %2, %3" |
26 | : "=&r"(lo),"=&r"(hi) | 26 | : "=&r"(lo),"=&r"(hi) |
27 | : "%r"(x),"r"(y) | 27 | : "%r"(x),"r"(y) ); |
28 | : "cc"); | ||
29 | return(hi); | 28 | return(hi); |
30 | } | 29 | } |
31 | 30 | ||
@@ -44,19 +43,16 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { | |||
44 | return(hi); | 43 | return(hi); |
45 | } | 44 | } |
46 | 45 | ||
47 | #define MB() asm volatile ("" : : : "memory") | ||
48 | |||
49 | #define XPROD32(a, b, t, v, x, y) \ | 46 | #define XPROD32(a, b, t, v, x, y) \ |
50 | { \ | 47 | { \ |
51 | long l; \ | 48 | long l; \ |
52 | asm( "smull %0, %1, %4, %6\n\t" \ | 49 | asm( "smull %0, %1, %4, %6\n\t" \ |
53 | "smlal %0, %1, %5, %7\n\t" \ | ||
54 | "rsb %3, %4, #0\n\t" \ | 50 | "rsb %3, %4, #0\n\t" \ |
51 | "smlal %0, %1, %5, %7\n\t" \ | ||
55 | "smull %0, %2, %5, %6\n\t" \ | 52 | "smull %0, %2, %5, %6\n\t" \ |
56 | "smlal %0, %2, %3, %7" \ | 53 | "smlal %0, %2, %3, %7" \ |
57 | : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ | 54 | : "=&r" (l), "=&r" (x), "=&r" (y), "=r" ((a)) \ |
58 | : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) \ | 55 | : "3" ((a)), "r" ((b)), "r" ((t)), "r" ((v)) ); \ |
59 | : "cc" ); \ | ||
60 | } | 56 | } |
61 | 57 | ||
62 | static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, | 58 | static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, |
@@ -65,15 +61,13 @@ static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, | |||
65 | { | 61 | { |
66 | int x1, y1, l; | 62 | int x1, y1, l; |
67 | asm( "smull %0, %1, %4, %6\n\t" | 63 | asm( "smull %0, %1, %4, %6\n\t" |
68 | "smlal %0, %1, %5, %7\n\t" | ||
69 | "rsb %3, %4, #0\n\t" | 64 | "rsb %3, %4, #0\n\t" |
65 | "smlal %0, %1, %5, %7\n\t" | ||
70 | "smull %0, %2, %5, %6\n\t" | 66 | "smull %0, %2, %5, %6\n\t" |
71 | "smlal %0, %2, %3, %7" | 67 | "smlal %0, %2, %3, %7" |
72 | : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) | 68 | : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) |
73 | : "3" (a), "r" (b), "r" (t), "r" (v) | 69 | : "3" (a), "r" (b), "r" (t), "r" (v) ); |
74 | : "cc" ); | ||
75 | *x = x1 << 1; | 70 | *x = x1 << 1; |
76 | MB(); | ||
77 | *y = y1 << 1; | 71 | *y = y1 << 1; |
78 | } | 72 | } |
79 | 73 | ||
@@ -82,16 +76,14 @@ static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b, | |||
82 | ogg_int32_t *x, ogg_int32_t *y) | 76 | ogg_int32_t *x, ogg_int32_t *y) |
83 | { | 77 | { |
84 | int x1, y1, l; | 78 | int x1, y1, l; |
85 | asm( "rsb %2, %4, #0\n\t" | 79 | asm( "smull %0, %1, %3, %5\n\t" |
86 | "smull %0, %1, %3, %5\n\t" | 80 | "rsb %2, %4, #0\n\t" |
87 | "smlal %0, %1, %2, %6\n\t" | 81 | "smlal %0, %1, %2, %6\n\t" |
88 | "smull %0, %2, %4, %5\n\t" | 82 | "smull %0, %2, %4, %5\n\t" |
89 | "smlal %0, %2, %3, %6" | 83 | "smlal %0, %2, %3, %6" |
90 | : "=&r" (l), "=&r" (x1), "=&r" (y1) | 84 | : "=&r" (l), "=&r" (x1), "=&r" (y1) |
91 | : "r" (a), "r" (b), "r" (t), "r" (v) | 85 | : "r" (a), "r" (b), "r" (t), "r" (v) ); |
92 | : "cc" ); | ||
93 | *x = x1 << 1; | 86 | *x = x1 << 1; |
94 | MB(); | ||
95 | *y = y1 << 1; | 87 | *y = y1 << 1; |
96 | } | 88 | } |
97 | 89 | ||
@@ -184,7 +176,7 @@ void vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n) | |||
184 | : [d] "+r" (data), [w] "+r" (window) | 176 | : [d] "+r" (data), [w] "+r" (window) |
185 | : : "r0", "r1", "r2", "r3", | 177 | : : "r0", "r1", "r2", "r3", |
186 | "r4", "r5", "r6", "r7", "r8", | 178 | "r4", "r5", "r6", "r7", "r8", |
187 | "memory", "cc"); | 179 | "memory" ); |
188 | n -= 4; | 180 | n -= 4; |
189 | } while (n); | 181 | } while (n); |
190 | } | 182 | } |
@@ -205,7 +197,7 @@ void vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n) | |||
205 | : [d] "+r" (data), [w] "+r" (window) | 197 | : [d] "+r" (data), [w] "+r" (window) |
206 | : : "r0", "r1", "r2", "r3", | 198 | : : "r0", "r1", "r2", "r3", |
207 | "r4", "r5", "r6", "r7", "r8", | 199 | "r4", "r5", "r6", "r7", "r8", |
208 | "memory", "cc"); | 200 | "memory" ); |
209 | n -= 4; | 201 | n -= 4; |
210 | } while (n); | 202 | } while (n); |
211 | } | 203 | } |