Annotation of OpenXM_contrib/pari/src/kernel/alpha/level0.s, Revision 1.1.1.1
1.1 maekawa 1: # $Id: level0.s,v 1.1.1.1 1999/09/16 13:47:45 karim Exp $
2: .text
3:
4: .set noreorder
5: .align 3
6: .globl addll
7: .ent addll 0
8: addll:
9: .frame $30,0,$26,0
10: .prologue 0
11: addq $16,$17,$0
12: cmpult $0,$16,$1
13: stq $1,overflow
14: ret $31,($26),1
15: .end addll
16:
17: .set noreorder
18: .align 3
19: .globl addllx
20: .ent addllx 0
21: addllx:
22: ldq $2,overflow
23: addq $16,$17,$0
24: cmpult $0,$16,$16
25: addq $0,$2,$0
26: cmpult $0,$2,$2
27: addq $16,$2,$16
28: stq $16,overflow
29: ret $31,($26),1
30: .end addllx
31:
32:
33: .set noreorder
34: .align 3
35: .globl subll
36: .ent subll 0
37: subll:
38: .frame $30,0,$26,0
39: .prologue 0
40: subq $16,$17,$0
41: cmpult $16,$0,$1
42: stq $1,overflow
43: ret $31,($26),1
44: .end subll
45:
46: .set noreorder
47: .align 3
48: .globl subllx
49: .ent subllx 0
50: subllx:
51: .frame $30,0,$26,0
52: .prologue 0
53: ldq $2,overflow
54: subq $16,$17,$17
55: cmpult $16,$17,$16
56: subq $17,$2,$0
57: cmpult $17,$0,$17
58: addq $16,$17,$16
59: stq $16,overflow
60: ret $31,($26),1
61: .end subllx
62:
63: .set noreorder
64: .align 3
65: .globl shiftl
66: .ent shiftl 0
67: shiftl:
68: .frame $30,0,$26,0
69: .prologue 0
70: subq $31,$17,$1
71: sll $16,$17,$0
72: srl $16,$1,$2
73: stq $2,hiremainder
74: ret $31,($26),1
75: .end shiftl
76:
77: .set noreorder
78: .align 3
79: .globl shiftlr
80: .ent shiftlr 0
81: shiftlr:
82: .frame $30,0,$26,0
83: .prologue 0
84: subq $31,$17,$1
85: srl $16,$17,$0
86: sll $16,$1,$2
87: stq $2,hiremainder
88: ret $31,($26),1
89: .end shiftlr
90:
91: .set noreorder
92: .align 3
93: .globl bfffo
94: .ent bfffo 0
95: bfffo:
96: .frame $30,0,$26,0
97: .prologue 0
98: lda $6,tabshi
99: ldiq $7,60
100: zapnot $16,0xf0,$1
101: beq $1,$32
102: srl $16,32,$16
103: subq $7,32,$7
104: $32: lda $3,-1($31)
105: ldah $3, 1($3)
106: cmpule $16,$3,$2
107: bne $2,$33
108: srl $16,16,$16
109: subq $7,16,$7
110: $33: cmpule $16,0xff,$3
111: bne $3,$34
112: srl $16,8,$16
113: subq $7,8,$7
114: $34: cmpule $16,0xf,$4
115: bne $4,$35
116: srl $16,4,$16
117: subq $7,4,$7
118: $35: s8addq $16,$6,$5
119: ldq $1,0($5)
120: addq $1,$7,$0
121: ret $31,($26),1
122: .end bfffo
123:
124: .set noreorder
125: .align 3
126: .globl mulll
127: .ent mulll 0
128: mulll:
129: .frame $30,0,$26,0
130: .prologue 0
131: umulh $16,$17,$1
132: mulq $16,$17,$0
133: stq $1,hiremainder
134: ret $31,($26),1
135: .end mulll
136:
137: .set noreorder
138: .align 3
139: .globl addmul
140: .ent addmul 0
141: addmul:
142: .frame $30,0,$26,0
143: .prologue 0
144: mulq $16,$17,$2
145: umulh $16,$17,$1
146: ldq $3,hiremainder
147: addq $2,$3,$0
148: cmpult $0,$2,$4
149: addq $1,$4,$5
150: stq $5,hiremainder
151: ret $31,($26),1
152: .end addmul
153:
154: # This program is a modification of a file contained in the gmp-1.9
155: # library, copyright Free Software Foundation, with permission.
156: .globl pari_err
157: .set noreorder
158: .align 3
159: .globl divll
160: .ent divll 0
161: divll:
162: .frame $30,0,$26,0
163: .prologue 0
164:
165: ldq $7,hiremainder
166: ldiq $2,16
167: cmpule $17,$7,$3
168: bne $3,errorhandler
169: blt $17,Largedivisor
170:
171: Loop1: cmplt $16,0,$3
172: addq $7,$7,$7
173: bis $7,$3,$7
174: addq $16,$16,$16
175: cmpule $17,$7,$20
176: subq $7,$17,$3
177: cmovne $20,$3,$7
178: bis $16,$20,$16
179: cmplt $16,0,$3
180: addq $7,$7,$7
181: bis $7,$3,$7
182: addq $16,$16,$16
183: cmpule $17,$7,$20
184: subq $7,$17,$3
185: cmovne $20,$3,$7
186: bis $16,$20,$16
187: cmplt $16,0,$3
188: addq $7,$7,$7
189: bis $7,$3,$7
190: addq $16,$16,$16
191: cmpule $17,$7,$20
192: subq $7,$17,$3
193: cmovne $20,$3,$7
194: bis $16,$20,$16
195: cmplt $16,0,$3
196: addq $7,$7,$7
197: bis $7,$3,$7
198: addq $16,$16,$16
199: cmpule $17,$7,$20
200: subq $7,$17,$3
201: cmovne $20,$3,$7
202: bis $16,$20,$16
203: subq $2,1,$2
204: bgt $2,Loop1
205: stq $7,hiremainder
206: bis $31,$16,$0
207: ret $31,($26),1
208:
209: Largedivisor:
210: and $16,1,$4
211:
212: srl $16,1,$16
213: sll $7,63,$3
214: or $3,$16,$16
215: srl $7,1,$7
216:
217: and $17,1,$6
218: srl $17,1,$5
219: addq $5,$6,$5
220:
221: Loop2: cmplt $16,0,$3
222: addq $7,$7,$7
223: bis $7,$3,$7
224: addq $16,$16,$16
225: cmpule $5,$7,$20
226: subq $7,$5,$3
227: cmovne $20,$3,$7
228: bis $16,$20,$16
229: cmplt $16,0,$3
230: addq $7,$7,$7
231: bis $7,$3,$7
232: addq $16,$16,$16
233: cmpule $5,$7,$20
234: subq $7,$5,$3
235: cmovne $20,$3,$7
236: bis $16,$20,$16
237: cmplt $16,0,$3
238: addq $7,$7,$7
239: bis $7,$3,$7
240: addq $16,$16,$16
241: cmpule $5,$7,$20
242: subq $7,$5,$3
243: cmovne $20,$3,$7
244: bis $16,$20,$16
245: cmplt $16,0,$3
246: addq $7,$7,$7
247: bis $7,$3,$7
248: addq $16,$16,$16
249: cmpule $5,$7,$20
250: subq $7,$5,$3
251: cmovne $20,$3,$7
252: bis $16,$20,$16
253: subq $2,1,$2
254: bgt $2,Loop2
255:
256: addq $7,$7,$7
257: addq $4,$7,$7
258: bne $6,Odd
259: stq $7,hiremainder
260: bis $31,$16,$0
261: ret $31,($26),1
262:
263: Odd:
264: # q' in $16. r' in $7
265: addq $7,$16,$7
266: cmpult $7,$16,$3 # $3 := carry from addq
267: beq $3,LLp6
268: addq $16,1,$16
269: subq $7,$17,$7
270: LLp6: cmpult $7,$17,$3
271: bne $3,LLp7
272: addq $16,1,$16
273: subq $7,$17,$7
274: LLp7:
275: stq $7,hiremainder
276: bis $31,$16,$0
277: ret $31,($26),1
278:
279: errorhandler:
280: ldiq $16,0x2f
281: jmp pari_err
282:
283: .end divll
284:
285: .align 3
286: tabshi: .quad 4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0
287: .globl hiremainder
288: .comm hiremainder,8
289: .globl overflow
290: .comm overflow,8
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>