io-writesb.S 808 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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, r11++
  11. sub r10, 1
  12. st.b r12[0], r8
  13. reteq r12
  14. tst r11, r9
  15. brne 1b
  16. /* fall through */
  17. .global __raw_writesb
  18. .type __raw_writesb,@function
  19. __raw_writesb:
  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: ld.w r8, r11++
  28. bfextu r9, r8, 24, 8
  29. st.b r12[0], r9
  30. bfextu r9, r8, 16, 8
  31. st.b r12[0], r9
  32. bfextu r9, r8, 8, 8
  33. st.b r12[0], r9
  34. st.b r12[0], r8
  35. sub r10, 4
  36. brge 1b
  37. 2: sub r10, -4
  38. reteq r12
  39. 3: ld.ub r8, r11++
  40. sub r10, 1
  41. st.b r12[0], r8
  42. brne 3b
  43. retal r12