1#include <linux/linkage.h>
2#include <asm/assembler.h>
3
4#if __LINUX_ARM_ARCH__ >= 6
5ENTRY(__bswapsi2)
6	rev r0, r0
7	bx lr
8ENDPROC(__bswapsi2)
9
10ENTRY(__bswapdi2)
11	rev r3, r0
12	rev r0, r1
13	mov r1, r3
14	bx lr
15ENDPROC(__bswapdi2)
16#else
17ENTRY(__bswapsi2)
18	eor r3, r0, r0, ror #16
19	mov r3, r3, lsr #8
20	bic r3, r3, #0xff00
21	eor r0, r3, r0, ror #8
22	ret lr
23ENDPROC(__bswapsi2)
24
25ENTRY(__bswapdi2)
26	mov ip, r1
27	eor r3, ip, ip, ror #16
28	eor r1, r0, r0, ror #16
29	mov r1, r1, lsr #8
30	mov r3, r3, lsr #8
31	bic r3, r3, #0xff00
32	bic r1, r1, #0xff00
33	eor r1, r1, r0, ror #8
34	eor r0, r3, ip, ror #8
35	ret lr
36ENDPROC(__bswapdi2)
37#endif
38