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

Last change on this file since 8068 was 8068, checked in by rme, 13 years ago

Skeletal subprims and other low-level x8632 stuff.

File size: 21.0 KB
Line 
1        include(lisp.s)
2
3        .align 2
4define([_spentry],[ifdef([__func_name],[_endfn],[])
5        .p2align 3
6        _exportfn(_SP$1)
7])
8
9define([_endsubp],[
10        _endfn(_SP$1)
11])
12
13define([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)
28C(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)                       
74C(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))
1090:      __(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)
261C(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)
282C(egc_rplaca):
283        __(int $3)
284_endsubp(rplaca)
285
286_spentry(rplacd)
287        .globl C(egc_rplacd)
288C(egc_rplacd):
289        __(int $3)
290_endsubp(rplacd)
291
292_spentry(gvset)
293        .globl C(egc_gvset)
294C(egc_gvset):
295        __(int $3)
296_endsubp(gvset)
297
298_spentry(set_hash_key)
299        .globl C(egc_set_hash_key)
300C(egc_set_hash_key): 
301        __(int $3)
302_endsubp(set_hash_key)
303
304/* This is a little trickier: if this is interrupted, we need to know  */
305/* whether or not the STORE-CONDITIONAL (cmpxchgq) has won or not.    */
306/* If we're interrupted   before the PC has reached the "success_test" label,   */
307/* repeat (luser the PC back to .SPstore_node_conditional.)  If we're at that  */
308/* label with the Z flag set, we won and (may) need to memoize.  */
309
310_spentry(store_node_conditional)
311        .globl C(egc_store_node_conditional)
312C(egc_store_node_conditional):
313        .globl C(egc_store_node_conditional_success_test)
314C(egc_store_node_conditional_success_test):
315        .globl C(egc_write_barrier_end)
316C(egc_write_barrier_end):
317        __(int $3)
318_endsubp(store_node_conditional)
319
320_spentry(setqsym)
321        __(bt $sym_vbit_const,symbol.flags(%arg_y))
322        __(jae _SPspecset)
323        __(mov %arg_y,%arg_z)
324        __(mov $XCONST,%arg_y)
325        __(set_nargs(2))
326        __(jmp _SPksignalerr)
327_endsubp(setqsym)
328
329_spentry(progvsave)
330        __(int $3)
331_endsubp(progvsave)
332
333/* Allocate node objects on the temp stack, immediate objects on the foreign  */
334/* stack. (The caller has to know which stack to discard a frame from.)  */
335/* %arg_y = boxed element-count, %arg_z = boxed subtype  */
336       
337_spentry(stack_misc_alloc)
338        __(int $3)
339_endsubp(stack_misc_alloc)
340
341/* subtype (boxed, of course) is pushed, followed by nargs bytes worth of   */
342/* initial-contents.  Note that this can be used to cons any type of initialized   */
343/* node-header'ed misc object (symbols, closures, ...) as well as vector-like   */
344/* objects.   */
345_spentry(gvector)
346        __(int $3)
347_endsubp(gvector)
348
349_spentry(mvpass)
350        __(int $3)
351_endsubp(mvpass)
352
353_spentry(nthvalue)
354        __(int $3)
355_endsubp(nthvalue)
356
357_spentry(values)
358        __(int $3)
359_endsubp(values)
360       
361_spentry(default_optional_args)
362        __(int $3)
363_endsubp(default_optional_args)
364
365_spentry(opt_supplied_p)
366        __(int $3)
367_endsubp(opt_supplied_p)
368
369_spentry(lexpr_entry)
370        __(int $3)
371_endsubp(lexpr_entry)
372       
373_spentry(heap_rest_arg)
374        __(int $3)
375_endsubp(heap_rest_arg)
376       
377/* %imm0 contains the number of fixed args ; make an &rest arg out of the others   */
378_spentry(req_heap_rest_arg)
379        __(int $3)
380_endsubp(req_heap_rest_arg)
381
382/* %imm0 bytes of stuff has already been pushed   */
383/* make an &rest arg out of any others   */
384_spentry(heap_cons_rest_arg)
385        __(int $3)
386_endsubp(heap_cons_rest_arg)
387
388_spentry(simple_keywords)
389        __(xor %imm0,%imm0)
390        __(push_argregs())
391        __(jmp _SPkeyword_bind)
392_endsubp(simple_keywords)
393
394_spentry(keyword_args)
395        __(push_argregs())
396        __(jmp _SPkeyword_bind)
397_endsubp(keyword_args)
398       
399/* There are %nargs words of arguments on the stack; %imm0 contains the number  */
400/* of non-keyword args pushed.  It's possible that we never actually got  */
401/* any keyword args, which would make things much simpler.   */
402
403/* On entry, temp1 contains a fixnum with bits indicating whether   */
404/* &allow-other-keys and/or &rest was present in the lambda list.  */
405/* Once we get here, we can use the arg registers.  */
406
407define([keyword_flags_aok_bit],[fixnumshift])
408define([keyword_flags_unknown_keys_bit],[fixnumshift+1])
409define([keyword_flags_rest_bit],[fixnumshift+2])
410define([keyword_flags_seen_aok_bit],[fixnumshift+3])       
411       
412_spentry(keyword_bind)
413        __(int $3)
414_endsubp(keyword_bind)
415
416_spentry(ksignalerr)
417        __(mov $nrs.errdisp,%fname)
418        __(jump_fname) 
419_endsubp(ksignalerr)
420
421_spentry(stack_rest_arg)
422        __(xorl %imm0,%imm0)
423        __(push_argregs())
424        __(jmp _SPstack_cons_rest_arg)
425_endsubp(stack_rest_arg)
426
427_spentry(req_stack_rest_arg)
428        __(push_argregs())
429        __(jmp _SPstack_cons_rest_arg)
430_endsubp(req_stack_rest_arg)
431
432_spentry(stack_cons_rest_arg)
433_endsubp(stack_cons_rest_arg)
434
435_spentry(getxlong)
436        __(int $3)
437_endsubp(getxlong)
438
439/* Have to be a little careful here: the caller may or may not have pushed  */
440/*   an empty frame, and we may or may not have needed one.  We can't easily  */
441/*   tell whether or not a frame will be needed (if the caller didn't reserve  */
442/*   a frame, whether or not we need one depends on the length of the list  */
443/*   in arg_z.  So, if the caller didn't push a frame, we do so ; once everything'*/
444/*   been spread, we discard the reserved frame (regardless of who pushed it)  */
445/*   if all args fit in registers.   */
446_spentry(spreadargz)
447        __(int $3)
448_endsubp(spreadargz)
449
450       
451/* Caller built it's own frame when it was entered.  If all outgoing args  */
452/* are in registers, we can discard that frame; otherwise, we copy outgoing  */
453/* relative to it and restore %rbp/%ra0   */
454_spentry(tfuncallgen)
455        __(int $3)
456_endsubp(tfuncallgen)
457
458/* Some args were pushed; move them down in the frame   */
459_spentry(tfuncallslide)
460        __(int $3)
461_endsubp(tfuncallslide)
462
463/* No args were pushed; recover saved context & do funcall        */
464_spentry(tfuncallvsp)
465        __(leave)
466        __(do_funcall())
467_endsubp(tfuncallvsp)
468
469_spentry(tcallsymgen)
470        __(int $3)
471_endsubp(tcallsymgen)
472
473_spentry(tcallsymslide)
474        __(int $3)
475_endsubp(tcallsymslide)
476
477_spentry(tcallsymvsp)
478        __(leave)
479        __(jump_fname())
480_endsubp(tcallsymvsp)
481
482_spentry(tcallnfngen)
483        __(int $3)
484_endsubp(tcallnfngen)
485       
486_spentry(tcallnfnslide)
487        __(int $3)
488_endsubp(tcallnfnslide)
489
490_spentry(tcallnfnvsp)
491        __(mov %temp0,%fn)
492        __(leave)
493        __(jmp *%fn)
494_endsubp(tcallnfnvsp)
495
496_spentry(makestackblock)
497        __(int $3)
498_endsubp(makestackblock)
499       
500_spentry(makestackblock0)
501        __(int $3)
502_endsubp(makestackblock0)
503       
504_spentry(makestacklist)
505        __(int $3)
506_endsubp(makestacklist)
507       
508_spentry(stkgvector)
509        __(int $3)
510_endsubp(stkgvector)
511
512_spentry(misc_alloc)
513        __(int $3)
514_endsubp(misc_alloc)
515
516_startfn(C(destbind1))
517        __(jmp *%ra0)
518_endfn(C(destbind1))   
519
520_spentry(macro_bind)
521        __(int $3)
522_endsubp(macro_bind)
523
524_spentry(destructuring_bind)
525        __(mov %arg_reg,%whole_reg)
526        __(jmp C(destbind1))
527_endsubp(destructuring_bind)
528
529_spentry(destructuring_bind_inner)
530        __(mov %arg_z,%whole_reg)
531        __(jmp C(destbind1))
532_endsubp(destructuring_bind_inner)
533
534_spentry(vpopargregs)
535        __(int $3)
536_endsubp(vpopargregs)
537
538/* If arg_z is an integer, return in imm0 something whose sign  */
539/* is the same as arg_z's.  If not an integer, error.   */
540_spentry(integer_sign)
541        __(testb $tagmask,%arg_z_b)
542        __(mov %arg_z,%imm0)
543        __(je 8f)
544        __(extract_typecode(%arg_z,%imm0))
545        __(cmpb $subtag_bignum,%imm0_b)
546        __(jne 9f)
547        __(getvheader(%arg_z,%imm0))
548        __(shr $num_subtag_bits,%imm0)
549        __(movl misc_data_offset-4(%arg_z,%imm0,4),%imm0)
5508:      __(repret)
5519:      __(uuo_error_reg_not_type(Rarg_z,error_object_not_integer))
552_endsubp(integer_sign)
553
554_spentry(mvslide)
555        __(int $3)
556_endsubp(mvslide)
557
558_spentry(save_values)
559        __(int $3)
560_endsubp(save_values)
561
562_spentry(add_values)
563        __(int $3)
564_endsubp(add_values)
565                                       
566_spentry(recover_values)
567        __(int $3)
568_endsubp(recover_values)
569                                       
570_spentry(recover_values_for_mvcall)
571        __(int $3)
572_endsubp(recover_values_for_mvcall)
573                                       
574_spentry(reset)
575        __(int $3)
576_endsubp(reset)
577
578_spentry(misc_alloc_init)
579        __(int $3)
580_endsubp(misc_alloc_init)
581       
582_spentry(stack_misc_alloc_init)
583        __(int $3)
584_endsubp(stack_misc_alloc_init)
585
586        .globl C(popj)
587_spentry(popj)
588C(popj):
589        __(leave)
590        __(ret)
591_endsubp(popj)
592
593
594_spentry(gets64)
595        __(int $3)
596_endsubp(gets64)
597       
598       
599/* arg_z should be of type (unsigned-byte 64) */
600/* return unboxed value in mm0 */
601_spentry(getu64)
602        __(movl $~(target_most_positive_fixnum << fixnumshift),%imm0)
603        __(testl %arg_z,%imm0)
604        __(movl %arg_z,%imm0)
605        __(jne 1f)
606        __(sarl $fixnumshift,%imm0)
607        __(movd %imm0,%mm0)
608        __(ret)
6091:      __(andb $tagmask,%imm0_b)
610        __(cmpb $tag_misc,%imm0_b)
611        __(jne 9f)
612        __(movb misc_subtag_offset(%arg_z),%imm0_b)
613        __(cmpb $subtag_bignum,%imm0_b)
614        __(jne 9f)
615        __(movl misc_header_offset(%arg_z),%imm0)
616        __(cmpl $three_digit_bignum_header,%imm0)
617        __(je 3f)
618        __(cmpl $two_digit_bignum_header,%imm0)
619        __(jne 9f)
620        __(movl misc_data_offset(%arg_z),%imm0)
621        __(testl %imm0,%imm0)
622        __(js 9f)
623        __(repret)
6243:      __(movl misc_data_offset(%arg_z),%imm0)
625        __(cmpl $0,misc_data_offset+8(%arg_z))
626        __(jne 9f)
627        __(repret)
6289:      __(uuo_error_reg_not_type(Rarg_z,error_object_not_u64))
629_endsubp(getu64)
630
631_spentry(makeu64)
632        __(int $3)
633_endsubp(makeu64)
634       
635_spentry(specref)
636        __(int $3)
637_endsubp(specref)
638       
639_spentry(specset)
640        __(int $3)
641_endsubp(specset)
642       
643_spentry(specrefcheck)
644        __(int $3)
645_endsubp(specrefcheck)
646
647_spentry(restoreintlevel)
648        __(int $3)
649_endsubp(restoreintlevel)
650
651_spentry(makeu32)
652        __(int $3)
653_endsubp(makeu32)
654
655_spentry(gets32)
656        __(int $3)
657_endsubp(gets32)
658
659_spentry(getu32)
660        __(int $3)
661_endsubp(getu32)
662
663_spentry(mvpasssym)
664        __(int $3)
665_endsubp(mvpasssym)
666
667_spentry(unbind)
668        __(int $3)
669_endsubp(unbind)
670
671_spentry(unbind_n)
672        __(int $3)
673_endsubp(unbind_n)
674
675_spentry(unbind_to)
676        __(int $3)
677_endsubp(unbind_to)
678
679_spentry(bind_interrupt_level_0)
680        __(int $3)
681_endsubp(bind_interrupt_level_0)
682
683_spentry(bind_interrupt_level_m1)
684        __(int $3)
685_endsubp(bind_interrupt_level_m1)
686
687_spentry(bind_interrupt_level)
688        __(int $3)
689_endsubp(bind_interrupt_level)
690
691_spentry(unbind_interrupt_level)
692        __(int $3)
693_endsubp(unbind_interrupt_level)
694
695_spentry(progvrestore)
696        __(int $3)
697_endsubp(progvrestore)
698
699_spentry(builtin_plus)
700        __(int $3)
701_endsubp(builtin_plus)
702
703_spentry(builtin_minus)
704        __(int $3)
705_endsubp(builtin_minus)
706
707_spentry(builtin_times)
708        __(int $3)
709_endsubp(builtin_times)
710
711_spentry(builtin_div)
712        __(jump_builtin(_builtin_div,2))
713
714/* %arg_z <- (= %arg_y %arg_z).   */
715_spentry(builtin_eq)
716        __(movl %arg_y,%imm0)
717        __(orb %arg_z_b,%imm0_b)
718        __(testb $fixnummask,%imm0_b)
719        __(jne 1f)
720        __(rcmpl(%arg_z,%arg_y))
721        __(condition_to_boolean(e,%imm0,%arg_z))
722        __(ret)
7231:      __(jump_builtin(_builtin_eq,2))
724_endsubp(builtin_eq)
725       
726/* %arg_z <- (/= %arg_y %arg_z).          */
727_spentry(builtin_ne)
728        __(movl %arg_y,%imm0)
729        __(orb %arg_z_b,%imm0_b)
730        __(testb $fixnummask,%imm0_b)
731        __(jne 1f)
732        __(rcmpl(%arg_z,%arg_y))
733        __(condition_to_boolean(ne,%imm0,%arg_z))
734        __(ret)
7351:      __(jump_builtin(_builtin_ne,2))
736_endsubp(builtin_ne)
737       
738/* %arg_z <- (> %arg_y %arg_z).   */
739_spentry(builtin_gt)
740        __(movl %arg_y,%imm0)
741        __(orb %arg_z_b,%imm0_b)
742        __(testb $fixnummask,%imm0_b)
743        __(jne 1f)
744        __(rcmpl(%arg_y,%arg_z))
745        __(condition_to_boolean(g,%imm0,%arg_z))
746        __(ret)
7471:      __(jump_builtin(_builtin_gt,2))
748_endsubp(builtin_gt)
749
750/* %arg_z <- (>= %arg_y %arg_z).          */
751_spentry(builtin_ge)
752        __(movl %arg_y,%imm0)
753        __(orb %arg_z_b,%imm0_b)
754        __(testb $fixnummask,%imm0_b)
755        __(jne 1f)
756        __(rcmpl(%arg_y,%arg_z))
757        __(condition_to_boolean(ge,%imm0,%arg_z))
758        __(ret)
7591:      __(jump_builtin(_builtin_ge,2))
760_endsubp(builtin_ge)
761       
762/* %arg_z <- (< %arg_y %arg_z).   */
763_spentry(builtin_lt)
764        __(movl %arg_y,%imm0)
765        __(orb %arg_z_b,%imm0_b)
766        __(testb $fixnummask,%imm0_b)
767        __(jne 1f)
768        __(rcmpl(%arg_y,%arg_z))
769        __(condition_to_boolean(l,%imm0,%arg_z))
770        __(ret)
7711:      __(jump_builtin(_builtin_lt,2))
772_endsubp(builtin_lt)
773
774/* %arg_z <- (<= %arg_y %arg_z).   */
775_spentry(builtin_le)
776        __(movl %arg_y,%imm0)
777        __(orb %arg_z_b,%imm0_b)
778        __(testb $fixnummask,%imm0_b)
779        __(jne 1f)
780        __(rcmpl(%arg_y,%arg_z))
781        __(condition_to_boolean(le,%imm0,%arg_z))
782        __(ret)
7831:      __(jump_builtin(_builtin_le,2))
784_endsubp(builtin_le)
785
786_spentry(builtin_eql)
787        __(int $3)
788_endsubp(builtin_eql)
789
790_spentry(builtin_length)
791        __(int $3)
792_endsubp(builtin_length)
793
794_spentry(builtin_seqtype)
795        __(int $3)
796_endsubp(builtin_seqtype)
797
798_spentry(builtin_assq)
799        __(int $3)
800_endsubp(builtin_assq)
801
802_spentry(builtin_memq)
803        __(int $3)
804_endsubp(builtin_memq)
805
806logbitp_max_bit = 30
807
808_spentry(builtin_logbitp)
809        __(int $3)
810_endsubp(builtin_logbitp)
811
812_spentry(builtin_logior)
813        __(movl %arg_y,%imm0)
814        __(orb %arg_z_b,%imm0_b)
815        __(testb $fixnummask,%imm0_b)
816        __(jne 1f)
817        __(orl %arg_y,%arg_z)
818        __(ret)
8191:     
820        __(jump_builtin(_builtin_logior,2))
821_endsubp(builtin_logior)
822
823_spentry(builtin_logand)
824        __(movl %arg_y,%imm0)
825        __(orb %arg_z_b,%imm0_b)
826        __(testb $fixnummask,%imm0_b)
827        __(jne 1f)
828        __(andl %arg_y,%arg_z)
829        __(ret)
8301:             
831        __(jump_builtin(_builtin_logand,2))
832_endsubp(builtin_logand)
833
834_spentry(builtin_negate)
835        __(testb $fixnummask,%arg_z_b)
836        __(jne 1f)
837        __(negl %arg_z)
838        __(jo,pn C(fix_one_bit_overflow))
839        __(repret)
8401:             
841        __(jump_builtin(_builtin_negate,1))     
842_endsubp(builtin_negate)
843
844_spentry(builtin_logxor)
845        __(movl %arg_y,%imm0)
846        __(orb %arg_z_b,%imm0_b)
847        __(testb $fixnummask,%imm0_b)
848        __(jne 1f)
849        __(xorl %arg_y,%arg_z)
850        __(ret)
8511:             
852        __(jump_builtin(_builtin_logxor,2))
853_endsubp(builtin_logxor)
854       
855_spentry(builtin_aset1)
856        __(int $3)
857_endsubp(builtin_aset1)
858
859_spentry(builtin_ash)
860        __(int $3)
861_endsubp(builtin_ash)
862
863_spentry(builtin_aref1)
864        __(extract_typecode(%arg_y,%imm0))
865        __(cmpb $min_vector_subtag,%imm0_b)
866        __(box_fixnum_no_flags(%imm0,%arg_y))
867        __(ja _SPsubtag_misc_ref)
868        __(jump_builtin(_builtin_aref1,2))
869_endsubp(builtin_aref1)
870
871_spentry(ffcall)
872        __(int $3)
873_endsubp(ffcall)
874       
875_spentry(ffcall_return_registers)
876        __(int $3)
877_endsubp(ffcall_return_registers)
878
879_spentry(spread_lexprz)
880        __(int $3)
881_endsubp(spread_lexprz)
882
883_spentry(callback)
884        __(int $3)
885_endsubp(callback)
886
887_spentry(aref2)
888        __(int $3)
889_endsubp(aref2)
890
891_spentry(aref3)
892        __(int $3)
893_endsubp(aref3)
894
895_spentry(aset2)
896        __(int $3)
897_endsubp(aset2)
898
899_spentry(aset3)
900        __(int $3)
901_endsubp(aset3)
902
903_spentry(call_closure)
904        __(int $3)
905_endsubp(call_closure)
906
907_spentry(poweropen_callbackX)
908        __(int $3)
909_endsubp(poweropen_callbackX)
910       
911_spentry(poweropen_ffcallX)
912        __(int $3)
913_endsubp(poweropen_ffcallX)
914               
915_spentry(poweropen_syscall)
916        __(int $3)
917_endsubp(poweropen_syscall)
918
919_spentry(eabi_ff_call)
920        __(int $3)
921_endsubp(eabi_ff_call)
922
923_spentry(eabi_callback)
924        __(int $3)
925_endsubp(eabi_callback)
926
927
928/* Unused, and often not used on PPC either  */
929_spentry(callbuiltin)
930        __(int $3)
931_endsubp(callbuiltin)
932
933_spentry(callbuiltin0)
934        __(int $3)
935_endsubp(callbuiltin0)
936
937_spentry(callbuiltin1)
938        __(int $3)
939_endsubp(callbuiltin1)
940
941_spentry(callbuiltin2)
942        __(int $3)
943_endsubp(callbuiltin2)
944
945_spentry(callbuiltin3)
946        __(int $3)
947_endsubp(callbuiltin3)
948       
949_spentry(restorefullcontext)
950        __(int $3)
951_endsubp(restorefullcontext)
952
953_spentry(savecontextvsp)
954        __(int $3)
955_endsubp(savecontextvsp)
956
957_spentry(savecontext0)
958        __(int $3)
959_endsubp(savecontext0)
960
961_spentry(restorecontext)
962        __(int $3)
963_endsubp(restorecontext)
964
965_spentry(stkconsyz)
966        __(int $3)
967_endsubp(stkconsyz)
968
969_spentry(stkvcell0)
970        __(int $3)
971_endsubp(stkvcell0)
972
973_spentry(stkvcellvsp)
974        __(int $3)
975_endsubp(stkvcellvsp)
976
977_spentry(breakpoint)
978        __(int $3)
979_endsubp(breakpoint)
980
981_spentry(unused_5)
982        __(int $3)
983_endsubp(unused_5)
984
985_spentry(unused_6)
986        __(int $3)
987_endsubp(unused_6)
Note: See TracBrowser for help on using the repository browser.