rshift.s 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ;! HP-PA __mpn_rshift --
  2. ;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
  3. ;! This file is part of the GNU MP Library.
  4. ;! The GNU MP Library is free software; you can redistribute it and/or modify
  5. ;! it under the terms of the GNU Lesser General Public License as published by
  6. ;! the Free Software Foundation; either version 2.1 of the License, or (at your
  7. ;! option) any later version.
  8. ;! The GNU MP Library is distributed in the hope that it will be useful, but
  9. ;! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. ;! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  11. ;! License for more details.
  12. ;! You should have received a copy of the GNU Lesser General Public License
  13. ;! along with the GNU MP Library; see the file COPYING.LIB. If not, see
  14. ;! <http://www.gnu.org/licenses/>.
  15. ;! INPUT PARAMETERS
  16. ;! res_ptr gr26
  17. ;! s_ptr gr25
  18. ;! size gr24
  19. ;! cnt gr23
  20. .text
  21. .export __mpn_rshift
  22. __mpn_rshift:
  23. .proc
  24. .callinfo frame=64,no_calls
  25. .entry
  26. ldws,ma 4(%r25),%r22
  27. mtsar %r23
  28. addib,= -1,%r24,L$0004
  29. vshd %r22,%r0,%r28 ;! compute carry out limb
  30. ldws,ma 4(%r25),%r29
  31. addib,= -1,%r24,L$0002
  32. vshd %r29,%r22,%r20
  33. L$loop: ldws,ma 4(%r25),%r22
  34. stws,ma %r20,4(%r26)
  35. addib,= -1,%r24,L$0003
  36. vshd %r22,%r29,%r20
  37. ldws,ma 4(%r25),%r29
  38. stws,ma %r20,4(%r26)
  39. addib,<> -1,%r24,L$loop
  40. vshd %r29,%r22,%r20
  41. L$0002: stws,ma %r20,4(%r26)
  42. vshd %r0,%r29,%r20
  43. bv 0(%r2)
  44. stw %r20,0(%r26)
  45. L$0003: stws,ma %r20,4(%r26)
  46. L$0004: vshd %r0,%r22,%r20
  47. bv 0(%r2)
  48. stw %r20,0(%r26)
  49. .exit
  50. .procend