diff options
Diffstat (limited to 'compiler-rt/lib/arm/bswapsi2.S')
| -rw-r--r-- | compiler-rt/lib/arm/bswapsi2.S | 18 |
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 |

