diff options
author | Nils Wallménius <nils@rockbox.org> | 2010-05-13 09:44:05 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2010-05-13 09:44:05 +0000 |
commit | 889b4a8ce838bd4191c736d01d9665c177e6d390 (patch) | |
tree | cc8e311174d98d38eba124dd175d42312040ea20 | |
parent | 1940a0b1898f83070c83576045f4faca422c1478 (diff) | |
download | rockbox-889b4a8ce838bd4191c736d01d9665c177e6d390.tar.gz rockbox-889b4a8ce838bd4191c736d01d9665c177e6d390.zip |
Two tiny tweaks to some arm asm
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25993 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/lib/fft-ffmpeg_arm.h | 28 | ||||
-rw-r--r-- | apps/codecs/libtremor/mapping0.c | 5 |
2 files changed, 16 insertions, 17 deletions
diff --git a/apps/codecs/lib/fft-ffmpeg_arm.h b/apps/codecs/lib/fft-ffmpeg_arm.h index 94969b4b3d..b1406e760a 100644 --- a/apps/codecs/lib/fft-ffmpeg_arm.h +++ b/apps/codecs/lib/fft-ffmpeg_arm.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: $ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2010 Dave Hooper | 10 | * Copyright (C) 2010 Dave Hooper |
11 | * | 11 | * |
@@ -285,11 +285,10 @@ static inline void fft8( FFTComplex * z ) | |||
285 | { | 285 | { |
286 | FFTSample temp; | 286 | FFTSample temp; |
287 | fixed32 * m4 = (fixed32 *)(&(z[4].re)); | 287 | fixed32 * m4 = (fixed32 *)(&(z[4].re)); |
288 | 288 | ||
289 | asm volatile( | 289 | asm volatile( |
290 | "add %[z_ptr], %[z_ptr], #16\n\t" /* point to &z[2].re */ | ||
291 | /* read in z[4].re thru z[7].im */ | 290 | /* read in z[4].re thru z[7].im */ |
292 | "ldmia %[z4_ptr]!, {r1,r2,r3,r4,r5,r6,r7,r8}\n\t" | 291 | "ldmia %[z4_ptr]!, {r1-r8}\n\t" |
293 | /* (now points one word past &z[7].im) */ | 292 | /* (now points one word past &z[7].im) */ |
294 | "add r1,r1,r3\n\t" | 293 | "add r1,r1,r3\n\t" |
295 | "sub r3,r1,r3,lsl #1\n\t" | 294 | "sub r3,r1,r3,lsl #1\n\t" |
@@ -299,32 +298,31 @@ static inline void fft8( FFTComplex * z ) | |||
299 | "sub r7,r5,r7\n\t" | 298 | "sub r7,r5,r7\n\t" |
300 | "add r5,r6,r8\n\t" | 299 | "add r5,r6,r8\n\t" |
301 | "sub r8,r6,r8\n\t" | 300 | "sub r8,r6,r8\n\t" |
302 | 301 | ||
303 | "stmdb %[z4_ptr]!, {r7,r8}\n\t" /* write z[7].re,z[7].im straight away */ | 302 | "stmdb %[z4_ptr]!, {r7,r8}\n\t" /* write z[7].re,z[7].im straight away */ |
304 | /* Note, registers r7 & r8 now free */ | 303 | /* Note, registers r7 & r8 now free */ |
305 | 304 | ||
306 | "sub r6,%[temp],r1\n\t" | 305 | "sub r6,%[temp],r1\n\t" |
307 | "add r1,%[temp],r1\n\t" | 306 | "add r1,%[temp],r1\n\t" |
308 | "add r2,r2,r5\n\t" | 307 | "add r2,r2,r5\n\t" |
309 | "sub r5,r2,r5,lsl #1\n\t" | 308 | "sub r5,r2,r5,lsl #1\n\t" |
310 | 309 | "add %[temp], %[z_ptr], #16\n\t" /* point to &z[2].re */ | |
311 | "ldmia %[z_ptr],{r7,r8}\n\t" /* load z[2].re and z[2].im */ | 310 | "ldmia %[temp],{r7,r8}\n\t" /* load z[2].re and z[2].im */ |
312 | "add r7,r7,r5\n\t" | 311 | "add r7,r7,r5\n\t" |
313 | "sub r5,r7,r5,lsl #1\n\t" | 312 | "sub r5,r7,r5,lsl #1\n\t" |
314 | "add r8,r8,r6\n\t" | 313 | "add r8,r8,r6\n\t" |
315 | "sub r6,r8,r6,lsl #1\n\t" | 314 | "sub r6,r8,r6,lsl #1\n\t" |
316 | 315 | ||
317 | /* write out z[5].re, z[5].im, z[6].re, z[6].im in one go*/ | 316 | /* write out z[5].re, z[5].im, z[6].re, z[6].im in one go*/ |
318 | "stmdb %[z4_ptr]!, {r3,r4,r5,r6}\n\t" | 317 | "stmdb %[z4_ptr]!, {r3-r6}\n\t" |
319 | "stmia %[z_ptr],{r7,r8}\n\t" /* write out z[2].re, z[2].im */ | 318 | "stmia %[temp],{r7,r8}\n\t" /* write out z[2].re, z[2].im */ |
320 | "sub %[z_ptr],%[z_ptr], #16\n\t" /* point z_ptr back to &z[0].re */ | ||
321 | "ldmia %[z_ptr],{r7,r8}\n\t" /* load r[0].re, r[0].im */ | 319 | "ldmia %[z_ptr],{r7,r8}\n\t" /* load r[0].re, r[0].im */ |
322 | 320 | ||
323 | "add r7,r7,r1\n\t" | 321 | "add r7,r7,r1\n\t" |
324 | "sub r1,r7,r1,lsl #1\n\t" | 322 | "sub r1,r7,r1,lsl #1\n\t" |
325 | "add r8,r8,r2\n\t" | 323 | "add r8,r8,r2\n\t" |
326 | "sub r2,r8,r2,lsl #1\n\t" | 324 | "sub r2,r8,r2,lsl #1\n\t" |
327 | 325 | ||
328 | "stmia %[z_ptr],{r7,r8}\n\t" /* write out z[0].re, z[0].im */ | 326 | "stmia %[z_ptr],{r7,r8}\n\t" /* write out z[0].re, z[0].im */ |
329 | "stmdb %[z4_ptr], {r1,r2}\n\t" /* write out z[4].re, z[4].im */ | 327 | "stmdb %[z4_ptr], {r1,r2}\n\t" /* write out z[4].re, z[4].im */ |
330 | : [z4_ptr] "+r" (m4), [z_ptr] "+r" (z), [temp] "=r" (temp) | 328 | : [z4_ptr] "+r" (m4), [z_ptr] "+r" (z), [temp] "=r" (temp) |
@@ -332,7 +330,7 @@ static inline void fft8( FFTComplex * z ) | |||
332 | : "r1","r2","r3","r4","r5","r6","r7","r8","memory" | 330 | : "r1","r2","r3","r4","r5","r6","r7","r8","memory" |
333 | ); | 331 | ); |
334 | } | 332 | } |
335 | 333 | ||
336 | z++; | 334 | z++; |
337 | TRANSFORM_EQUAL(z,2); | 335 | TRANSFORM_EQUAL(z,2); |
338 | } | 336 | } |
diff --git a/apps/codecs/libtremor/mapping0.c b/apps/codecs/libtremor/mapping0.c index 9a9ec9e74c..c7e7299ccc 100644 --- a/apps/codecs/libtremor/mapping0.c +++ b/apps/codecs/libtremor/mapping0.c | |||
@@ -184,16 +184,17 @@ static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb) | |||
184 | register int temp;\ | 184 | register int temp;\ |
185 | asm( "cmp %[mag], #0\n\t"\ | 185 | asm( "cmp %[mag], #0\n\t"\ |
186 | "cmpgt %[ang], #0\n\t"\ | 186 | "cmpgt %[ang], #0\n\t"\ |
187 | "subgt %[temp], %[mag], %[ang]\n\t"\ | 187 | "subgt %[ang], %[mag], %[ang]\n\t"\ |
188 | "bgt 1f\n\t"\ | 188 | "bgt 1f\n\t"\ |
189 | "cmp %[mag], #0\n\t"\ | 189 | "cmp %[mag], #0\n\t"\ |
190 | "cmple %[ang], #0\n\t"\ | 190 | "cmple %[ang], #0\n\t"\ |
191 | "addgt %[temp], %[mag], %[ang]\n\t"\ | 191 | "addgt %[temp], %[mag], %[ang]\n\t"\ |
192 | "suble %[temp], %[mag], %[ang]\n\t"\ | 192 | "suble %[temp], %[mag], %[ang]\n\t"\ |
193 | "1: cmp %[ang], #0\n\t"\ | 193 | "cmp %[ang], #0\n\t"\ |
194 | "movle %[ang], %[mag]\n\t"\ | 194 | "movle %[ang], %[mag]\n\t"\ |
195 | "movle %[mag], %[temp]\n\t"\ | 195 | "movle %[mag], %[temp]\n\t"\ |
196 | "movgt %[ang], %[temp]\n\t"\ | 196 | "movgt %[ang], %[temp]\n\t"\ |
197 | "1:\n\t"\ | ||
197 | : [mag] "+r" ( ( _mag ) ), [ang] "+r" ( ( _ang ) ), [temp] "=&r" (temp)\ | 198 | : [mag] "+r" ( ( _mag ) ), [ang] "+r" ( ( _ang ) ), [temp] "=&r" (temp)\ |
198 | :\ | 199 | :\ |
199 | : "cc" );\ | 200 | : "cc" );\ |