source: branches/ia32/lisp-kernel/x86-spentry32.s @ 8223

Last change on this file since 8223 was 8223, checked in by rme, 12 years ago

Put back _beginfile macro.

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