rshift.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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, write to
  14. ;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  15. ;! MA 02111-1307, USA.
  16. ;! INPUT PARAMETERS
  17. ;! res_ptr gr26
  18. ;! s_ptr gr25
  19. ;! size gr24
  20. ;! cnt gr23
  21. .text
  22. .export __mpn_rshift
  23. __mpn_rshift:
  24. .proc
  25. .callinfo frame=64,no_calls
  26. .entry
  27. ldws,ma 4(%r25),%r22
  28. mtsar %r23
  29. addib,= -1,%r24,L$0004
  30. vshd %r22,%r0,%r28 ;! compute carry out limb
  31. ldws,ma 4(%r25),%r29
  32. addib,= -1,%r24,L$0002
  33. vshd %r29,%r22,%r20
  34. L$loop: ldws,ma 4(%r25),%r22
  35. stws,ma %r20,4(%r26)
  36. addib,= -1,%r24,L$0003
  37. vshd %r22,%r29,%r20
  38. ldws,ma 4(%r25),%r29
  39. stws,ma %r20,4(%r26)
  40. addib,<> -1,%r24,L$loop
  41. vshd %r29,%r22,%r20
  42. L$0002: stws,ma %r20,4(%r26)
  43. vshd %r0,%r29,%r20
  44. bv 0(%r2)
  45. stw %r20,0(%r26)
  46. L$0003: stws,ma %r20,4(%r26)
  47. L$0004: vshd %r0,%r22,%r20
  48. bv 0(%r2)
  49. stw %r20,0(%r26)
  50. .exit
  51. .procend