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

Annotation of OpenXM_contrib/gmp/mpn/arm/invert_limb.asm, Revision 1.1

1.1     ! ohara       1: dnl  ARM mpn_invert_limb -- Invert a normalized limb.
        !             2:
        !             3: dnl  Copyright 2001 Free Software Foundation, Inc.
        !             4:
        !             5: dnl  This file is part of the GNU MP Library.
        !             6:
        !             7: dnl  The GNU MP Library is free software; you can redistribute it and/or modify
        !             8: dnl  it under the terms of the GNU Lesser General Public License as published
        !             9: dnl  by the Free Software Foundation; either version 2.1 of the License, or (at
        !            10: dnl  your option) any later version.
        !            11:
        !            12: dnl  The GNU MP Library is distributed in the hope that it will be useful, but
        !            13: dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
        !            14: dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
        !            15: dnl  License for more details.
        !            16:
        !            17: dnl  You should have received a copy of the GNU Lesser General Public License
        !            18: dnl  along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
        !            19: dnl  the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
        !            20: dnl  MA 02111-1307, USA.
        !            21:
        !            22: include(`../config.m4')
        !            23:
        !            24: C INPUT PARAMETERS
        !            25: define(`d',`r0')       C number to be inverted
        !            26:
        !            27:
        !            28: PROLOGUE(mpn_invert_limb)
        !            29:        stmfd   sp!, {r4, lr}
        !            30:        mov     r3, d, lsr #23
        !            31:        sub     r3, r3, #256
        !            32:        add     r2, pc, #invtab-.-8
        !            33:        mov     r3, r3, lsl #1
        !            34:        ldrh    r1, [r2, r3]            C get initial approximation from table
        !            35:        mov     r2, r1, lsl #6          C start iteration 1
        !            36:        mul     ip, r2, r2
        !            37:        umull   lr, r4, ip, d
        !            38:        mov     r2, r4, lsl #1
        !            39:        rsb     r2, r2, r1, lsl #23     C iteration 1 complete
        !            40:        umull   ip, r3, r2, r2          C start iteration 2
        !            41:        umull   lr, r4, r3, d
        !            42:        umull   r3, r1, ip, d
        !            43:        adds    lr, lr, r1
        !            44:        addcs   r4, r4, #1
        !            45:        mov     r3, lr, lsr #30
        !            46:        orr     r4, r3, r4, lsl #2
        !            47:        mov     lr, lr, lsl #2
        !            48:        cmn     lr, #1
        !            49:        rsc     r2, r4, r2, lsl #2      C iteration 2 complete
        !            50:        umull   ip, r1, d, r2           C start adjustment step
        !            51:        add     r1, r1, d
        !            52:        cmn     r1, #1
        !            53:        beq     L(1)
        !            54:        adds    ip, ip, d
        !            55:        adc     r1, r1, #0
        !            56:        add     r2, r2, #1
        !            57: L(1):
        !            58:        adds    r3, ip, d
        !            59:        adcs    r1, r1, #0
        !            60:        moveq   r0, r2
        !            61:        addne   r0, r2, #1
        !            62:        ldmfd   sp!, {r4, pc}
        !            63:
        !            64: invtab:
        !            65:        .short  1023,1020,1016,1012,1008,1004,1000,996
        !            66:        .short  992,989,985,981,978,974,970,967
        !            67:        .short  963,960,956,953,949,946,942,939
        !            68:        .short  936,932,929,926,923,919,916,913
        !            69:        .short  910,907,903,900,897,894,891,888
        !            70:        .short  885,882,879,876,873,870,868,865
        !            71:        .short  862,859,856,853,851,848,845,842
        !            72:        .short  840,837,834,832,829,826,824,821
        !            73:        .short  819,816,814,811,809,806,804,801
        !            74:        .short  799,796,794,791,789,787,784,782
        !            75:        .short  780,777,775,773,771,768,766,764
        !            76:        .short  762,759,757,755,753,751,748,746
        !            77:        .short  744,742,740,738,736,734,732,730
        !            78:        .short  728,726,724,722,720,718,716,714
        !            79:        .short  712,710,708,706,704,702,700,699
        !            80:        .short  697,695,693,691,689,688,686,684
        !            81:        .short  682,680,679,677,675,673,672,670
        !            82:        .short  668,667,665,663,661,660,658,657
        !            83:        .short  655,653,652,650,648,647,645,644
        !            84:        .short  642,640,639,637,636,634,633,631
        !            85:        .short  630,628,627,625,624,622,621,619
        !            86:        .short  618,616,615,613,612,611,609,608
        !            87:        .short  606,605,604,602,601,599,598,597
        !            88:        .short  595,594,593,591,590,589,587,586
        !            89:        .short  585,583,582,581,579,578,577,576
        !            90:        .short  574,573,572,571,569,568,567,566
        !            91:        .short  564,563,562,561,560,558,557,556
        !            92:        .short  555,554,553,551,550,549,548,547
        !            93:        .short  546,544,543,542,541,540,539,538
        !            94:        .short  537,536,534,533,532,531,530,529
        !            95:        .short  528,527,526,525,524,523,522,521
        !            96:        .short  520,519,518,517,516,515,514,513
        !            97: EPILOGUE(mpn_invert_limb)

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