add_n.S 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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, write to
  15. ;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  16. ;! MA 02111-1307, USA.
  17. ;! INPUT PARAMETERS
  18. ;! res_ptr gr26
  19. ;! s1_ptr gr25
  20. ;! s2_ptr gr24
  21. ;! size gr23
  22. ;! One might want to unroll this as for other processors, but it turns
  23. ;! out that the data cache contention after a store makes such
  24. ;! unrolling useless. We can't come under 5 cycles/limb anyway.
  25. .text
  26. .export __mpn_add_n
  27. __mpn_add_n:
  28. .proc
  29. .callinfo frame=0,no_calls
  30. .entry
  31. ldws,ma 4(%r25),%r21
  32. ldws,ma 4(%r24),%r20
  33. addib,= -1,%r23,L$end ;! check for (SIZE == 1)
  34. add %r21,%r20,%r28 ;! add first limbs ignoring cy
  35. L$loop: ldws,ma 4(%r25),%r21
  36. ldws,ma 4(%r24),%r20
  37. stws,ma %r28,4(%r26)
  38. addib,<> -1,%r23,L$loop
  39. addc %r21,%r20,%r28
  40. L$end: stws %r28,0(%r26)
  41. bv 0(%r2)
  42. addc %r0,%r0,%r28
  43. .exit
  44. .procend