lshift.s 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ;! HP-PA __mpn_lshift --
  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_lshift
  23. __mpn_lshift:
  24. .proc
  25. .callinfo frame=64,no_calls
  26. .entry
  27. sh2add %r24,%r25,%r25
  28. sh2add %r24,%r26,%r26
  29. ldws,mb -4(%r25),%r22
  30. subi 32,%r23,%r1
  31. mtsar %r1
  32. addib,= -1,%r24,L$0004
  33. vshd %r0,%r22,%r28 ;! compute carry out limb
  34. ldws,mb -4(%r25),%r29
  35. addib,= -1,%r24,L$0002
  36. vshd %r22,%r29,%r20
  37. L$loop: ldws,mb -4(%r25),%r22
  38. stws,mb %r20,-4(%r26)
  39. addib,= -1,%r24,L$0003
  40. vshd %r29,%r22,%r20
  41. ldws,mb -4(%r25),%r29
  42. stws,mb %r20,-4(%r26)
  43. addib,<> -1,%r24,L$loop
  44. vshd %r22,%r29,%r20
  45. L$0002: stws,mb %r20,-4(%r26)
  46. vshd %r29,%r0,%r20
  47. bv 0(%r2)
  48. stw %r20,-4(%r26)
  49. L$0003: stws,mb %r20,-4(%r26)
  50. L$0004: vshd %r22,%r0,%r20
  51. bv 0(%r2)
  52. stw %r20,-4(%r26)
  53. .exit
  54. .procend