sub_n.s 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, 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_sub_n
  27. __mpn_sub_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. sub %r21,%r20,%r28 ;! subtract 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. subb %r21,%r20,%r28
  40. L$end: stws %r28,0(%r26)
  41. addc %r0,%r0,%r28
  42. bv 0(%r2)
  43. subi 1,%r28,%r28
  44. .exit
  45. .procend