blob: 07cda737bb11f14ed1c873e7e2c5b97c2da2543e [file] [log] [blame]
Kim Phillips017f1612013-11-06 05:15:24 +01001#include <linux/linkage.h>
Russell King6ebbf2c2014-06-30 16:29:12 +01002#include <asm/assembler.h>
Kim Phillips017f1612013-11-06 05:15:24 +01003
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
Russell King6ebbf2c2014-06-30 16:29:12 +010022 ret lr
Kim Phillips017f1612013-11-06 05:15:24 +010023ENDPROC(__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
Russell King6ebbf2c2014-06-30 16:29:12 +010035 ret lr
Kim Phillips017f1612013-11-06 05:15:24 +010036ENDPROC(__bswapdi2)
37#endif