/* Copyright (C) 2009 Clozure Associates */ /* Copyright (C) 1994-2001 Digitool, Inc */ /* This file is part of Clozure CL. */ /* Clozure CL is licensed under the terms of the Lisp Lesser GNU Public */ /* License , known as the LLGPL and distributed with Clozure CL as the */ /* file "LICENSE". The LLGPL consists of a preamble and the LGPL, */ /* which is distributed with Clozure CL as the file "LGPL". Where these */ /* conflict, the preamble takes precedence. */ /* Clozure CL is referenced in the preamble as the "LIBRARY." */ /* The LLGPL is also available online at */ /* http://opensource.franz.com/preamble.html */ /* The assembler has to do the arithmetic here: the expression */ /* may not be evaluable by m4. */ define(`lwi',`ifdef(`DARWIN',` .if ((($2) & 0xffff8000) == 0xffff8000) li $1,($2) .elseif ((($2) & 0xffff8000) == 0) li $1,$2 .else lis $1,(($2)>>16) .if (($2) & 0xffff) <> 0 ori $1,$1,(($2) & 0xffff) .endif .endif',` .ifeq (($2) & 0xffff8000)-0xffff8000 li $1,$2 .else .ifeq (($2) & 0xffff8000) li $1,$2 .else lis $1,($2>>16) .ifne ($2 & 0xffff) ori $1,$1,$2 & 0xffff .endif .endif .endif ')') ifdef(`PPC64',` define(`clrrri',`clrrdi $@') define(`clrlri',`clrldi $@') define(`clrlri_',`clrldi. $@') define(`ldr',`ld $@') define(`ldrx',`ldx $@') define(`ldru',`ldu $@') define(`str',`std $@') define(`strx',`stdx $@') define(`stru',`stdu $@') define(`strux',`stdux $@') define(`cmpr',`cmpd $@') define(`cmpri',`cmpdi $@') define(`cmplr',`cmpld $@') define(`cmplri',`cmpldi $@') define(`trlge',`tdlge $@') define(`trllt',`tdllt $@') define(`trlt',`tdlt $@') define(`trlle',`tdlle $@') define(`treqi',`tdeqi $@') define(`trnei',`tdnei $@') define(`trgti',`tdgti $@') define(`srari',`sradi $@') define(`srri',`srdi $@') define(`srr',`srd $@') define(`slri',`sldi $@') define(`lrarx',`ldarx $@') define(`strcx',`stdcx. $@') define(`load_highbit',` __(lis $1,0x8000) __(sldi $1,$1,32) ') define(`extract_bit_shift_count',` __(clrldi $1,$2,64-bitmap_shift) ') define(`alloc_trap',` __(tdlt allocptr,allocbase) ') define(`mullr',`mulld $@') ',` define(`clrrri',`clrrwi $@') define(`clrlri',`clrlwi $@') define(`clrlri_',`clrlwi. $@') define(`ldr',`lwz $@') define(`ldrx',`lwzx $@') define(`ldru',`lwzu $@') define(`str',`stw $@') define(`strx',`stwx $@') define(`stru',`stwu $@') define(`strux',`stwux $@') define(`cmpr',`cmpw $@') define(`cmpri',`cmpwi $@') define(`cmplr',`cmplw $@') define(`cmplri',`cmplwi $@') define(`trlge',`twlge $@') define(`trllt',`twllt $@') define(`trlt',`twlt $@') define(`trlle',`twlle $@') define(`treqi',`tweqi $@') define(`trnei',`twnei $@') define(`trgti',`twgti $@') define(`srari',`srawi $@') define(`srri',`srwi $@') define(`srr',`srw $@') define(`slri',`slwi $@') define(`lrarx',`lwarx $@') define(`strcx',`stwcx. $@') define(`load_highbit',` __(lis $1,0x8000) ') define(`extract_bit_shift_count',` __(clrlwi $1,$2,32-bitmap_shift) ') define(`alloc_trap',` __(twllt allocptr,allocbase) ') define(`mullr',`mullw $@') ') /* dnode_align(dest,src,delta) */ define(`dnode_align',` __(la $1,($3+(dnode_size-1))($2)) __(clrrri($1,$1,dnode_align_bits)) ') define(`extract_fulltag',` __(clrlri($1,$2,nbits_in_word-ntagbits)) ') define(`extract_lisptag',` __(clrlri($1,$2,nbits_in_word-nlisptagbits)) ') define(`extract_lisptag_',` __(clrlri_($1,$2,nbits_in_word-nlisptagbits)) ') define(`extract_subtag',` __(lbz $1,misc_subtag_offset($2)) ') ifdef(`PPC64',` define(`extract_lowtag',` __(clrldi $1,$2,nbits_in_word-nlowtagbits) ') define(`trap_unless_lowtag_equal',` __(clrldi $3,$1,nbits_in_word-nlowtagbits) __(tdnei $3,$2) ') ') define(`extract_lowbyte',` __(clrlri($1,$2,nbits_in_word-num_subtag_bits)) ') define(`extract_header',` __(ldr($1,misc_header_offset($2))) ') ifdef(`PPC64',` define(`extract_typecode',` new_macro_labels() __(extract_fulltag($1,$2)) __(cmpdi cr0,$1,fulltag_misc) __(extract_lisptag($1,$1)) __(bne cr0,macro_label(not_misc)) __(extract_subtag($1,$2)) macro_label(not_misc): ')',` define(`extract_typecode',` new_macro_labels() __(extract_lisptag($1,$2)) __(cmpwi cr0,$1,tag_misc) __(bne cr0,macro_label(not_misc)) __(extract_subtag($1,$2)) macro_label(not_misc): ')') define(`box_fixnum',` __(slri($1,$2,fixnumshift)) ') define(`unbox_fixnum',` __(srari($1,$2,fixnumshift)) ') define(`loaddf',` __(lfd $1,dfloat.value($2))') define(`storedf',` __(stfd $1,dfloat.value($2)) ') define(`push',` __(stru($1,-node_size($2))) ') /* Generally not a great idea. */ define(`pop',` __(ldr($1,0($2))) __(la $2,node_size($2)) ') define(`vpush',` __(push($1,vsp)) ') define(`vpop',` __(pop($1,vsp)) ') define(`unlink',` __(ldr($1,0($1))) ') define(`set_nargs',` __(lwi(nargs,($1)<