__ashldi3.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* MN10300 64-bit arithmetic left shift
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #include <asm/cache.h>
  12. .text
  13. .balign L1_CACHE_BYTES
  14. ###############################################################################
  15. #
  16. # unsigned long long __ashldi3(unsigned long long value [D1:D0],
  17. # unsigned by [(12,SP)])
  18. #
  19. ###############################################################################
  20. .globl __ashldi3
  21. .type __ashldi3,@function
  22. __ashldi3:
  23. mov (12,sp),a0
  24. and +63,a0
  25. beq __ashldi3_zero
  26. cmp +31,a0
  27. bhi __ashldi3_32plus
  28. # the count is in the range 1-31
  29. asl a0,d1
  30. mov +32,a1
  31. sub a0,a1,a1 # a1 = 32 - count
  32. lsr a1,d0,a1 # get overflow from LSW -> MSW
  33. or_asl a1,d1,a0,d0 # insert overflow into MSW and
  34. # shift the LSW
  35. rets
  36. .balign L1_CACHE_BYTES
  37. # the count is in the range 32-63
  38. __ashldi3_32plus:
  39. asl a0,d0,d1
  40. clr d0
  41. __ashldi3_zero:
  42. rets
  43. .size __ashldi3, .-__ashldi3