1 | include(lisp.s) |
---|
2 | |
---|
3 | .align 2 |
---|
4 | define([_spentry],[ifdef([__func_name],[_endfn],[]) |
---|
5 | .p2align 3 |
---|
6 | _exportfn(_SP$1) |
---|
7 | ]) |
---|
8 | |
---|
9 | define([_endsubp],[ |
---|
10 | _endfn(_SP$1) |
---|
11 | ]) |
---|
12 | |
---|
13 | define([jump_builtin],[ |
---|
14 | ref_nrs_value(builtin_functions,%fname) |
---|
15 | set_nargs($2) |
---|
16 | vrefr(%fname,%fname,$1) |
---|
17 | jump_fname() |
---|
18 | ]) |
---|
19 | |
---|
20 | _spentry(bad_funcall) |
---|
21 | .globl C(bad_funcall) |
---|
22 | __(tra(C(bad_funcall))) |
---|
23 | __(uuo_error_not_callable) |
---|
24 | _endsubp(bad_funcall) |
---|
25 | |
---|
26 | /* %arg_z has overflowed by one bit. Make a bignum with 1 (32-bit) digit. */ |
---|
27 | _spentry(fix_overflow) |
---|
28 | C(fix_one_bit_overflow): |
---|
29 | __(movl $one_digit_bignum_header,%imm0) |
---|
30 | __(movd %imm0,%mm0) |
---|
31 | __(Misc_Alloc_Fixed([],aligned_bignum_size(1))) |
---|
32 | __(unbox_fixnum(%arg_z,%imm0)) |
---|
33 | __(xor $0xc0000000,%imm0) |
---|
34 | __(mov %temp0,%arg_z) |
---|
35 | __(movl %imm0,misc_data_offset(%arg_z)) |
---|
36 | __(ret) |
---|
37 | _endsubp(fix_overflow) |
---|
38 | |
---|
39 | _spentry(misc_ref) |
---|
40 | __(int $3) |
---|
41 | _endsubp(misc_ref) |
---|
42 | |
---|
43 | _startfn(C(misc_ref_common)) |
---|
44 | __(int $3) |
---|
45 | _endfn(C(misc_ref_common)) |
---|
46 | |
---|
47 | _spentry(subtag_misc_ref) |
---|
48 | __(int $3) |
---|
49 | _endsubp(subtag_misc_ref) |
---|
50 | |
---|
51 | _spentry(subtag_misc_set) |
---|
52 | __(int $3) |
---|
53 | _endsubp(subtag_misc_set) |
---|
54 | |
---|
55 | _spentry(misc_set) |
---|
56 | __(int $3) |
---|
57 | _endsubp(misc_set) |
---|
58 | |
---|
59 | _startfn(C(misc_set_common)) |
---|
60 | __(ret) |
---|
61 | _endfn(C(misc_set_common)) |
---|
62 | |
---|
63 | _spentry(Fret1valn) |
---|
64 | .globl C(ret1valn) |
---|
65 | __(tra(C(ret1valn))) |
---|
66 | __(mov (%esp),%ra0) |
---|
67 | __(mov %arg_z,(%esp)) |
---|
68 | __(set_nargs(1)) |
---|
69 | __(jmp *%ra0) |
---|
70 | _endsubp(Fret1valn) |
---|
71 | |
---|
72 | _spentry(nvalret) |
---|
73 | .globl C(nvalret) |
---|
74 | C(nvalret): |
---|
75 | __(leave) |
---|
76 | __(ret) |
---|
77 | _endsubp(nvalret) |
---|
78 | |
---|
79 | _spentry(jmpsym) |
---|
80 | __(jump_fname()) |
---|
81 | _endsubp(jmpsym) |
---|
82 | |
---|
83 | _spentry(jmpnfn) |
---|
84 | __(mov %temp0,%fn) |
---|
85 | __(jmp *%fn) |
---|
86 | _endsubp(jmpnfn) |
---|
87 | |
---|
88 | _spentry(funcall) |
---|
89 | __(do_funcall()) |
---|
90 | _endsubp(funcall) |
---|
91 | |
---|
92 | /* Make a lisp integer (fixnum or one-digit bignum) from the value in %imm0 */ |
---|
93 | /* This is slightly icky because we have only 1 immediate register */ |
---|
94 | _spentry(makes32) |
---|
95 | __(movd %imm0,%mm1) |
---|
96 | __(shll $fixnumshift, %imm0) |
---|
97 | __(movl %imm0,%arg_z) |
---|
98 | __(movd %mm1,%imm0) |
---|
99 | __(sarl $24,%imm0) |
---|
100 | __(movb %al,%ah) |
---|
101 | __(shlb $fixnumshift,%al) |
---|
102 | __(sarb $fixnumshift,%al) |
---|
103 | __(cmpb %al,%ah) /* high bits just sign? */ |
---|
104 | __(je,pt 0f) /* yes, value fits in a fixnum */ |
---|
105 | __(movl $one_digit_bignum_header,%imm0) |
---|
106 | __(movd %imm0,%mm0) |
---|
107 | __(Misc_Alloc_Fixed(%arg_z,aligned_bignum_size(1))) |
---|
108 | __(movd %mm1,misc_data_offset(%arg_z)) |
---|
109 | 0: __(repret) |
---|
110 | _endsubp(makes32) |
---|
111 | |
---|
112 | _spentry(makes64) |
---|
113 | __(int $3) |
---|
114 | _endsubp(makes64) |
---|
115 | |
---|
116 | /* xxx make lisp integer out of mm0 */ |
---|
117 | /* Make a lisp integer (probably a bignum) out of the %edx:%eax pair. */ |
---|
118 | /* We assume that the node_regs_mask in the TCR has been set to mark */ |
---|
119 | /* %edx an immediate register. */ |
---|
120 | _startfn(C(makes64)) |
---|
121 | __(movd %eax,%mm1) |
---|
122 | __(sarl $31,%eax) |
---|
123 | __(cmpl %eax,%edx) /* upper bits just sign extension? */ |
---|
124 | __(movd %mm1,%eax) |
---|
125 | __(je _SPmakes32) /* yes, make a 32 bit integer */ |
---|
126 | __(movl $two_digit_bignum_header,%eax) |
---|
127 | __(movd %eax,%mm0) |
---|
128 | __(Misc_Alloc_Fixed(%arg_z,aligned_bignum_size(2))) |
---|
129 | __(movd %mm1,misc_data_offset(%arg_z)) |
---|
130 | __(movl %edx,misc_data_offset+4(%arg_z)) |
---|
131 | __(ret) |
---|
132 | _endfn |
---|
133 | |
---|
134 | |
---|
135 | _spentry(syscall) |
---|
136 | /* Save lisp registers */ |
---|
137 | __(push %ebp) |
---|
138 | __(movl %esp,%ebp) |
---|
139 | __(push %temp0) |
---|
140 | __(push %temp1) |
---|
141 | __(push %arg_y) |
---|
142 | __(push %arg_z) |
---|
143 | __(push %fn) |
---|
144 | __(movl %esp,%rcontext:tcr.save_vsp) |
---|
145 | __(movl %ebp,%rcontext:tcr.save_ebp) |
---|
146 | __(movl $TCR_STATE_FOREIGN,%rcontext:tcr.valence) |
---|
147 | __(movl %rcontext:tcr.foreign_sp,%esp) |
---|
148 | __(emms) |
---|
149 | __(movl (%esp),%ebp) |
---|
150 | __(addl $2*node_size,%esp) |
---|
151 | __(unbox_fixnum(%arg_z,%eax)) |
---|
152 | /* push syscall args on stack */ |
---|
153 | __(int $0x80) |
---|
154 | __(movl %ebp,%esp) |
---|
155 | __(movl %esp,%rcontext:tcr.foreign_sp) |
---|
156 | __(zero_node_regs) |
---|
157 | __(pxor %fpzero,%fpzero) |
---|
158 | __(movl %rcontext:tcr.save_vsp,%esp) |
---|
159 | __(movl %rcontext:tcr.save_ebp,%ebp) |
---|
160 | __(movl $TCR_STATE_LISP,%rcontext:tcr.valence) |
---|
161 | __(pop %fn) |
---|
162 | __(pop %arg_z) |
---|
163 | __(pop %arg_y) |
---|
164 | __(pop %temp1) |
---|
165 | __(check_pending_interrupt(%temp0)) |
---|
166 | __(push %temp0) |
---|
167 | __(leave) |
---|
168 | __(ret) |
---|
169 | _endsubp(syscall) |
---|
170 | |
---|
171 | _spentry(mkcatch1v) |
---|
172 | __(nMake_Catch(0)) |
---|
173 | __(ret) |
---|
174 | _endsubp(mkcatch1v) |
---|
175 | |
---|
176 | _spentry(mkunwind) |
---|
177 | __(int $3) |
---|
178 | _endsubp(mkunwind) |
---|
179 | |
---|
180 | /* this takes a return address in %ra0; it's "new" in that it does the */ |
---|
181 | /* double binding of *interrupt-level* out-of-line */ |
---|
182 | _spentry(nmkunwind) |
---|
183 | __(int $3) |
---|
184 | _endsubp(nmkunwind) |
---|
185 | |
---|
186 | _spentry(mkcatchmv) |
---|
187 | __(int $3) |
---|
188 | _endsubp(mkcatchmv) |
---|
189 | |
---|
190 | _spentry(throw) |
---|
191 | __(int $3) |
---|
192 | _endsubp(throw) |
---|
193 | |
---|
194 | /* This takes N multiple values atop the vstack. */ |
---|
195 | _spentry(nthrowvalues) |
---|
196 | __(int $3) |
---|
197 | _endsubp(nthrowvalues) |
---|
198 | |
---|
199 | /* This is a (slight) optimization. When running an unwind-protect, */ |
---|
200 | /* save the single value and the throw count in the tstack frame. */ |
---|
201 | /* Note that this takes a single value in arg_z. */ |
---|
202 | |
---|
203 | _spentry(nthrow1value) |
---|
204 | __(int $3) |
---|
205 | _endsubp(nthrow1value) |
---|
206 | |
---|
207 | /* This never affects the symbol's vcell */ |
---|
208 | /* Non-null symbol in arg_y, new value in arg_z */ |
---|
209 | |
---|
210 | _spentry(bind) |
---|
211 | __(int $3) |
---|
212 | _endsubp(bind) |
---|
213 | |
---|
214 | /* arg_z = symbol: bind it to its current value */ |
---|
215 | |
---|
216 | _spentry(bind_self) |
---|
217 | __(int $3) |
---|
218 | _endsubp(bind_self) |
---|
219 | |
---|
220 | _spentry(bind_nil) |
---|
221 | __(int $3) |
---|
222 | _endsubp(bind_nil) |
---|
223 | |
---|
224 | _spentry(bind_self_boundp_check) |
---|
225 | __(int $3) |
---|
226 | _endsubp(bind_self_boundp_check) |
---|
227 | |
---|
228 | _spentry(conslist) |
---|
229 | __(int $3) |
---|
230 | _endsubp(conslist) |
---|
231 | |
---|
232 | /* do list*: last arg in arg_z, all others pushed, nargs set to #args pushed. */ |
---|
233 | /* Cons, one cons cell at at time. Maybe optimize this later. */ |
---|
234 | |
---|
235 | _spentry(conslist_star) |
---|
236 | __(int $3) |
---|
237 | _endsubp(conslist_star) |
---|
238 | |
---|
239 | /* We always have to create a tsp frame (even if nargs is 0), so the compiler */ |
---|
240 | /* doesn't get confused. */ |
---|
241 | _spentry(stkconslist) |
---|
242 | __(int $3) |
---|
243 | _endsubp(stkconslist) |
---|
244 | |
---|
245 | /* do list*: last arg in arg_z, all others vpushed, */ |
---|
246 | /* nargs set to #args vpushed. */ |
---|
247 | |
---|
248 | _spentry(stkconslist_star) |
---|
249 | __(int $3) |
---|
250 | _endsubp(stkconslist_star) |
---|
251 | |
---|
252 | |
---|
253 | /* Make a stack-consed simple-vector out of the NARGS objects */ |
---|
254 | /* on top of the vstack; return it in arg_z. */ |
---|
255 | |
---|
256 | _spentry(mkstackv) |
---|
257 | __(int $3) |
---|
258 | _endsubp(mkstackv) |
---|
259 | |
---|
260 | .globl C(egc_write_barrier_start) |
---|
261 | C(egc_write_barrier_start): |
---|
262 | /* */ |
---|
263 | /* The function pc_luser_xp() - which is used to ensure that suspended threads */ |
---|
264 | /* are suspended in a GC-safe way - has to treat these subprims (which implement */ |
---|
265 | /* the EGC write-barrier) specially. Specifically, a store that might introduce */ |
---|
266 | /* an intergenerational reference (a young pointer stored in an old object) has */ |
---|
267 | /* to "memoize" that reference by setting a bit in the global "refbits" bitmap. */ |
---|
268 | /* This has to happen atomically, and has to happen atomically wrt GC. */ |
---|
269 | |
---|
270 | /* Note that updating a word in a bitmap is itself not atomic, unless we use */ |
---|
271 | /* interlocked loads and stores. */ |
---|
272 | |
---|
273 | /* For RPLACA and RPLACD, things are fairly simple: regardless of where we are */ |
---|
274 | /* in the function, we can do the store (even if it's already been done) and */ |
---|
275 | /* calculate whether or not we need to set the bit out-of-line. (Actually */ |
---|
276 | /* setting the bit needs to be done atomically, unless we're sure that other */ |
---|
277 | /* threads are suspended.) */ |
---|
278 | /* We can unconditionally set the suspended thread's RIP to the return address. */ |
---|
279 | |
---|
280 | _spentry(rplaca) |
---|
281 | .globl C(egc_rplaca) |
---|
282 | C(egc_rplaca): |
---|
283 | __(int $3) |
---|
284 | _endsubp(rplaca) |
---|
285 | |
---|
286 | _spentry(rplacd) |
---|
287 | .globl C(egc_rplacd) |
---|
288 | C(egc_rplacd): |
---|
289 | __(int $3) |
---|
290 | _endsubp(rplacd) |
---|
291 | |
---|
292 | /* args (src, unscaled-idx, val) in temp0, arg_y, arg_z */ |
---|
293 | _spentry(gvset) |
---|
294 | .globl C(egc_gvset) |
---|
295 | C(egc_gvset): |
---|
296 | __(int $3) |
---|
297 | _endsubp(gvset) |
---|
298 | |
---|
299 | _spentry(set_hash_key) |
---|
300 | .globl C(egc_set_hash_key) |
---|
301 | C(egc_set_hash_key): |
---|
302 | __(int $3) |
---|
303 | _endsubp(set_hash_key) |
---|
304 | |
---|
305 | /* This is a little trickier: if this is interrupted, we need to know */ |
---|
306 | /* whether or not the STORE-CONDITIONAL (cmpxchgq) has won or not. */ |
---|
307 | /* If we're interrupted before the PC has reached the "success_test" label, */ |
---|
308 | /* repeat (luser the PC back to .SPstore_node_conditional.) If we're at that */ |
---|
309 | /* label with the Z flag set, we won and (may) need to memoize. */ |
---|
310 | |
---|
311 | _spentry(store_node_conditional) |
---|
312 | .globl C(egc_store_node_conditional) |
---|
313 | C(egc_store_node_conditional): |
---|
314 | .globl C(egc_store_node_conditional_success_test) |
---|
315 | C(egc_store_node_conditional_success_test): |
---|
316 | .globl C(egc_write_barrier_end) |
---|
317 | C(egc_write_barrier_end): |
---|
318 | __(int $3) |
---|
319 | _endsubp(store_node_conditional) |
---|
320 | |
---|
321 | _spentry(setqsym) |
---|
322 | __(bt $sym_vbit_const,symbol.flags(%arg_y)) |
---|
323 | __(jae _SPspecset) |
---|
324 | __(mov %arg_y,%arg_z) |
---|
325 | __(mov $XCONST,%arg_y) |
---|
326 | __(set_nargs(2)) |
---|
327 | __(jmp _SPksignalerr) |
---|
328 | _endsubp(setqsym) |
---|
329 | |
---|
330 | _spentry(progvsave) |
---|
331 | __(int $3) |
---|
332 | _endsubp(progvsave) |
---|
333 | |
---|
334 | /* Allocate node objects on the temp stack, immediate objects on the foreign */ |
---|
335 | /* stack. (The caller has to know which stack to discard a frame from.) */ |
---|
336 | /* %arg_y = boxed element-count, %arg_z = boxed subtype */ |
---|
337 | |
---|
338 | _spentry(stack_misc_alloc) |
---|
339 | __(int $3) |
---|
340 | _endsubp(stack_misc_alloc) |
---|
341 | |
---|
342 | /* subtype (boxed, of course) is pushed, followed by nargs bytes worth of */ |
---|
343 | /* initial-contents. Note that this can be used to cons any type of initialized */ |
---|
344 | /* node-header'ed misc object (symbols, closures, ...) as well as vector-like */ |
---|
345 | /* objects. */ |
---|
346 | _spentry(gvector) |
---|
347 | __(int $3) |
---|
348 | _endsubp(gvector) |
---|
349 | |
---|
350 | _spentry(mvpass) |
---|
351 | __(int $3) |
---|
352 | _endsubp(mvpass) |
---|
353 | |
---|
354 | _spentry(nthvalue) |
---|
355 | __(int $3) |
---|
356 | _endsubp(nthvalue) |
---|
357 | |
---|
358 | _spentry(values) |
---|
359 | __(int $3) |
---|
360 | _endsubp(values) |
---|
361 | |
---|
362 | _spentry(default_optional_args) |
---|
363 | __(int $3) |
---|
364 | _endsubp(default_optional_args) |
---|
365 | |
---|
366 | _spentry(opt_supplied_p) |
---|
367 | __(int $3) |
---|
368 | _endsubp(opt_supplied_p) |
---|
369 | |
---|
370 | _spentry(lexpr_entry) |
---|
371 | __(int $3) |
---|
372 | _endsubp(lexpr_entry) |
---|
373 | |
---|
374 | _spentry(heap_rest_arg) |
---|
375 | __(int $3) |
---|
376 | _endsubp(heap_rest_arg) |
---|
377 | |
---|
378 | /* %imm0 contains the number of fixed args ; make an &rest arg out of the others */ |
---|
379 | _spentry(req_heap_rest_arg) |
---|
380 | __(int $3) |
---|
381 | _endsubp(req_heap_rest_arg) |
---|
382 | |
---|
383 | /* %imm0 bytes of stuff has already been pushed */ |
---|
384 | /* make an &rest arg out of any others */ |
---|
385 | _spentry(heap_cons_rest_arg) |
---|
386 | __(int $3) |
---|
387 | _endsubp(heap_cons_rest_arg) |
---|
388 | |
---|
389 | _spentry(simple_keywords) |
---|
390 | __(xor %imm0,%imm0) |
---|
391 | __(push_argregs()) |
---|
392 | __(jmp _SPkeyword_bind) |
---|
393 | _endsubp(simple_keywords) |
---|
394 | |
---|
395 | _spentry(keyword_args) |
---|
396 | __(push_argregs()) |
---|
397 | __(jmp _SPkeyword_bind) |
---|
398 | _endsubp(keyword_args) |
---|
399 | |
---|
400 | /* There are %nargs words of arguments on the stack; %imm0 contains the number */ |
---|
401 | /* of non-keyword args pushed. It's possible that we never actually got */ |
---|
402 | /* any keyword args, which would make things much simpler. */ |
---|
403 | |
---|
404 | /* On entry, temp1 contains a fixnum with bits indicating whether */ |
---|
405 | /* &allow-other-keys and/or &rest was present in the lambda list. */ |
---|
406 | /* Once we get here, we can use the arg registers. */ |
---|
407 | |
---|
408 | define([keyword_flags_aok_bit],[fixnumshift]) |
---|
409 | define([keyword_flags_unknown_keys_bit],[fixnumshift+1]) |
---|
410 | define([keyword_flags_rest_bit],[fixnumshift+2]) |
---|
411 | define([keyword_flags_seen_aok_bit],[fixnumshift+3]) |
---|
412 | |
---|
413 | _spentry(keyword_bind) |
---|
414 | __(int $3) |
---|
415 | _endsubp(keyword_bind) |
---|
416 | |
---|
417 | _spentry(ksignalerr) |
---|
418 | __(mov $nrs.errdisp,%fname) |
---|
419 | __(jump_fname) |
---|
420 | _endsubp(ksignalerr) |
---|
421 | |
---|
422 | _spentry(stack_rest_arg) |
---|
423 | __(xorl %imm0,%imm0) |
---|
424 | __(push_argregs()) |
---|
425 | __(jmp _SPstack_cons_rest_arg) |
---|
426 | _endsubp(stack_rest_arg) |
---|
427 | |
---|
428 | _spentry(req_stack_rest_arg) |
---|
429 | __(push_argregs()) |
---|
430 | __(jmp _SPstack_cons_rest_arg) |
---|
431 | _endsubp(req_stack_rest_arg) |
---|
432 | |
---|
433 | _spentry(stack_cons_rest_arg) |
---|
434 | _endsubp(stack_cons_rest_arg) |
---|
435 | |
---|
436 | _spentry(getxlong) |
---|
437 | __(int $3) |
---|
438 | _endsubp(getxlong) |
---|
439 | |
---|
440 | /* Have to be a little careful here: the caller may or may not have pushed */ |
---|
441 | /* an empty frame, and we may or may not have needed one. We can't easily */ |
---|
442 | /* tell whether or not a frame will be needed (if the caller didn't reserve */ |
---|
443 | /* a frame, whether or not we need one depends on the length of the list */ |
---|
444 | /* in arg_z. So, if the caller didn't push a frame, we do so ; once everything's */ |
---|
445 | /* been spread, we discard the reserved frame (regardless of who pushed it) */ |
---|
446 | /* if all args fit in registers. */ |
---|
447 | _spentry(spreadargz) |
---|
448 | __(int $3) |
---|
449 | _endsubp(spreadargz) |
---|
450 | |
---|
451 | |
---|
452 | /* Caller built it's own frame when it was entered. If all outgoing args */ |
---|
453 | /* are in registers, we can discard that frame; otherwise, we copy outgoing */ |
---|
454 | /* relative to it and restore %rbp/%ra0 */ |
---|
455 | _spentry(tfuncallgen) |
---|
456 | __(int $3) |
---|
457 | _endsubp(tfuncallgen) |
---|
458 | |
---|
459 | /* Some args were pushed; move them down in the frame */ |
---|
460 | _spentry(tfuncallslide) |
---|
461 | __(int $3) |
---|
462 | _endsubp(tfuncallslide) |
---|
463 | |
---|
464 | /* No args were pushed; recover saved context & do funcall */ |
---|
465 | _spentry(tfuncallvsp) |
---|
466 | __(leave) |
---|
467 | __(do_funcall()) |
---|
468 | _endsubp(tfuncallvsp) |
---|
469 | |
---|
470 | _spentry(tcallsymgen) |
---|
471 | __(int $3) |
---|
472 | _endsubp(tcallsymgen) |
---|
473 | |
---|
474 | _spentry(tcallsymslide) |
---|
475 | __(int $3) |
---|
476 | _endsubp(tcallsymslide) |
---|
477 | |
---|
478 | _spentry(tcallsymvsp) |
---|
479 | __(leave) |
---|
480 | __(jump_fname()) |
---|
481 | _endsubp(tcallsymvsp) |
---|
482 | |
---|
483 | _spentry(tcallnfngen) |
---|
484 | __(int $3) |
---|
485 | _endsubp(tcallnfngen) |
---|
486 | |
---|
487 | _spentry(tcallnfnslide) |
---|
488 | __(int $3) |
---|
489 | _endsubp(tcallnfnslide) |
---|
490 | |
---|
491 | _spentry(tcallnfnvsp) |
---|
492 | __(mov %temp0,%fn) |
---|
493 | __(leave) |
---|
494 | __(jmp *%fn) |
---|
495 | _endsubp(tcallnfnvsp) |
---|
496 | |
---|
497 | _spentry(makestackblock) |
---|
498 | __(int $3) |
---|
499 | _endsubp(makestackblock) |
---|
500 | |
---|
501 | _spentry(makestackblock0) |
---|
502 | __(int $3) |
---|
503 | _endsubp(makestackblock0) |
---|
504 | |
---|
505 | _spentry(makestacklist) |
---|
506 | __(int $3) |
---|
507 | _endsubp(makestacklist) |
---|
508 | |
---|
509 | _spentry(stkgvector) |
---|
510 | __(int $3) |
---|
511 | _endsubp(stkgvector) |
---|
512 | |
---|
513 | _spentry(misc_alloc) |
---|
514 | __(int $3) |
---|
515 | _endsubp(misc_alloc) |
---|
516 | |
---|
517 | _startfn(C(destbind1)) |
---|
518 | __(jmp *%ra0) |
---|
519 | _endfn(C(destbind1)) |
---|
520 | |
---|
521 | _spentry(macro_bind) |
---|
522 | __(int $3) |
---|
523 | _endsubp(macro_bind) |
---|
524 | |
---|
525 | _spentry(destructuring_bind) |
---|
526 | __(mov %arg_reg,%whole_reg) |
---|
527 | __(jmp C(destbind1)) |
---|
528 | _endsubp(destructuring_bind) |
---|
529 | |
---|
530 | _spentry(destructuring_bind_inner) |
---|
531 | __(mov %arg_z,%whole_reg) |
---|
532 | __(jmp C(destbind1)) |
---|
533 | _endsubp(destructuring_bind_inner) |
---|
534 | |
---|
535 | _spentry(vpopargregs) |
---|
536 | __(int $3) |
---|
537 | _endsubp(vpopargregs) |
---|
538 | |
---|
539 | /* If arg_z is an integer, return in imm0 something whose sign */ |
---|
540 | /* is the same as arg_z's. If not an integer, error. */ |
---|
541 | _spentry(integer_sign) |
---|
542 | __(testb $tagmask,%arg_z_b) |
---|
543 | __(mov %arg_z,%imm0) |
---|
544 | __(je 8f) |
---|
545 | __(extract_typecode(%arg_z,%imm0)) |
---|
546 | __(cmpb $subtag_bignum,%imm0_b) |
---|
547 | __(jne 9f) |
---|
548 | __(getvheader(%arg_z,%imm0)) |
---|
549 | __(shr $num_subtag_bits,%imm0) |
---|
550 | __(movl misc_data_offset-4(%arg_z,%imm0,4),%imm0) |
---|
551 | 8: __(repret) |
---|
552 | 9: __(uuo_error_reg_not_type(Rarg_z,error_object_not_integer)) |
---|
553 | _endsubp(integer_sign) |
---|
554 | |
---|
555 | _spentry(mvslide) |
---|
556 | __(int $3) |
---|
557 | _endsubp(mvslide) |
---|
558 | |
---|
559 | _spentry(save_values) |
---|
560 | __(int $3) |
---|
561 | _endsubp(save_values) |
---|
562 | |
---|
563 | _spentry(add_values) |
---|
564 | __(int $3) |
---|
565 | _endsubp(add_values) |
---|
566 | |
---|
567 | _spentry(recover_values) |
---|
568 | __(int $3) |
---|
569 | _endsubp(recover_values) |
---|
570 | |
---|
571 | _spentry(recover_values_for_mvcall) |
---|
572 | __(int $3) |
---|
573 | _endsubp(recover_values_for_mvcall) |
---|
574 | |
---|
575 | _spentry(reset) |
---|
576 | __(int $3) |
---|
577 | _endsubp(reset) |
---|
578 | |
---|
579 | _spentry(misc_alloc_init) |
---|
580 | __(int $3) |
---|
581 | _endsubp(misc_alloc_init) |
---|
582 | |
---|
583 | _spentry(stack_misc_alloc_init) |
---|
584 | __(int $3) |
---|
585 | _endsubp(stack_misc_alloc_init) |
---|
586 | |
---|
587 | .globl C(popj) |
---|
588 | _spentry(popj) |
---|
589 | C(popj): |
---|
590 | __(leave) |
---|
591 | __(ret) |
---|
592 | _endsubp(popj) |
---|
593 | |
---|
594 | |
---|
595 | _spentry(gets64) |
---|
596 | __(int $3) |
---|
597 | _endsubp(gets64) |
---|
598 | |
---|
599 | |
---|
600 | /* arg_z should be of type (unsigned-byte 64) */ |
---|
601 | /* return unboxed value in mm0 */ |
---|
602 | _spentry(getu64) |
---|
603 | __(movl $~(target_most_positive_fixnum << fixnumshift),%imm0) |
---|
604 | __(testl %arg_z,%imm0) |
---|
605 | __(movl %arg_z,%imm0) |
---|
606 | __(jne 1f) |
---|
607 | __(sarl $fixnumshift,%imm0) |
---|
608 | __(movd %imm0,%mm0) |
---|
609 | __(ret) |
---|
610 | 1: __(andb $tagmask,%imm0_b) |
---|
611 | __(cmpb $tag_misc,%imm0_b) |
---|
612 | __(jne 9f) |
---|
613 | __(movb misc_subtag_offset(%arg_z),%imm0_b) |
---|
614 | __(cmpb $subtag_bignum,%imm0_b) |
---|
615 | __(jne 9f) |
---|
616 | __(movl misc_header_offset(%arg_z),%imm0) |
---|
617 | __(cmpl $three_digit_bignum_header,%imm0) |
---|
618 | __(je 3f) |
---|
619 | __(cmpl $two_digit_bignum_header,%imm0) |
---|
620 | __(jne 9f) |
---|
621 | __(movl misc_data_offset(%arg_z),%imm0) |
---|
622 | __(testl %imm0,%imm0) |
---|
623 | __(js 9f) |
---|
624 | __(repret) |
---|
625 | 3: __(movl misc_data_offset(%arg_z),%imm0) |
---|
626 | __(cmpl $0,misc_data_offset+8(%arg_z)) |
---|
627 | __(jne 9f) |
---|
628 | __(repret) |
---|
629 | 9: __(uuo_error_reg_not_type(Rarg_z,error_object_not_u64)) |
---|
630 | _endsubp(getu64) |
---|
631 | |
---|
632 | _spentry(makeu64) |
---|
633 | __(int $3) |
---|
634 | _endsubp(makeu64) |
---|
635 | |
---|
636 | _spentry(specref) |
---|
637 | __(int $3) |
---|
638 | _endsubp(specref) |
---|
639 | |
---|
640 | /* arg_y = special symbol, arg_z = new value. */ |
---|
641 | _spentry(specset) |
---|
642 | __(movl symbol.binding_index(%arg_y),%imm0) |
---|
643 | __(cmp %rcontext:tcr.tlb_limit,%imm0) |
---|
644 | __(movl %rcontext:tcr.tlb_pointer,%temp1) |
---|
645 | __(jae 1f) |
---|
646 | __(movl (%temp1,%imm0),%temp0) |
---|
647 | __(cmpb $no_thread_local_binding_marker,%temp0_b) |
---|
648 | __(je 1f) |
---|
649 | __(movl %arg_z,(%temp1,%imm0)) |
---|
650 | __(ret) |
---|
651 | 1: __(movl %arg_y,%temp0) |
---|
652 | __(movl $1<<fixnumshift,%arg_y) |
---|
653 | __(jmp _SPgvset) |
---|
654 | _endsubp(specset) |
---|
655 | |
---|
656 | _spentry(specrefcheck) |
---|
657 | __(movl symbol.binding_index(%arg_z),%imm0) |
---|
658 | __(cmp %rcontext:tcr.tlb_limit,%imm0) |
---|
659 | __(movl %rcontext:tcr.tlb_pointer,%temp1) |
---|
660 | __(mov %arg_z,%arg_y) |
---|
661 | __(jae 7f) |
---|
662 | __(movl (%temp1,%imm0),%arg_z) |
---|
663 | __(cmpb $no_thread_local_binding_marker,%arg_z_b) |
---|
664 | __(jne 8f) |
---|
665 | 7: __(movl symbol.vcell(%arg_y),%arg_z) |
---|
666 | 8: __(cmpb $unbound_marker,%arg_z_b) |
---|
667 | __(jne,pt 9f) |
---|
668 | __(uuo_error_reg_unbound(Rarg_y)) |
---|
669 | 9: __(repret) |
---|
670 | _endsubp(specrefcheck) |
---|
671 | |
---|
672 | _spentry(restoreintlevel) |
---|
673 | __(int $3) |
---|
674 | _endsubp(restoreintlevel) |
---|
675 | |
---|
676 | _spentry(makeu32) |
---|
677 | __(int $3) |
---|
678 | _endsubp(makeu32) |
---|
679 | |
---|
680 | _spentry(gets32) |
---|
681 | __(int $3) |
---|
682 | _endsubp(gets32) |
---|
683 | |
---|
684 | _spentry(getu32) |
---|
685 | __(int $3) |
---|
686 | _endsubp(getu32) |
---|
687 | |
---|
688 | _spentry(mvpasssym) |
---|
689 | __(int $3) |
---|
690 | _endsubp(mvpasssym) |
---|
691 | |
---|
692 | _spentry(unbind) |
---|
693 | __(int $3) |
---|
694 | _endsubp(unbind) |
---|
695 | |
---|
696 | _spentry(unbind_n) |
---|
697 | __(int $3) |
---|
698 | _endsubp(unbind_n) |
---|
699 | |
---|
700 | _spentry(unbind_to) |
---|
701 | __(int $3) |
---|
702 | _endsubp(unbind_to) |
---|
703 | |
---|
704 | _spentry(bind_interrupt_level_0) |
---|
705 | __(int $3) |
---|
706 | _endsubp(bind_interrupt_level_0) |
---|
707 | |
---|
708 | _spentry(bind_interrupt_level_m1) |
---|
709 | __(int $3) |
---|
710 | _endsubp(bind_interrupt_level_m1) |
---|
711 | |
---|
712 | _spentry(bind_interrupt_level) |
---|
713 | __(int $3) |
---|
714 | _endsubp(bind_interrupt_level) |
---|
715 | |
---|
716 | _spentry(unbind_interrupt_level) |
---|
717 | __(int $3) |
---|
718 | _endsubp(unbind_interrupt_level) |
---|
719 | |
---|
720 | _spentry(progvrestore) |
---|
721 | __(int $3) |
---|
722 | _endsubp(progvrestore) |
---|
723 | |
---|
724 | _spentry(builtin_plus) |
---|
725 | __(int $3) |
---|
726 | _endsubp(builtin_plus) |
---|
727 | |
---|
728 | _spentry(builtin_minus) |
---|
729 | __(int $3) |
---|
730 | _endsubp(builtin_minus) |
---|
731 | |
---|
732 | _spentry(builtin_times) |
---|
733 | __(int $3) |
---|
734 | _endsubp(builtin_times) |
---|
735 | |
---|
736 | _spentry(builtin_div) |
---|
737 | __(jump_builtin(_builtin_div,2)) |
---|
738 | |
---|
739 | /* %arg_z <- (= %arg_y %arg_z). */ |
---|
740 | _spentry(builtin_eq) |
---|
741 | __(movl %arg_y,%imm0) |
---|
742 | __(orb %arg_z_b,%imm0_b) |
---|
743 | __(testb $fixnummask,%imm0_b) |
---|
744 | __(jne 1f) |
---|
745 | __(rcmpl(%arg_z,%arg_y)) |
---|
746 | __(condition_to_boolean(e,%imm0,%arg_z)) |
---|
747 | __(ret) |
---|
748 | 1: __(jump_builtin(_builtin_eq,2)) |
---|
749 | _endsubp(builtin_eq) |
---|
750 | |
---|
751 | /* %arg_z <- (/= %arg_y %arg_z). */ |
---|
752 | _spentry(builtin_ne) |
---|
753 | __(movl %arg_y,%imm0) |
---|
754 | __(orb %arg_z_b,%imm0_b) |
---|
755 | __(testb $fixnummask,%imm0_b) |
---|
756 | __(jne 1f) |
---|
757 | __(rcmpl(%arg_z,%arg_y)) |
---|
758 | __(condition_to_boolean(ne,%imm0,%arg_z)) |
---|
759 | __(ret) |
---|
760 | 1: __(jump_builtin(_builtin_ne,2)) |
---|
761 | _endsubp(builtin_ne) |
---|
762 | |
---|
763 | /* %arg_z <- (> %arg_y %arg_z). */ |
---|
764 | _spentry(builtin_gt) |
---|
765 | __(movl %arg_y,%imm0) |
---|
766 | __(orb %arg_z_b,%imm0_b) |
---|
767 | __(testb $fixnummask,%imm0_b) |
---|
768 | __(jne 1f) |
---|
769 | __(rcmpl(%arg_y,%arg_z)) |
---|
770 | __(condition_to_boolean(g,%imm0,%arg_z)) |
---|
771 | __(ret) |
---|
772 | 1: __(jump_builtin(_builtin_gt,2)) |
---|
773 | _endsubp(builtin_gt) |
---|
774 | |
---|
775 | /* %arg_z <- (>= %arg_y %arg_z). */ |
---|
776 | _spentry(builtin_ge) |
---|
777 | __(movl %arg_y,%imm0) |
---|
778 | __(orb %arg_z_b,%imm0_b) |
---|
779 | __(testb $fixnummask,%imm0_b) |
---|
780 | __(jne 1f) |
---|
781 | __(rcmpl(%arg_y,%arg_z)) |
---|
782 | __(condition_to_boolean(ge,%imm0,%arg_z)) |
---|
783 | __(ret) |
---|
784 | 1: __(jump_builtin(_builtin_ge,2)) |
---|
785 | _endsubp(builtin_ge) |
---|
786 | |
---|
787 | /* %arg_z <- (< %arg_y %arg_z). */ |
---|
788 | _spentry(builtin_lt) |
---|
789 | __(movl %arg_y,%imm0) |
---|
790 | __(orb %arg_z_b,%imm0_b) |
---|
791 | __(testb $fixnummask,%imm0_b) |
---|
792 | __(jne 1f) |
---|
793 | __(rcmpl(%arg_y,%arg_z)) |
---|
794 | __(condition_to_boolean(l,%imm0,%arg_z)) |
---|
795 | __(ret) |
---|
796 | 1: __(jump_builtin(_builtin_lt,2)) |
---|
797 | _endsubp(builtin_lt) |
---|
798 | |
---|
799 | /* %arg_z <- (<= %arg_y %arg_z). */ |
---|
800 | _spentry(builtin_le) |
---|
801 | __(movl %arg_y,%imm0) |
---|
802 | __(orb %arg_z_b,%imm0_b) |
---|
803 | __(testb $fixnummask,%imm0_b) |
---|
804 | __(jne 1f) |
---|
805 | __(rcmpl(%arg_y,%arg_z)) |
---|
806 | __(condition_to_boolean(le,%imm0,%arg_z)) |
---|
807 | __(ret) |
---|
808 | 1: __(jump_builtin(_builtin_le,2)) |
---|
809 | _endsubp(builtin_le) |
---|
810 | |
---|
811 | _spentry(builtin_eql) |
---|
812 | __(int $3) |
---|
813 | _endsubp(builtin_eql) |
---|
814 | |
---|
815 | _spentry(builtin_length) |
---|
816 | __(int $3) |
---|
817 | _endsubp(builtin_length) |
---|
818 | |
---|
819 | _spentry(builtin_seqtype) |
---|
820 | __(int $3) |
---|
821 | _endsubp(builtin_seqtype) |
---|
822 | |
---|
823 | _spentry(builtin_assq) |
---|
824 | __(int $3) |
---|
825 | _endsubp(builtin_assq) |
---|
826 | |
---|
827 | _spentry(builtin_memq) |
---|
828 | __(int $3) |
---|
829 | _endsubp(builtin_memq) |
---|
830 | |
---|
831 | logbitp_max_bit = 30 |
---|
832 | |
---|
833 | _spentry(builtin_logbitp) |
---|
834 | __(int $3) |
---|
835 | _endsubp(builtin_logbitp) |
---|
836 | |
---|
837 | _spentry(builtin_logior) |
---|
838 | __(movl %arg_y,%imm0) |
---|
839 | __(orb %arg_z_b,%imm0_b) |
---|
840 | __(testb $fixnummask,%imm0_b) |
---|
841 | __(jne 1f) |
---|
842 | __(orl %arg_y,%arg_z) |
---|
843 | __(ret) |
---|
844 | 1: |
---|
845 | __(jump_builtin(_builtin_logior,2)) |
---|
846 | _endsubp(builtin_logior) |
---|
847 | |
---|
848 | _spentry(builtin_logand) |
---|
849 | __(movl %arg_y,%imm0) |
---|
850 | __(orb %arg_z_b,%imm0_b) |
---|
851 | __(testb $fixnummask,%imm0_b) |
---|
852 | __(jne 1f) |
---|
853 | __(andl %arg_y,%arg_z) |
---|
854 | __(ret) |
---|
855 | 1: |
---|
856 | __(jump_builtin(_builtin_logand,2)) |
---|
857 | _endsubp(builtin_logand) |
---|
858 | |
---|
859 | _spentry(builtin_negate) |
---|
860 | __(testb $fixnummask,%arg_z_b) |
---|
861 | __(jne 1f) |
---|
862 | __(negl %arg_z) |
---|
863 | __(jo,pn C(fix_one_bit_overflow)) |
---|
864 | __(repret) |
---|
865 | 1: |
---|
866 | __(jump_builtin(_builtin_negate,1)) |
---|
867 | _endsubp(builtin_negate) |
---|
868 | |
---|
869 | _spentry(builtin_logxor) |
---|
870 | __(movl %arg_y,%imm0) |
---|
871 | __(orb %arg_z_b,%imm0_b) |
---|
872 | __(testb $fixnummask,%imm0_b) |
---|
873 | __(jne 1f) |
---|
874 | __(xorl %arg_y,%arg_z) |
---|
875 | __(ret) |
---|
876 | 1: |
---|
877 | __(jump_builtin(_builtin_logxor,2)) |
---|
878 | _endsubp(builtin_logxor) |
---|
879 | |
---|
880 | _spentry(builtin_aset1) |
---|
881 | __(int $3) |
---|
882 | _endsubp(builtin_aset1) |
---|
883 | |
---|
884 | _spentry(builtin_ash) |
---|
885 | __(int $3) |
---|
886 | _endsubp(builtin_ash) |
---|
887 | |
---|
888 | _spentry(builtin_aref1) |
---|
889 | __(extract_typecode(%arg_y,%imm0)) |
---|
890 | __(cmpb $min_vector_subtag,%imm0_b) |
---|
891 | __(box_fixnum_no_flags(%imm0,%arg_y)) |
---|
892 | __(ja _SPsubtag_misc_ref) |
---|
893 | __(jump_builtin(_builtin_aref1,2)) |
---|
894 | _endsubp(builtin_aref1) |
---|
895 | |
---|
896 | _spentry(ffcall) |
---|
897 | __(int $3) |
---|
898 | _endsubp(ffcall) |
---|
899 | |
---|
900 | _spentry(ffcall_return_registers) |
---|
901 | __(int $3) |
---|
902 | _endsubp(ffcall_return_registers) |
---|
903 | |
---|
904 | _spentry(spread_lexprz) |
---|
905 | __(int $3) |
---|
906 | _endsubp(spread_lexprz) |
---|
907 | |
---|
908 | _spentry(callback) |
---|
909 | __(int $3) |
---|
910 | _endsubp(callback) |
---|
911 | |
---|
912 | _spentry(aref2) |
---|
913 | __(int $3) |
---|
914 | _endsubp(aref2) |
---|
915 | |
---|
916 | _spentry(aref3) |
---|
917 | __(int $3) |
---|
918 | _endsubp(aref3) |
---|
919 | |
---|
920 | _spentry(aset2) |
---|
921 | __(int $3) |
---|
922 | _endsubp(aset2) |
---|
923 | |
---|
924 | _spentry(aset3) |
---|
925 | __(int $3) |
---|
926 | _endsubp(aset3) |
---|
927 | |
---|
928 | _spentry(call_closure) |
---|
929 | __(int $3) |
---|
930 | _endsubp(call_closure) |
---|
931 | |
---|
932 | _spentry(poweropen_callbackX) |
---|
933 | __(int $3) |
---|
934 | _endsubp(poweropen_callbackX) |
---|
935 | |
---|
936 | _spentry(poweropen_ffcallX) |
---|
937 | __(int $3) |
---|
938 | _endsubp(poweropen_ffcallX) |
---|
939 | |
---|
940 | _spentry(poweropen_syscall) |
---|
941 | __(int $3) |
---|
942 | _endsubp(poweropen_syscall) |
---|
943 | |
---|
944 | _spentry(eabi_ff_call) |
---|
945 | __(int $3) |
---|
946 | _endsubp(eabi_ff_call) |
---|
947 | |
---|
948 | _spentry(eabi_callback) |
---|
949 | __(int $3) |
---|
950 | _endsubp(eabi_callback) |
---|
951 | |
---|
952 | |
---|
953 | /* Unused, and often not used on PPC either */ |
---|
954 | _spentry(callbuiltin) |
---|
955 | __(int $3) |
---|
956 | _endsubp(callbuiltin) |
---|
957 | |
---|
958 | _spentry(callbuiltin0) |
---|
959 | __(int $3) |
---|
960 | _endsubp(callbuiltin0) |
---|
961 | |
---|
962 | _spentry(callbuiltin1) |
---|
963 | __(int $3) |
---|
964 | _endsubp(callbuiltin1) |
---|
965 | |
---|
966 | _spentry(callbuiltin2) |
---|
967 | __(int $3) |
---|
968 | _endsubp(callbuiltin2) |
---|
969 | |
---|
970 | _spentry(callbuiltin3) |
---|
971 | __(int $3) |
---|
972 | _endsubp(callbuiltin3) |
---|
973 | |
---|
974 | _spentry(restorefullcontext) |
---|
975 | __(int $3) |
---|
976 | _endsubp(restorefullcontext) |
---|
977 | |
---|
978 | _spentry(savecontextvsp) |
---|
979 | __(int $3) |
---|
980 | _endsubp(savecontextvsp) |
---|
981 | |
---|
982 | _spentry(savecontext0) |
---|
983 | __(int $3) |
---|
984 | _endsubp(savecontext0) |
---|
985 | |
---|
986 | _spentry(restorecontext) |
---|
987 | __(int $3) |
---|
988 | _endsubp(restorecontext) |
---|
989 | |
---|
990 | _spentry(stkconsyz) |
---|
991 | __(int $3) |
---|
992 | _endsubp(stkconsyz) |
---|
993 | |
---|
994 | _spentry(stkvcell0) |
---|
995 | __(int $3) |
---|
996 | _endsubp(stkvcell0) |
---|
997 | |
---|
998 | _spentry(stkvcellvsp) |
---|
999 | __(int $3) |
---|
1000 | _endsubp(stkvcellvsp) |
---|
1001 | |
---|
1002 | _spentry(breakpoint) |
---|
1003 | __(int $3) |
---|
1004 | _endsubp(breakpoint) |
---|
1005 | |
---|
1006 | _spentry(unused_5) |
---|
1007 | __(int $3) |
---|
1008 | _endsubp(unused_5) |
---|
1009 | |
---|
1010 | _spentry(unused_6) |
---|
1011 | __(int $3) |
---|
1012 | _endsubp(unused_6) |
---|