__avr32_asr64.S 560 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (C) 2005-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. /*
  9. * DWtype __avr32_asr64(DWtype u, word_type b)
  10. */
  11. .text
  12. .global __avr32_asr64
  13. .type __avr32_asr64,@function
  14. __avr32_asr64:
  15. cp.w r12, 0
  16. reteq r12
  17. rsub r9, r12, 32
  18. brle 1f
  19. lsl r8, r11, r9
  20. lsr r10, r10, r12
  21. asr r11, r11, r12
  22. or r10, r8
  23. retal r12
  24. 1: neg r9
  25. asr r10, r11, r9
  26. asr r11, 31
  27. retal r12