forked from len0rd/rockbox
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
This commit is contained in:
parent
9a2b1d612c
commit
d5a27c2fb1
1 changed files with 14 additions and 1 deletions
|
@ -263,7 +263,7 @@ static inline void mono2stereo(int16_t *end)
|
||||||
{
|
{
|
||||||
if(audio_channels != 1) /* only for microphone */
|
if(audio_channels != 1) /* only for microphone */
|
||||||
return;
|
return;
|
||||||
|
#if 0
|
||||||
/* load pointer in a register and avoid updating it in each loop */
|
/* load pointer in a register and avoid updating it in each loop */
|
||||||
register int16_t *samples = mono_samples;
|
register int16_t *samples = mono_samples;
|
||||||
|
|
||||||
|
@ -273,6 +273,19 @@ static inline void mono2stereo(int16_t *end)
|
||||||
} while(samples != end);
|
} while(samples != end);
|
||||||
|
|
||||||
mono_samples = samples; /* update pointer */
|
mono_samples = samples; /* update pointer */
|
||||||
|
#else
|
||||||
|
/* gcc doesn't use pre indexing : let's save 1 cycle */
|
||||||
|
int16_t left;
|
||||||
|
asm (
|
||||||
|
"1: ldrh %0, [%1], #2 \n" // load 1 sample of the left-channel
|
||||||
|
" strh %0, [%1], #2 \n" // copy it in the right-channel
|
||||||
|
" cmp %1, %2 \n" // are we finished?
|
||||||
|
" bne 1b \n"
|
||||||
|
: "=&r"(left), "+r"(mono_samples)
|
||||||
|
: "r"(end)
|
||||||
|
: "memory"
|
||||||
|
);
|
||||||
|
#endif /* C / ASM */
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CPU == AS3525 */
|
#endif /* CONFIG_CPU == AS3525 */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue