summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/arm/bswapsi2.S
diff options
context:
space:
mode:
authorStephen Canon <scanon@apple.com>2010-07-03 21:47:50 +0000
committerStephen Canon <scanon@apple.com>2010-07-03 21:47:50 +0000
commit909f6c7bc47cf36ef2c5f8d07b687b614adac7b3 (patch)
tree70c9b5045a963ed09fd745348fb3fd160de52f1b /compiler-rt/lib/arm/bswapsi2.S
parentf02ec12796336cc382338f2a6a70be177397f780 (diff)
downloadbcm5719-llvm-909f6c7bc47cf36ef2c5f8d07b687b614adac7b3.tar.gz
bcm5719-llvm-909f6c7bc47cf36ef2c5f8d07b687b614adac7b3.zip
Further cleanup of ARM bswap implementations, thanks to John Tytgat
llvm-svn: 107576
Diffstat (limited to 'compiler-rt/lib/arm/bswapsi2.S')
-rw-r--r--compiler-rt/lib/arm/bswapsi2.S18
1 files changed, 8 insertions, 10 deletions
diff --git a/compiler-rt/lib/arm/bswapsi2.S b/compiler-rt/lib/arm/bswapsi2.S
index 7e3ab7f48c5..0a0c073706c 100644
--- a/compiler-rt/lib/arm/bswapsi2.S
+++ b/compiler-rt/lib/arm/bswapsi2.S
@@ -14,17 +14,15 @@
//
// Reverse all the bytes in a 32-bit integer.
//
- .align 2
+.align 2
DEFINE_COMPILERRT_FUNCTION(__bswapsi2)
#if __ARM_ARCH_5TEJ__ || __ARM_ARCH_4T__
- // before armv6 does not have "rev" instruction
- mov r1, #0xff00
- and r2, r1, r0, lsr #8
- and r1, r1, r0
- orr r2, r2, r0, lsr #24
- orr r2, r2, r0, lsl #24
- orr r0, r2, r1, lsl #8
+ // before armv6 does not have "rev" instruction
+ eor r1, r0, r0, ror #16
+ bic r1, r1, #0xff0000
+ mov r1, r1, lsr #8
+ eor r0, r1, r0, ror #8
#else
- rev r0, r0 // reverse bytes in parameter and put into result register
+ rev r0, r0
#endif
- bx lr
+ bx lr
OpenPOWER on IntegriCloud