/arch/avr32/lib/io-readsb.S

https://bitbucket.org/thekraven/iscream_thunderc-2.6.35 · Assembly · 49 lines · 32 code · 9 blank · 8 comment · 0 complexity · fcd36b21d4e6f5164766906f5b29803f MD5 · raw file

  1. /*
  2. * Copyright (C) 2004-2006 Atmel Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. .text
  9. .Lnot_word_aligned:
  10. 1: ld.ub r8, r12[0]
  11. sub r10, 1
  12. st.b r11++, r8
  13. reteq r12
  14. tst r11, r9
  15. brne 1b
  16. /* fall through */
  17. .global __raw_readsb
  18. .type __raw_readsb,@function
  19. __raw_readsb:
  20. cp.w r10, 0
  21. mov r9, 3
  22. reteq r12
  23. tst r11, r9
  24. brne .Lnot_word_aligned
  25. sub r10, 4
  26. brlt 2f
  27. 1: ldins.b r8:t, r12[0]
  28. ldins.b r8:u, r12[0]
  29. ldins.b r8:l, r12[0]
  30. ldins.b r8:b, r12[0]
  31. st.w r11++, r8
  32. sub r10, 4
  33. brge 1b
  34. 2: sub r10, -4
  35. reteq r12
  36. 3: ld.ub r8, r12[0]
  37. sub r10, 1
  38. st.b r11++, r8
  39. brne 3b
  40. retal r12