[BACK]Return to udiv_qrnnd.asm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / pa32 / hppa1_1

Annotation of OpenXM_contrib/gmp/mpn/pa32/hppa1_1/udiv_qrnnd.asm, Revision 1.1.1.1

1.1       ohara       1: dnl  HP-PA  __udiv_qrnnd division support, used from longlong.h.
                      2: dnl  This version runs fast on PA 7000 and later.
                      3:
                      4: dnl  Copyright 1993, 1994, 2000, 2001 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 rem_ptr      gr26
                     27: C n1           gr25
                     28: C n0           gr24
                     29: C d            gr23
                     30:
                     31: C This file has caused a lot of trouble, since it demands PIC reference to
                     32: C static data, which triggers bugs in gas (at least version 2.7 through
                     33: C 2.11.2).  When the bug is triggered, many bogus relocs are generated.  The
                     34: C current solution is to stuff data right into the code, and refer it using
                     35: C absolute offsets.  Fragile to be sure, but nothing else seems to work.
                     36:
                     37: ASM_START()
                     38: ifdef(`PIC',`',
                     39: `      RODATA
                     40:        INT64(L(0000), 0x43f00000, 0x0)         C 2^64
                     41: ')
                     42:
                     43: PROLOGUE(mpn_udiv_qrnnd)
                     44:        .proc
                     45:        .callinfo       frame=64,no_calls
                     46:        .entry
                     47:
                     48:        ldo             64(%r30),%r30
                     49:
                     50:        stws            %r25,-16(0,%r30)        C n_hi
                     51:        stws            %r24,-12(0,%r30)        C n_lo
                     52:
                     53: ifdef(`PIC',
                     54: `      bl              .+20,%r31
                     55:        dep             %r0,31,2,%r31
                     56:        .word   0x0                             C padding for alignment
                     57:        .word   0x43f00000, 0x0                 C 2^64
                     58:        ldo             4(%r31),%r31',
                     59: `      ldil            `L'%L(0000),%r31
                     60:        ldo             R%L(0000)(%r31),%r31')
                     61:
                     62:        fldds           -16(0,%r30),%fr5
                     63:        stws            %r23,-12(0,%r30)
                     64:        comib,<=        0,%r25,L(1)
                     65:        fcnvxf,dbl,dbl  %fr5,%fr5
                     66:        fldds           0(0,%r31),%fr4
                     67:        fadd,dbl        %fr4,%fr5,%fr5
                     68:
                     69:        .label  L(1)
                     70:        fcpy,sgl        %fr0,%fr6L
                     71:        fldws           -12(0,%r30),%fr6R
                     72:        fcnvxf,dbl,dbl  %fr6,%fr4
                     73:
                     74:        fdiv,dbl        %fr5,%fr4,%fr5
                     75:
                     76:        fcnvfx,dbl,dbl  %fr5,%fr4
                     77:        fstws           %fr4R,-16(%r30)
                     78:        xmpyu           %fr4R,%fr6R,%fr6
                     79:        ldws            -16(%r30),%r28
                     80:        fstds           %fr6,-16(0,%r30)
                     81:        ldws            -12(0,%r30),%r21
                     82:        ldws            -16(0,%r30),%r20
                     83:        sub             %r24,%r21,%r22
                     84:        subb            %r25,%r20,%r20
                     85:        comib,=         0,%r20,L(2)
                     86:        ldo             -64(%r30),%r30
                     87:
                     88:        add             %r22,%r23,%r22
                     89:        ldo             -1(%r28),%r28
                     90:
                     91:        .label  L(2)
                     92:        bv              0(%r2)
                     93:        stws            %r22,0(0,%r26)
                     94:        .exit
                     95:        .procend
                     96: EPILOGUE(mpn_udiv_qrnnd)

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