Annotation of OpenXM_contrib/pari/src/kernel/hppa/level0.s, Revision 1.1
1.1 ! maekawa 1: ; $id: level0.s,v 2.0.0.6 1998/02/21 17:30:11 karim exp karim $
! 2: ; This file modified by Nigel Smart from the original by Dominique Bernardi.
! 3: ; HP as is needed, with +DA1.1
! 4: .shortdata
! 5: .import $global$ ; The value in the %dp register
! 6: .export hiremainder
! 7: .export overflow
! 8: .word
! 9: .align 8
! 10: hiremainder .word
! 11: .align 8
! 12: overflow .word
! 13:
! 14: .code
! 15: .export addll,entry
! 16: .export addllx,entry
! 17: .export subll,entry
! 18: .export subllx,entry
! 19: .export shiftl,entry
! 20: .export shiftlr,entry
! 21: .export bfffo,entry
! 22: .export mulll,entry
! 23: .export addmul,entry
! 24: .export divll,entry
! 25:
! 26: .proc
! 27: .callinfo
! 28: addll .enter
! 29: add %arg0,%arg1,%ret0
! 30: addc 0,0,%t1
! 31: stw %t1,overflow-$global$(%dp)
! 32: .leave
! 33: .procend
! 34:
! 35: .proc
! 36: .callinfo
! 37: addllx .enter
! 38: ldw overflow-$global$(%dp),%t1
! 39: addb,uv %t1,%arg0,addllx2
! 40: add %arg0,%arg1,%ret0
! 41: addc 0,0,%t1
! 42: stw %t1,overflow-$global$(%dp)
! 43: .leave
! 44: addllx2 ldi 1,%t1
! 45: stw %t1,overflow-$global$(%dp)
! 46: .leave
! 47: .procend
! 48:
! 49: .proc
! 50: .callinfo
! 51: subll .enter
! 52: sub %arg0,%arg1,%ret0
! 53: addc 0,0,%t1
! 54: subi 1,%t1,%t1
! 55: stw %t1,overflow-$global$(%dp)
! 56: .leave
! 57: .procend
! 58:
! 59: .proc
! 60: .callinfo
! 61: subllx .enter
! 62: ldw overflow-$global$(%dp),%t1
! 63: sub,>>= %arg0,%arg1,%ret0
! 64: sub,tr %ret0,%t1,%ret0
! 65: sub,>>= %ret0,%t1,%ret0
! 66: addi,tr 1,0,%t1
! 67: ldi 0,%t1
! 68: stw %t1,overflow-$global$(%dp)
! 69: .leave
! 70: .procend
! 71:
! 72: .proc
! 73: .callinfo
! 74: shiftl .enter
! 75: subi 32,%arg1,%arg1
! 76: l$30 mfctl %cr11,%t1
! 77: mtctl %arg1,%cr11
! 78: vshd %arg0,0,%ret0;
! 79: vshd 0,%arg0,%t2
! 80: mtctl %t1,%cr11
! 81: l$31 stw %t2,hiremainder-$global$(%dp)
! 82: .leave
! 83: .procend
! 84:
! 85: .proc
! 86: .callinfo
! 87: shiftlr .enter
! 88: l$40 mfctl %cr11,%t1
! 89: mtctl %arg1,%cr11
! 90: vshd 0,%arg0,%ret0;
! 91: vshd %arg0,0,%t2
! 92: mtctl %t1,%cr11
! 93: l$41 stw %t2,hiremainder-$global$(%dp)
! 94: .leave
! 95: .procend
! 96:
! 97: .proc
! 98: .callinfo
! 99: bfffo .enter
! 100: comb,=,n %r0,%arg0,l$0
! 101: ldi 31,%ret0
! 102: extru,<> %arg0,15,16,%r0
! 103: shd,tr %arg0,%r0,16,%arg0
! 104: addi -16,%ret0,%ret0
! 105: extru,<> %arg0,7,8,%r0
! 106: shd,tr %arg0,%r0,24,%arg0
! 107: addi -8,%ret0,%ret0
! 108: extru,<> %arg0,3,4,%r0
! 109: shd,tr %arg0,%r0,28,%arg0
! 110: addi -4,%ret0,%ret0
! 111: extru,<> %arg0,1,2,%r0
! 112: shd,tr %arg0,%r0,30,%arg0
! 113: addi -2,%ret0,%ret0
! 114: extru,= %arg0,0,1,%r0
! 115: addi -1,%ret0,%ret0
! 116: b,n l$1
! 117: l$0 ldi 32,%ret0
! 118: l$1 .leave
! 119: .procend
! 120:
! 121: .proc
! 122: .callinfo
! 123: mulll .enter
! 124: ldo hiremainder-$global$(%dp),%r1
! 125: stw %arg0,0(%r1)
! 126: fldws 0(%r1),%fr4
! 127: stw %arg1,0(%r1)
! 128: fldws 0(%r1),%fr5
! 129: xmpyu %fr4,%fr5,%fr6
! 130: fstds %fr6,0(%r1)
! 131: ldws 4(%r1),%ret0
! 132: .leave
! 133: .procend
! 134:
! 135: .proc
! 136: .callinfo
! 137: addmul .enter
! 138: ldo hiremainder-$global$(%dp),%r1
! 139: ldw 0(%r1),%t1
! 140: stw %arg0,0(%r1)
! 141: fldws 0(%r1),%fr4
! 142: stw %arg1,0(%r1)
! 143: fldws 0(%r1),%fr5
! 144: xmpyu %fr4,%fr5,%fr6
! 145: fstds %fr6,0(%r1)
! 146: ldws 4(%r1),%ret0
! 147: add,nuv %t1,%ret0,%ret0
! 148: b,n suite
! 149: .leave
! 150: suite ldw 0(%r1),%ret1
! 151: addi 1,%ret1,%ret1
! 152: stw %ret1,0(%r1)
! 153: .leave
! 154: .procend
! 155:
! 156: hirem .reg %t1
! 157: loquo .reg %ret0
! 158: div .reg %arg1
! 159:
! 160: nibble .macro
! 161: ds hirem,div,hirem
! 162: addc loquo,loquo,loquo
! 163: ds hirem,div,hirem
! 164: addc loquo,loquo,loquo
! 165: ds hirem,div,hirem
! 166: addc loquo,loquo,loquo
! 167: ds hirem,div,hirem
! 168: addc loquo,loquo,loquo
! 169: .endm
! 170:
! 171: divll .proc
! 172: .callinfo
! 173: .enter
! 174: ldw hiremainder-$global$(%dp),hirem
! 175:
! 176: comb,< div,0,l$50
! 177: copy %arg0,loquo
! 178: sub 0,div,%t2
! 179: ds 0,%t2,0
! 180: addc loquo,loquo,loquo
! 181: nibble
! 182: nibble
! 183: nibble
! 184: nibble
! 185: nibble
! 186: nibble
! 187: nibble
! 188: nibble
! 189: add,>= 0,hirem,0
! 190: add hirem,div,hirem
! 191: stw hirem,hiremainder-$global$(%dp)
! 192: .leave
! 193:
! 194: l$50 copy div,%arg0
! 195: extru,<> div,31,1,%t3
! 196: b l$51
! 197: extru div,30,31,div
! 198: addb,nsv %t3,div,l$51
! 199: copy hirem,%t4
! 200: copy loquo,hirem
! 201: b l$52
! 202: copy %t4,loquo
! 203:
! 204: l$51 extru loquo,31,1,%t4
! 205: shd hirem,loquo,1,loquo
! 206: extru hirem,30,31,hirem
! 207: sub 0,div,%t2
! 208: ds 0,%t2,0
! 209: addc loquo,loquo,loquo
! 210: nibble
! 211: nibble
! 212: nibble
! 213: nibble
! 214: nibble
! 215: nibble
! 216: nibble
! 217: nibble
! 218: add,>= 0,hirem,0
! 219: add hirem,div,hirem
! 220: comb,= 0,%t3,l$53
! 221: sh1add hirem,%t4,hirem
! 222: l$52 copy %arg0,div
! 223: addb,nuv,n loquo,hirem,l$54
! 224: sub hirem,div,hirem
! 225: addi 1,loquo,loquo
! 226: l$54 comb,<<,n hirem,div,l$53
! 227: sub hirem,div,hirem
! 228: addi 1,loquo,loquo
! 229:
! 230: l$53 stw hirem,hiremainder-$global$(%dp)
! 231: .leave
! 232: .procend
! 233:
! 234: .end
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>