bswapsdi2.S 610 B

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