Annotation of OpenXM_contrib/gmp/mpn/pa32/hppa2_0/add_n.asm, Revision 1.1
1.1 ! ohara 1: dnl HP-PA 2.0 32-bit mpn_add_n -- Add two limb vectors of the same length > 0
! 2: dnl and store sum in a third limb vector.
! 3:
! 4: dnl Copyright 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
! 5:
! 6: dnl This file is part of the GNU MP Library.
! 7:
! 8: dnl The GNU MP Library is free software; you can redistribute it and/or modify
! 9: dnl it under the terms of the GNU Lesser General Public License as published
! 10: dnl by the Free Software Foundation; either version 2.1 of the License, or (at
! 11: dnl your option) any later version.
! 12:
! 13: dnl The GNU MP Library is distributed in the hope that it will be useful, but
! 14: dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 15: dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
! 16: dnl License for more details.
! 17:
! 18: dnl You should have received a copy of the GNU Lesser General Public License
! 19: dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! 20: dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! 21: dnl MA 02111-1307, USA.
! 22:
! 23: include(`../config.m4')
! 24:
! 25: C INPUT PARAMETERS
! 26: C res_ptr gr26
! 27: C s1_ptr gr25
! 28: C s2_ptr gr24
! 29: C size gr23
! 30:
! 31: C This runs at 2 cycles/limb on PA8000.
! 32:
! 33: ASM_START()
! 34: PROLOGUE(mpn_add_n)
! 35: sub %r0,%r23,%r22
! 36: zdep %r22,30,3,%r28 C r28 = 2 * (-n & 7)
! 37: zdep %r22,29,3,%r22 C r22 = 4 * (-n & 7)
! 38: sub %r25,%r22,%r25 C offset s1_ptr
! 39: sub %r24,%r22,%r24 C offset s2_ptr
! 40: sub %r26,%r22,%r26 C offset res_ptr
! 41: blr %r28,%r0 C branch into loop
! 42: add %r0,%r0,%r0 C reset carry
! 43:
! 44: .label L(loop)
! 45: ldw 0(%r25),%r20
! 46: ldw 0(%r24),%r31
! 47: addc %r20,%r31,%r20
! 48: stw %r20,0(%r26)
! 49:
! 50: .label L(7)
! 51: ldw 4(%r25),%r21
! 52: ldw 4(%r24),%r19
! 53: addc %r21,%r19,%r21
! 54: stw %r21,4(%r26)
! 55:
! 56: .label L(6)
! 57: ldw 8(%r25),%r20
! 58: ldw 8(%r24),%r31
! 59: addc %r20,%r31,%r20
! 60: stw %r20,8(%r26)
! 61:
! 62: .label L(5)
! 63: ldw 12(%r25),%r21
! 64: ldw 12(%r24),%r19
! 65: addc %r21,%r19,%r21
! 66: stw %r21,12(%r26)
! 67:
! 68: .label L(4)
! 69: ldw 16(%r25),%r20
! 70: ldw 16(%r24),%r31
! 71: addc %r20,%r31,%r20
! 72: stw %r20,16(%r26)
! 73:
! 74: .label L(3)
! 75: ldw 20(%r25),%r21
! 76: ldw 20(%r24),%r19
! 77: addc %r21,%r19,%r21
! 78: stw %r21,20(%r26)
! 79:
! 80: .label L(2)
! 81: ldw 24(%r25),%r20
! 82: ldw 24(%r24),%r31
! 83: addc %r20,%r31,%r20
! 84: stw %r20,24(%r26)
! 85:
! 86: .label L(1)
! 87: ldw 28(%r25),%r21
! 88: ldo 32(%r25),%r25
! 89: ldw 28(%r24),%r19
! 90: addc %r21,%r19,%r21
! 91: stw %r21,28(%r26)
! 92: ldo 32(%r24),%r24
! 93: addib,> -8,%r23,L(loop)
! 94: ldo 32(%r26),%r26
! 95:
! 96: bv (%r2)
! 97: addc %r0,%r0,%r28
! 98: EPILOGUE()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>