[BACK]Return to add_n.s CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / hppa / hppa2_0

Annotation of OpenXM_contrib/gmp/mpn/hppa/hppa2_0/add_n.s, Revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>