Annotation of OpenXM_contrib/pari-2.2/src/kernel/hppa/level0.s, Revision 1.1
1.1 ! noro 1: ; $Id: level0.s,v 1.2 2000/11/03 21:00:25 karim Exp $
! 2: ;
! 3: ; Copyright (C) 2000 The PARI group.
! 4: ;
! 5: ; This file is part of the PARI/GP package.
! 6: ;
! 7: ; PARI/GP is free software; you can redistribute it and/or modify it under the
! 8: ; terms of the GNU General Public License as published by the Free Software
! 9: ; Foundation. It is distributed in the hope that it will be useful, but WITHOUT
! 10: ; ANY WARRANTY WHATSOEVER.
! 11: ;
! 12: ; Check the License for details. You should have received a copy of it, along
! 13: ; with the package; see the file 'COPYING'. If not, write to the Free Software
! 14: ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
! 15:
! 16: ; This file modified by Nigel Smart from the original by Dominique Bernardi.
! 17: ; HP as is needed, with +DA1.1
! 18: .shortdata
! 19: .import $global$ ; The value in the %dp register
! 20: .export hiremainder
! 21: .export overflow
! 22: .word
! 23: .align 8
! 24: hiremainder .word
! 25: .align 8
! 26: overflow .word
! 27:
! 28: .code
! 29: .export addll,entry
! 30: .export addllx,entry
! 31: .export subll,entry
! 32: .export subllx,entry
! 33: .export shiftl,entry
! 34: .export shiftlr,entry
! 35: .export bfffo,entry
! 36: .export mulll,entry
! 37: .export addmul,entry
! 38: .export divll,entry
! 39:
! 40: .proc
! 41: .callinfo
! 42: addll .enter
! 43: add %arg0,%arg1,%ret0
! 44: addc 0,0,%t1
! 45: stw %t1,overflow-$global$(%dp)
! 46: .leave
! 47: .procend
! 48:
! 49: .proc
! 50: .callinfo
! 51: addllx .enter
! 52: ldw overflow-$global$(%dp),%t1
! 53: addb,uv %t1,%arg0,addllx2
! 54: add %arg0,%arg1,%ret0
! 55: addc 0,0,%t1
! 56: stw %t1,overflow-$global$(%dp)
! 57: .leave
! 58: addllx2 ldi 1,%t1
! 59: stw %t1,overflow-$global$(%dp)
! 60: .leave
! 61: .procend
! 62:
! 63: .proc
! 64: .callinfo
! 65: subll .enter
! 66: sub %arg0,%arg1,%ret0
! 67: addc 0,0,%t1
! 68: subi 1,%t1,%t1
! 69: stw %t1,overflow-$global$(%dp)
! 70: .leave
! 71: .procend
! 72:
! 73: .proc
! 74: .callinfo
! 75: subllx .enter
! 76: ldw overflow-$global$(%dp),%t1
! 77: sub,>>= %arg0,%arg1,%ret0
! 78: sub,tr %ret0,%t1,%ret0
! 79: sub,>>= %ret0,%t1,%ret0
! 80: addi,tr 1,0,%t1
! 81: ldi 0,%t1
! 82: stw %t1,overflow-$global$(%dp)
! 83: .leave
! 84: .procend
! 85:
! 86: .proc
! 87: .callinfo
! 88: shiftl .enter
! 89: subi 32,%arg1,%arg1
! 90: l$30 mfctl %cr11,%t1
! 91: mtctl %arg1,%cr11
! 92: vshd %arg0,0,%ret0;
! 93: vshd 0,%arg0,%t2
! 94: mtctl %t1,%cr11
! 95: l$31 stw %t2,hiremainder-$global$(%dp)
! 96: .leave
! 97: .procend
! 98:
! 99: .proc
! 100: .callinfo
! 101: shiftlr .enter
! 102: l$40 mfctl %cr11,%t1
! 103: mtctl %arg1,%cr11
! 104: vshd 0,%arg0,%ret0;
! 105: vshd %arg0,0,%t2
! 106: mtctl %t1,%cr11
! 107: l$41 stw %t2,hiremainder-$global$(%dp)
! 108: .leave
! 109: .procend
! 110:
! 111: .proc
! 112: .callinfo
! 113: bfffo .enter
! 114: comb,=,n %r0,%arg0,l$0
! 115: ldi 31,%ret0
! 116: extru,<> %arg0,15,16,%r0
! 117: shd,tr %arg0,%r0,16,%arg0
! 118: addi -16,%ret0,%ret0
! 119: extru,<> %arg0,7,8,%r0
! 120: shd,tr %arg0,%r0,24,%arg0
! 121: addi -8,%ret0,%ret0
! 122: extru,<> %arg0,3,4,%r0
! 123: shd,tr %arg0,%r0,28,%arg0
! 124: addi -4,%ret0,%ret0
! 125: extru,<> %arg0,1,2,%r0
! 126: shd,tr %arg0,%r0,30,%arg0
! 127: addi -2,%ret0,%ret0
! 128: extru,= %arg0,0,1,%r0
! 129: addi -1,%ret0,%ret0
! 130: b,n l$1
! 131: l$0 ldi 32,%ret0
! 132: l$1 .leave
! 133: .procend
! 134:
! 135: .proc
! 136: .callinfo
! 137: mulll .enter
! 138: ldo hiremainder-$global$(%dp),%r1
! 139: stw %arg0,0(%r1)
! 140: fldws 0(%r1),%fr4
! 141: stw %arg1,0(%r1)
! 142: fldws 0(%r1),%fr5
! 143: xmpyu %fr4,%fr5,%fr6
! 144: fstds %fr6,0(%r1)
! 145: ldws 4(%r1),%ret0
! 146: .leave
! 147: .procend
! 148:
! 149: .proc
! 150: .callinfo
! 151: addmul .enter
! 152: ldo hiremainder-$global$(%dp),%r1
! 153: ldw 0(%r1),%t1
! 154: stw %arg0,0(%r1)
! 155: fldws 0(%r1),%fr4
! 156: stw %arg1,0(%r1)
! 157: fldws 0(%r1),%fr5
! 158: xmpyu %fr4,%fr5,%fr6
! 159: fstds %fr6,0(%r1)
! 160: ldws 4(%r1),%ret0
! 161: add,nuv %t1,%ret0,%ret0
! 162: b,n suite
! 163: .leave
! 164: suite ldw 0(%r1),%ret1
! 165: addi 1,%ret1,%ret1
! 166: stw %ret1,0(%r1)
! 167: .leave
! 168: .procend
! 169:
! 170: hirem .reg %t1
! 171: loquo .reg %ret0
! 172: div .reg %arg1
! 173:
! 174: nibble .macro
! 175: ds hirem,div,hirem
! 176: addc loquo,loquo,loquo
! 177: ds hirem,div,hirem
! 178: addc loquo,loquo,loquo
! 179: ds hirem,div,hirem
! 180: addc loquo,loquo,loquo
! 181: ds hirem,div,hirem
! 182: addc loquo,loquo,loquo
! 183: .endm
! 184:
! 185: divll .proc
! 186: .callinfo
! 187: .enter
! 188: ldw hiremainder-$global$(%dp),hirem
! 189:
! 190: comb,< div,0,l$50
! 191: copy %arg0,loquo
! 192: sub 0,div,%t2
! 193: ds 0,%t2,0
! 194: addc loquo,loquo,loquo
! 195: nibble
! 196: nibble
! 197: nibble
! 198: nibble
! 199: nibble
! 200: nibble
! 201: nibble
! 202: nibble
! 203: add,>= 0,hirem,0
! 204: add hirem,div,hirem
! 205: stw hirem,hiremainder-$global$(%dp)
! 206: .leave
! 207:
! 208: l$50 copy div,%arg0
! 209: extru,<> div,31,1,%t3
! 210: b l$51
! 211: extru div,30,31,div
! 212: addb,nsv %t3,div,l$51
! 213: copy hirem,%t4
! 214: copy loquo,hirem
! 215: b l$52
! 216: copy %t4,loquo
! 217:
! 218: l$51 extru loquo,31,1,%t4
! 219: shd hirem,loquo,1,loquo
! 220: extru hirem,30,31,hirem
! 221: sub 0,div,%t2
! 222: ds 0,%t2,0
! 223: addc loquo,loquo,loquo
! 224: nibble
! 225: nibble
! 226: nibble
! 227: nibble
! 228: nibble
! 229: nibble
! 230: nibble
! 231: nibble
! 232: add,>= 0,hirem,0
! 233: add hirem,div,hirem
! 234: comb,= 0,%t3,l$53
! 235: sh1add hirem,%t4,hirem
! 236: l$52 copy %arg0,div
! 237: addb,nuv,n loquo,hirem,l$54
! 238: sub hirem,div,hirem
! 239: addi 1,loquo,loquo
! 240: l$54 comb,<<,n hirem,div,l$53
! 241: sub hirem,div,hirem
! 242: addi 1,loquo,loquo
! 243:
! 244: l$53 stw hirem,hiremainder-$global$(%dp)
! 245: .leave
! 246: .procend
! 247:
! 248: .end
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>