sub_n.s 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ;! HP-PA __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
  2. ;! store difference 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_sub_n
  26. __mpn_sub_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. sub %r21,%r20,%r28 ;! subtract 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. subb %r21,%r20,%r28
  39. L$end: stws %r28,0(%r26)
  40. addc %r0,%r0,%r28
  41. bv 0(%r2)
  42. subi 1,%r28,%r28
  43. .exit
  44. .procend