add_n.s 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ;! HP-PA __mpn_add_n -- Add two limb vectors of the same length > 0 and store
  2. ;! sum in a third limb vector.
  3. ;! Copyright (C) 1992, 1994 Free Software Foundation, Inc.
  4. ;! This file is part of the GNU MP Library.
  5. ;! The GNU MP Library is free software; you can redistribute it and/or modify
  6. ;! it under the terms of the GNU Lesser General Public License as published by
  7. ;! the Free Software Foundation; either version 2.1 of the License, or (at your
  8. ;! option) any later version.
  9. ;! The GNU MP Library is distributed in the hope that it will be useful, but
  10. ;! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. ;! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  12. ;! License for more details.
  13. ;! You should have received a copy of the GNU Lesser General Public License
  14. ;! along with the GNU MP Library; see the file COPYING.LIB. If not, see
  15. ;! <http://www.gnu.org/licenses/>.
  16. ;! INPUT PARAMETERS
  17. ;! res_ptr gr26
  18. ;! s1_ptr gr25
  19. ;! s2_ptr gr24
  20. ;! size gr23
  21. ;! One might want to unroll this as for other processors, but it turns
  22. ;! out that the data cache contention after a store makes such
  23. ;! unrolling useless. We can't come under 5 cycles/limb anyway.
  24. .text
  25. .export __mpn_add_n
  26. __mpn_add_n:
  27. .proc
  28. .callinfo frame=0,no_calls
  29. .entry
  30. ldws,ma 4(%r25),%r21
  31. ldws,ma 4(%r24),%r20
  32. addib,= -1,%r23,L$end ;! check for (SIZE == 1)
  33. add %r21,%r20,%r28 ;! add first limbs ignoring cy
  34. L$loop: ldws,ma 4(%r25),%r21
  35. ldws,ma 4(%r24),%r20
  36. stws,ma %r28,4(%r26)
  37. addib,<> -1,%r23,L$loop
  38. addc %r21,%r20,%r28
  39. L$end: stws %r28,0(%r26)
  40. bv 0(%r2)
  41. addc %r0,%r0,%r28
  42. .exit
  43. .procend