Annotation of OpenXM_contrib/gmp/mpn/alpha/udiv_qrnnd.S, Revision 1.1
1.1 ! maekawa 1: # Alpha 21064 __udiv_qrnnd
! 2:
! 3: # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
! 4:
! 5: # This file is part of the GNU MP Library.
! 6:
! 7: # The GNU MP Library is free software; you can redistribute it and/or modify
! 8: # it under the terms of the GNU Library General Public License as published by
! 9: # the Free Software Foundation; either version 2 of the License, or (at your
! 10: # option) any later version.
! 11:
! 12: # The GNU MP Library is distributed in the hope that it will be useful, but
! 13: # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! 14: # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
! 15: # License for more details.
! 16:
! 17: # You should have received a copy of the GNU Library General Public License
! 18: # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! 19: # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! 20: # MA 02111-1307, USA.
! 21:
! 22:
! 23: .set noreorder
! 24: .set noat
! 25: .text
! 26: .align 3
! 27: .globl __udiv_qrnnd
! 28: .ent __udiv_qrnnd
! 29: __udiv_qrnnd:
! 30: .frame $30,0,$26,0
! 31: .prologue 0
! 32: #define cnt $2
! 33: #define tmp $3
! 34: #define rem_ptr $16
! 35: #define n1 $17
! 36: #define n0 $18
! 37: #define d $19
! 38: #define qb $20
! 39:
! 40: ldiq cnt,16
! 41: blt d,.Largedivisor
! 42:
! 43: .Loop1: cmplt n0,0,tmp
! 44: addq n1,n1,n1
! 45: bis n1,tmp,n1
! 46: addq n0,n0,n0
! 47: cmpule d,n1,qb
! 48: subq n1,d,tmp
! 49: cmovne qb,tmp,n1
! 50: bis n0,qb,n0
! 51: cmplt n0,0,tmp
! 52: addq n1,n1,n1
! 53: bis n1,tmp,n1
! 54: addq n0,n0,n0
! 55: cmpule d,n1,qb
! 56: subq n1,d,tmp
! 57: cmovne qb,tmp,n1
! 58: bis n0,qb,n0
! 59: cmplt n0,0,tmp
! 60: addq n1,n1,n1
! 61: bis n1,tmp,n1
! 62: addq n0,n0,n0
! 63: cmpule d,n1,qb
! 64: subq n1,d,tmp
! 65: cmovne qb,tmp,n1
! 66: bis n0,qb,n0
! 67: cmplt n0,0,tmp
! 68: addq n1,n1,n1
! 69: bis n1,tmp,n1
! 70: addq n0,n0,n0
! 71: cmpule d,n1,qb
! 72: subq n1,d,tmp
! 73: cmovne qb,tmp,n1
! 74: bis n0,qb,n0
! 75: subq cnt,1,cnt
! 76: bgt cnt,.Loop1
! 77: stq n1,0(rem_ptr)
! 78: bis $31,n0,$0
! 79: ret $31,($26),1
! 80:
! 81: .Largedivisor:
! 82: and n0,1,$4
! 83:
! 84: srl n0,1,n0
! 85: sll n1,63,tmp
! 86: or tmp,n0,n0
! 87: srl n1,1,n1
! 88:
! 89: and d,1,$6
! 90: srl d,1,$5
! 91: addq $5,$6,$5
! 92:
! 93: .Loop2: cmplt n0,0,tmp
! 94: addq n1,n1,n1
! 95: bis n1,tmp,n1
! 96: addq n0,n0,n0
! 97: cmpule $5,n1,qb
! 98: subq n1,$5,tmp
! 99: cmovne qb,tmp,n1
! 100: bis n0,qb,n0
! 101: cmplt n0,0,tmp
! 102: addq n1,n1,n1
! 103: bis n1,tmp,n1
! 104: addq n0,n0,n0
! 105: cmpule $5,n1,qb
! 106: subq n1,$5,tmp
! 107: cmovne qb,tmp,n1
! 108: bis n0,qb,n0
! 109: cmplt n0,0,tmp
! 110: addq n1,n1,n1
! 111: bis n1,tmp,n1
! 112: addq n0,n0,n0
! 113: cmpule $5,n1,qb
! 114: subq n1,$5,tmp
! 115: cmovne qb,tmp,n1
! 116: bis n0,qb,n0
! 117: cmplt n0,0,tmp
! 118: addq n1,n1,n1
! 119: bis n1,tmp,n1
! 120: addq n0,n0,n0
! 121: cmpule $5,n1,qb
! 122: subq n1,$5,tmp
! 123: cmovne qb,tmp,n1
! 124: bis n0,qb,n0
! 125: subq cnt,1,cnt
! 126: bgt cnt,.Loop2
! 127:
! 128: addq n1,n1,n1
! 129: addq $4,n1,n1
! 130: bne $6,.LOdd
! 131: stq n1,0(rem_ptr)
! 132: bis $31,n0,$0
! 133: ret $31,($26),1
! 134:
! 135: .LOdd:
! 136: /* q' in n0. r' in n1 */
! 137: addq n1,n0,n1
! 138: cmpult n1,n0,tmp # tmp := carry from addq
! 139: beq tmp,.LLp6
! 140: addq n0,1,n0
! 141: subq n1,d,n1
! 142: .LLp6: cmpult n1,d,tmp
! 143: bne tmp,.LLp7
! 144: addq n0,1,n0
! 145: subq n1,d,n1
! 146: .LLp7:
! 147: stq n1,0(rem_ptr)
! 148: bis $31,n0,$0
! 149: ret $31,($26),1
! 150:
! 151: .end __udiv_qrnnd
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>