diff options
author | Thom Johansen <thomj@rockbox.org> | 2006-03-17 02:05:39 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2006-03-17 02:05:39 +0000 |
commit | 70ab7fc4e90141064c127e1207ee2f8d501f6356 (patch) | |
tree | cb8044faf820c7012b54a2e4b5e653712e3488ef /firmware | |
parent | 310d191f062094ea2ff82b523f97210d069ad418 (diff) | |
download | rockbox-70ab7fc4e90141064c127e1207ee2f8d501f6356.tar.gz rockbox-70ab7fc4e90141064c127e1207ee2f8d501f6356.zip |
Assembler optimised swap32 for ARM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9072 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/system.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index eb5bb52053..150f87210d 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -463,9 +463,16 @@ static inline unsigned long swap32(unsigned long value) | |||
463 | result[ 7.. 0] = value[31..24]; | 463 | result[ 7.. 0] = value[31..24]; |
464 | */ | 464 | */ |
465 | { | 465 | { |
466 | unsigned long hi = swap16(value >> 16); | 466 | unsigned int tmp; |
467 | unsigned long lo = swap16(value & 0xffff); | 467 | |
468 | return (lo << 16) | hi; | 468 | asm volatile ( |
469 | "eor %1, %0, %0, ror #16 \n\t" | ||
470 | "bic %1, %1, #0xff0000 \n\t" | ||
471 | "mov %0, %0, ror #8 \n\t" | ||
472 | "eor %0, %0, %1, lsr #8 \n\t" | ||
473 | : "+r" (value), "=r" (tmp) | ||
474 | ); | ||
475 | return value; | ||
469 | } | 476 | } |
470 | 477 | ||
471 | 478 | ||