io-writesw.S 644 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. .Lnot_word_aligned:
  9. ld.uh r8, r11++
  10. sub r10, 1
  11. st.h r12[0], r8
  12. .global __raw_writesw
  13. .type __raw_writesw,@function
  14. __raw_writesw:
  15. cp.w r10, 0
  16. mov r9, 3
  17. reteq r12
  18. tst r11, r9
  19. brne .Lnot_word_aligned
  20. sub r10, 2
  21. brlt 2f
  22. 1: ld.w r8, r11++
  23. bfextu r9, r8, 16, 16
  24. st.h r12[0], r9
  25. st.h r12[0], r8
  26. sub r10, 2
  27. brge 1b
  28. 2: sub r10, -2
  29. reteq r12
  30. ld.uh r8, r11++
  31. st.h r12[0], r8
  32. retal r12