summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-06-11 14:04:48 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-06-11 14:04:48 +0000
commitd5a27c2fb1d653bb133a57acacc06b9efdc3ce4c (patch)
tree96a2a4b594608362ce372e66a89724ed4329bdf7
parent9a2b1d612cd887c47254015b1721517494f12ab9 (diff)
downloadrockbox-d5a27c2fb1d653bb133a57acacc06b9efdc3ce4c.tar.gz
rockbox-d5a27c2fb1d653bb133a57acacc06b9efdc3ce4c.zip
pcm as3525v1: revert 26761 to use faster ASM code
Fix the asm constraints to mark the left output variable as earlyclobber Thanks to amiconn git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26777 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
index 20c34bba36..8c5bb67076 100644
--- a/firmware/target/arm/as3525/pcm-as3525.c
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -263,7 +263,7 @@ static inline void mono2stereo(int16_t *end)
263{ 263{
264 if(audio_channels != 1) /* only for microphone */ 264 if(audio_channels != 1) /* only for microphone */
265 return; 265 return;
266 266#if 0
267 /* load pointer in a register and avoid updating it in each loop */ 267 /* load pointer in a register and avoid updating it in each loop */
268 register int16_t *samples = mono_samples; 268 register int16_t *samples = mono_samples;
269 269
@@ -273,6 +273,19 @@ static inline void mono2stereo(int16_t *end)
273 } while(samples != end); 273 } while(samples != end);
274 274
275 mono_samples = samples; /* update pointer */ 275 mono_samples = samples; /* update pointer */
276#else
277 /* gcc doesn't use pre indexing : let's save 1 cycle */
278 int16_t left;
279 asm (
280 "1: ldrh %0, [%1], #2 \n" // load 1 sample of the left-channel
281 " strh %0, [%1], #2 \n" // copy it in the right-channel
282 " cmp %1, %2 \n" // are we finished?
283 " bne 1b \n"
284 : "=&r"(left), "+r"(mono_samples)
285 : "r"(end)
286 : "memory"
287 );
288#endif /* C / ASM */
276} 289}
277#endif /* CONFIG_CPU == AS3525 */ 290#endif /* CONFIG_CPU == AS3525 */
278 291