[BACK]Return to sub_n.asm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / arm

Annotation of OpenXM_contrib/gmp/mpn/arm/sub_n.asm, Revision 1.1.1.1

1.1       ohara       1: dnl  ARM mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
                      2: dnl  store difference in a third limb vector.
                      3: dnl  Contributed by Robert Harley.
                      4:
                      5: dnl  Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
                      6:
                      7: dnl  This file is part of the GNU MP Library.
                      8:
                      9: dnl  The GNU MP Library is free software; you can redistribute it and/or modify
                     10: dnl  it under the terms of the GNU Lesser General Public License as published
                     11: dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
                     12: dnl  your option) any later version.
                     13:
                     14: dnl  The GNU MP Library is distributed in the hope that it will be useful, but
                     15: dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
                     16: dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
                     17: dnl  License for more details.
                     18:
                     19: dnl  You should have received a copy of the GNU Lesser General Public License
                     20: dnl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
                     21: dnl  the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
                     22: dnl  MA 02111-1307, USA.
                     23:
                     24: include(`../config.m4')
                     25:
                     26: C This code runs at 5 cycles/limb.
                     27:
                     28: define(`rp',`r0')
                     29: define(`up',`r1')
                     30: define(`vp',`r2')
                     31: define(`n',`r3')
                     32:
                     33:
                     34: ASM_START()
                     35: PROLOGUE(mpn_sub_n)
                     36:        stmfd   sp!, { r8, r9, lr }
                     37:        subs    r12, r12, r12
                     38:        tst     n, #1
                     39:        beq     L(skip1)
                     40:        ldr     r12, [up], #4
                     41:        ldr     lr, [vp], #4
                     42:        subs    r12, r12, lr
                     43:        str     r12, [rp], #4
                     44: L(skip1):
                     45:        tst     n, #2
                     46:        beq     L(skip2)
                     47:        ldmia   up!, { r8, r9 }
                     48:        ldmia   vp!, { r12, lr }
                     49:        sbcs    r8, r8, r12
                     50:        sbcs    r9, r9, lr
                     51:        stmia   rp!, { r8, r9 }
                     52: L(skip2):
                     53:        bics    n, n, #3
                     54:        beq     L(return)
                     55:        stmfd   sp!, { r4, r5, r6, r7 }
                     56: L(sub_n_loop):
                     57:        ldmia   up!, { r4, r5, r6, r7 }
                     58:        ldmia   vp!, { r8, r9, r12, lr }
                     59:        sbcs    r4, r4, r8
                     60:        ldr     r8, [rp, #12]                   C cache allocate
                     61:        sbcs    r5, r5, r9
                     62:        sbcs    r6, r6, r12
                     63:        sbcs    r7, r7, lr
                     64:        stmia   rp!, { r4, r5, r6, r7 }
                     65:        sub     n, n, #4
                     66:        teq     n, #0
                     67:        bne     L(sub_n_loop)
                     68:        ldmfd   sp!, { r4, r5, r6, r7 }
                     69: L(return):
                     70:        sbc     r0, r0, r0
                     71:        and     r0, r0, #1
                     72:        ldmfd   sp!, { r8, r9, pc }
                     73: EPILOGUE(mpn_sub_n)

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