1 //===------- bswapsi2 - Implement bswapsi2 --------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "../assembly.h"
13 // extern uint32_t __bswapsi2(uint32_t);
15 // Reverse all the bytes in a 32-bit integer.
18 DEFINE_COMPILERRT_FUNCTION(__bswapsi2)
19 #if __ARM_ARCH_5TEJ__ || __ARM_ARCH_4T__
20 // before armv6 does not have "rev" instruction
21 eor r1, r0, r0, ror #16
24 eor r0, r1, r0, ror #8