ashldi3.S 839 B

12345678910111213141516171819202122232425262728293031323334
  1. ! Copyright (C) 2012 by Imagination Technologies Ltd.
  2. !
  3. ! 64-bit arithmetic shift left routine.
  4. !
  5. .text
  6. .global ___ashldi3
  7. .type ___ashldi3,function
  8. ___ashldi3:
  9. MOV D0Re0,D0Ar2
  10. MOV D1Re0,D1Ar1
  11. CMP D1Ar3,#0 ! COUNT == 0
  12. MOVEQ PC,D1RtP ! Yes, return
  13. SUBS D0Ar4,D1Ar3,#32 ! N = COUNT - 32
  14. BGE $L10
  15. !! Shift < 32
  16. NEG D0Ar4,D0Ar4 ! N = - N
  17. LSL D1Re0,D1Re0,D1Ar3 ! HI = HI << COUNT
  18. LSR D0Ar6,D0Re0,D0Ar4 ! TMP= LO >> -(COUNT - 32)
  19. OR D1Re0,D1Re0,D0Ar6 ! HI = HI | TMP
  20. SWAP D0Ar4,D1Ar3
  21. LSL D0Re0,D0Re0,D0Ar4 ! LO = LO << COUNT
  22. MOV PC,D1RtP
  23. $L10:
  24. !! Shift >= 32
  25. LSL D1Re0,D0Re0,D0Ar4 ! HI = LO << N
  26. MOV D0Re0,#0 ! LO = 0
  27. MOV PC,D1RtP
  28. .size ___ashldi3,.-___ashldi3