home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / lisp / liszt / func.l < prev    next >
Encoding:
Text File  |  1987-12-15  |  16.5 KB  |  587 lines

  1. (include-if (null (get 'chead 'version)) "../chead.l")
  2. (Liszt-file func
  3.    "$Header: func.l,v 1.14 87/12/15 17:02:38 sklower Exp $")
  4.  
  5. ;;; ----    f u n c                function compilation
  6. ;;;
  7. ;;;            -[Wed Aug 24 10:51:11 1983 by layer]-
  8.  
  9. ; cm-ncons :: macro out an ncons expression
  10. ;
  11. (defun cm-ncons nil
  12.   `(cons ,(cadr v-form) nil))
  13.  
  14. ; cc-not :: compile a "not" or "null" expression
  15. ;
  16. (defun cc-not nil
  17.   (makecomment '(beginning not))
  18.   (if (null g-loc)
  19.       then (let ((g-cc (cons (cdr g-cc) (car g-cc)))
  20.          (g-ret nil))
  21.         (d-exp (cadr v-form)))
  22.       else (let ((finlab (d-genlab))
  23.          (finlab2 (d-genlab))
  24.          (g-ret nil))
  25.         ; eval arg and jump to finlab if nil
  26.         (let ((g-cc (cons finlab nil))
  27.               g-loc)
  28.              (d-exp (cadr v-form)))
  29.         ; didn't jump, answer must be t
  30.         (d-move 'T g-loc)
  31.         (if (car g-cc)
  32.             then (e-goto (car g-cc))
  33.             else (e-goto finlab2))
  34.         (e-label finlab)
  35.         ; answer is nil
  36.         (d-move 'Nil g-loc)
  37.         (if (cdr g-cc) then (e-goto (cdr g-cc)))
  38.         (e-label finlab2))))
  39.  
  40. ;--- cc-numberp :: check for numberness
  41. ;
  42. (defun cc-numberp nil
  43.   (d-typecmplx (cadr v-form) 
  44.            '#.(immed-const (plus 1_2 1_4 1_9))))
  45.  
  46. ;--- cc-or :: compile an "or" expression
  47. ;
  48. (defun cc-or nil
  49.   (let ((finlab (d-genlab))
  50.     (finlab2)
  51.     (exps (if (cdr v-form) thenret else '(nil)))) ; (or) => nil
  52.        (if (null (car g-cc))
  53.        then (d-exp (do ((g-cc (cons finlab nil))
  54.                 (g-loc (if g-loc then 'reg))
  55.                 (g-ret nil)
  56.                 (ll exps (cdr ll)))
  57.                ((null (cdr ll)) (car ll))
  58.                (d-exp (car ll))))
  59.         (if g-loc
  60.             then (setq finlab2 (d-genlab))
  61.              (e-goto finlab2)
  62.              (e-label finlab)
  63.              (d-move 'reg g-loc)
  64.              (e-label finlab2)
  65.             else (e-label finlab))
  66.        else (if (null g-loc) then (setq finlab (car g-cc)))
  67.         (d-exp (do ((g-cc (cons finlab nil))
  68.                 (g-loc (if g-loc then 'reg))
  69.                 (g-ret nil)
  70.                 (ll exps (cdr ll)))
  71.                ((null (cdr ll)) (car ll))
  72.                (d-exp (car ll))))
  73.         (if g-loc
  74.             then (setq finlab2 (d-genlab))
  75.              (e-goto finlab2)
  76.              (e-label finlab)
  77.              (d-move 'reg g-loc)
  78.              (e-goto (car g-cc))    ; result is t
  79.              (e-label finlab2)))
  80.        (d-clearreg)))  ;we are not sure of the state due to possible branches.
  81.                    
  82. ;--- c-prog :: compile a "prog" expression
  83. ;
  84. ; for interlisp compatibility, we allow the formal variable list to
  85. ; contain objects of this form (vrbl init) which gives the initial value
  86. ; for that variable (instead of nil)
  87. ;
  88. (defun c-prog nil
  89.    (let ((g-decls g-decls))
  90.       (let (g-loc g-cc seeninit initf
  91.         (p-rettrue g-ret) (g-ret nil)
  92.         ((spcs locs initsv . initsn) (d-classify (cadr v-form))))
  93.  
  94.      (e-pushnil (length locs))    ; locals initially nil
  95.      (d-bindprg spcs locs)        ; bind locs and specs
  96.  
  97.      (cond (initsv (d-pushargs initsv)
  98.                (mapc '(lambda (x)
  99.                  (d-move 'unstack (d-loc x))
  100.                  (decr g-loccnt)
  101.                  (unpush g-locs))
  102.                  (nreverse initsn))))
  103.  
  104.      ; determine all possible labels
  105.      (do ((ll (cddr v-form) (cdr ll))
  106.           (labs nil))
  107.          ((null ll) (setq g-labs `((,(d-genlab) ,@labs)
  108.                        ,@g-labs)))
  109.          (if (and (car ll) (symbolp (car ll)))
  110.         then (if (assq (car ll) labs)
  111.             then (comp-err "label is mulitiply defined " (car ll))
  112.             else (setq labs (cons (cons (car ll) (d-genlab))
  113.                           labs)))))
  114.  
  115.      ; compile each form which is not a label
  116.      (d-clearreg)        ; unknown state after binding
  117.      (do ((ll (cddr v-form) (cdr ll)))
  118.          ((null ll))
  119.          (if (or (null (car ll)) (not (symbolp (car ll))))
  120.         then (d-exp (car ll))
  121.         else (e-label (cdr (assq (car ll) (cdar g-labs))))
  122.              (d-clearreg))))        ; dont know state after label
  123.  
  124.       ; result is nil if fall out and care about value
  125.       (if (or g-cc g-loc) then (d-move 'Nil 'reg))
  126.  
  127.       (e-label (caar g-labs))        ; return to label
  128.       (setq g-labs (cdr g-labs))
  129.       (d-unbind)))            ; unbind our frame
  130.  
  131. ;--- d-bindprg :: do binding for a prog expression
  132. ;    - spcs : list of special variables
  133. ;    - locs : list of local variables
  134. ;    - specinit : init values for specs (or nil if all are nil)
  135. ;
  136. (defun d-bindprg (spcs locs)
  137.    ; place the local vrbls and prog frame entry on the stack
  138.    (setq g-loccnt (+ g-loccnt (length locs))
  139.      g-locs (nconc locs `((prog . ,(length spcs)) ,@g-locs)))
  140.  
  141.    ; now bind the specials, if any, to nil
  142.    (if spcs then (e-setupbind)
  143.        (mapc '(lambda (vrb)
  144.           (e-shallowbind vrb 'Nil))
  145.          spcs)
  146.        (e-unsetupbind)))
  147.  
  148. ;--- d-unbind :: remove one frame from g-locs
  149. ;
  150. (defun d-unbind nil
  151.    (do ((count 0 (1+ count)))
  152.        ((dtpr (car g-locs))
  153.     (if (not (zerop (cdar g-locs)))
  154.         then (e-unshallowbind (cdar g-locs)))
  155.     (cond ((not (zerop count))
  156.            (e-dropnp count)
  157.  
  158.            (setq g-loccnt (- g-loccnt count))))
  159.     (setq g-locs (cdr g-locs)))
  160.        (setq g-locs (cdr g-locs))))
  161.     
  162. ;--- d-classify :: seperate variable list into special and non-special
  163. ;    - lst : list of variables
  164. ; returns ( xxx yyy zzz . aaa) 
  165. ;        where xxx is the list of special variables and
  166. ;        yyy is the list of local variables
  167. ;        zzz are the non nil initial values for prog variables
  168. ;        aaa are the names corresponding to the values in zzz
  169. ;
  170. (defun d-classify (lst)
  171.    (do ((ll lst (cdr ll))
  172.     (locs) (spcs) (init) (initsv) (initsn)
  173.     (name))
  174.        ((null ll) (cons spcs (cons locs (cons initsv initsn))))
  175.        (if (atom (car ll))
  176.        then (setq name (car ll))
  177.        else (setq name (caar ll))
  178.         (push name initsn)
  179.         (push (cadar ll) initsv))
  180.        (if (d-specialp name)
  181.        then (push name spcs)
  182.        else (push name locs))))
  183.  
  184. ; cm-progn :: compile a "progn" expression
  185. ;
  186. (defun cm-progn nil
  187.   `((lambda nil ,@(cdr v-form))))
  188.  
  189. ; cm-prog1 :: compile a "prog1" expression
  190. ;
  191. (defun cm-prog1 nil
  192.   (let ((gl (d-genlab)))
  193.        `((lambda (,gl) 
  194.          ,@(cddr v-form)
  195.          ,gl)
  196.      ,(cadr v-form))))
  197.  
  198. ; cm-prog2 :: compile a "prog2" expression
  199. ;
  200. (defun cm-prog2 nil
  201.    (let ((gl (d-genlab)))
  202.        `((lambda (,gl)
  203.          ,(cadr v-form)
  204.          (setq ,gl ,(caddr v-form))
  205.          ,@(cdddr v-form)
  206.          ,gl)
  207.      nil)))
  208.  
  209. ;--- cm-progv :: compile a progv form
  210. ;  a progv form looks like (progv 'l-vars 'l-inits 'g-exp1 ... 'g-expn)
  211. ; l-vars should be a list of variables, l-inits a list of initial forms
  212. ; We cannot permit returns and go-s through this form.
  213. ;
  214. ; we stack a (progv . 0) form on g-locs so that return and go will know
  215. ; not to try to go through this form.
  216. ;
  217. (defun c-progv nil
  218.    (let ((gl (d-genlab))
  219.      (g-labs (cons nil g-labs))
  220.      (g-locs (cons '(progv . 0) g-locs)))
  221.        (d-exp `((lambda (,gl)
  222.             (prog1 (progn ,@(cdddr v-form))
  223.                (internal-unbind-vars ,gl)))
  224.         (internal-bind-vars ,(cadr v-form) ,(caddr v-form))))))
  225.  
  226. (defun c-internal-bind-vars nil
  227.    (let ((g-locs g-locs)
  228.      (g-loccnt g-loccnt))
  229.        (d-pushargs (cdr v-form))
  230.        (d-calldirect '_Ibindvars (length (cdr v-form)))))
  231.  
  232. (defun c-internal-unbind-vars nil
  233.    (let ((g-locs g-locs)
  234.      (g-loccnt g-loccnt))
  235.        (d-pushargs (cdr v-form))
  236.        (d-calldirect '_Iunbindvars (length (cdr v-form)))))
  237.  
  238. ;--- cc-quote : compile a "quote" expression
  239. ; if we are just looking to set the ; cc, we just make sure 
  240. ; we set the cc depending on whether the expression quoted is
  241. ; nil or not.
  242. (defun cc-quote nil
  243.    (let ((arg (cadr v-form))
  244.      argloc)
  245.        (if (null g-loc) 
  246.        then (if (and (null arg) (cdr g-cc))
  247.             then (e-goto (cdr g-cc))
  248.          elseif (and arg (car g-cc))
  249.             then (e-goto (car g-cc))
  250.          elseif (null g-cc)
  251.             then (comp-warn "losing the value of this expression "
  252.                     (or v-form)))
  253.        else (d-move (d-loclit arg nil) g-loc)
  254.         (d-handlecc))))
  255.  
  256. ;--- c-setarg :: set a lexpr's arg
  257. ; form is (setarg index value)
  258. ;
  259. (defun c-setarg nil
  260.    (if (not (eq 'lexpr g-ftype))
  261.        then (comp-err "setarg only allowed in lexprs"))
  262.    (if (and fl-inter (eq (length (cdr v-form)) 3))    ; interlisp setarg
  263.        then (if (not (eq (cadr v-form) (car g-args)))
  264.         then (comp-err "setarg: can only compile local setargs "
  265.                    v-form)
  266.         else (setq v-form (cdr v-form))))
  267.    ; compile index into fixnum-reg, was (d-pushargs (list (cadr v-form)))
  268.    (let ((g-cc) (g-ret)
  269.      (g-loc '#.fixnum-reg))
  270.        (d-exp (cadr v-form)))
  271.    (let ((g-loc 'reg)
  272.      (g-cc nil)
  273.      (g-ret nil))
  274.        (d-exp (caddr v-form)))
  275.    #+(or for-vax for-tahoe)
  276.    (progn
  277.        (e-sub3 `(* -4 #.olbot-reg) '(0 #.fixnum-reg) '#.fixnum-reg)
  278.        (e-move 'r0 '(-8 #.olbot-reg #.fixnum-reg)))
  279.    #+for-68k
  280.    (progn
  281.        (e-sub `(-4 #.olbot-reg) '#.fixnum-reg)
  282.        (e-write3 'lea '(% -8 #.olbot-reg #.fixnum-reg) 'a5)
  283.        (e-move 'd0 '(0 a5))))
  284.  
  285. ;--- cc-stringp :: check for string ness
  286. ;
  287. (defun cc-stringp nil
  288.   (d-typesimp (cadr v-form) #.(immed-const 0)))
  289.  
  290. ;--- cc-symbolp :: check for symbolness
  291. ;
  292. (defun cc-symbolp nil
  293.   (d-typesimp (cadr v-form) #.(immed-const 1)))
  294.  
  295. ;--- c-return :: compile a "return" statement
  296. ;
  297. (defun c-return nil
  298.    ; value is always put in reg
  299.    (let ((g-loc 'reg)
  300.      g-cc
  301.      g-ret)
  302.        (d-exp (cadr v-form)))
  303.  
  304.    ; if we are doing a non local return, compute number of specials to unbind
  305.    ; and locals to pop
  306.    (if (car g-labs)
  307.        then (e-goto (caar g-labs))
  308.        else (do ((loccnt 0)        ;; locals
  309.          (speccnt 0)        ;; special
  310.          (catcherrset 0)        ;; catch/errset frames
  311.          (ll g-labs (cdr ll))
  312.          (locs g-locs))
  313.         ((null ll) (comp-err "return used not within a prog or do"))
  314.         (if (car ll)
  315.             then  (comp-note g-fname ": non local return used ")
  316.              ; unbind down to but not including
  317.              ; this frame.
  318.              (if (greaterp loccnt 0)
  319.                  then (e-pop loccnt))
  320.              (if (greaterp speccnt 0)
  321.                  then (e-unshallowbind speccnt))
  322.              (if (greaterp catcherrset 0)
  323.                  then (comp-note
  324.                       g-fname
  325.                       ": return through a catch or errset"
  326.                       v-form)
  327.                   (do ((i 0 (1+ i)))
  328.                       ((=& catcherrset i))
  329.                       (d-popframe)))
  330.              (e-goto (caar ll))
  331.              (return)
  332.             else ; determine number of locals and special on
  333.              ; stack for this frame, add to running
  334.              ; totals
  335.              (do ()
  336.                  ((dtpr (car locs))
  337.                   (if (eq 'catcherrset (caar locs)) ; catchframe
  338.                   then (incr catcherrset)
  339.                    elseif (eq 'progv (caar locs))
  340.                   then (comp-err "Attempt to 'return' through a progv"))
  341.                   (setq speccnt (+ speccnt (cdar locs))
  342.                     locs (cdr locs)))
  343.                  (incr loccnt)
  344.                  (setq locs (cdr locs)))))))
  345.      
  346. ; c-rplaca :: compile a "rplaca" expression
  347. ;
  348. #+(or for-vax for-tahoe)
  349. (defun c-rplaca nil
  350.   (let ((ssimp (d-simple (caddr v-form)))
  351.     (g-ret nil))
  352.        (let ((g-loc (if ssimp then 'reg else 'stack))
  353.          (g-cc nil))
  354.         (d-exp (cadr v-form)))
  355.        (if (null ssimp)
  356.        then (push nil g-locs)
  357.         (incr g-loccnt)
  358.         (let ((g-loc 'r1)
  359.               (g-cc nil))
  360.             (d-exp (caddr v-form)))
  361.         (d-move 'unstack 'reg)
  362.         (unpush g-locs)
  363.         (decr g-loccnt)
  364.         (e-move 'r1 '(4 r0))
  365.        else (e-move (e-cvt ssimp)  '(4 r0)))
  366.        (d-clearreg)))        ; cant tell what we are clobbering
  367.  
  368. #+for-68k
  369. (defun c-rplaca nil
  370.    (let ((ssimp (d-simple (caddr v-form)))
  371.      (g-ret nil))
  372.        (makecomment `(c-rplaca starting :: v-form = ,v-form))
  373.        (let ((g-loc (if ssimp then 'areg else 'stack))
  374.          (g-cc nil))
  375.        (d-exp (cadr v-form)))
  376.        (if (null ssimp)
  377.        then (push nil g-locs)
  378.         (incr g-loccnt)
  379.         (let ((g-loc 'd1)
  380.               (g-cc nil))
  381.             (d-exp (caddr v-form)))
  382.         (d-move 'unstack 'areg)
  383.         (unpush g-locs)
  384.         (decr g-loccnt)
  385.         (e-move 'd1 '(4 a0))
  386.        else (e-move (e-cvt ssimp)  '(4 a0)))
  387.        (e-move 'a0 'd0)
  388.        (d-clearreg)
  389.        (makecomment `(c-rplaca done))))
  390.  
  391. ; c-rplacd :: compile a "rplacd" expression
  392. ;
  393. #+(or for-vax for-tahoe)
  394. (defun c-rplacd nil
  395.   (let ((ssimp (d-simple (caddr v-form)))
  396.     (g-ret nil))
  397.        (let ((g-loc (if ssimp then 'reg else 'stack))
  398.          (g-cc nil))
  399.         (d-exp (cadr v-form)))
  400.        (if (null ssimp)
  401.        then (push nil g-locs)
  402.         (incr g-loccnt)
  403.         (let ((g-loc 'r1)
  404.               (g-cc nil))
  405.             (d-exp (caddr v-form)))
  406.         (d-move 'unstack 'reg)
  407.         (unpush g-locs)
  408.         (decr g-loccnt)
  409.         (e-move 'r1 '(0 r0))
  410.        else (e-move (e-cvt ssimp)  '(0 r0)))
  411.        (d-clearreg)))
  412.  
  413. #+for-68k
  414. (defun c-rplacd nil
  415.    (let ((ssimp (d-simple (caddr v-form)))
  416.      (g-ret nil))
  417.        (makecomment `(c-rplacd starting :: v-form = ,v-form))
  418.        (let ((g-loc (if ssimp then 'areg else 'stack))
  419.          (g-cc nil))
  420.        (d-exp (cadr v-form)))
  421.        (if (null ssimp)
  422.        then (push nil g-locs)
  423.         (incr g-loccnt)
  424.         (let ((g-loc 'd1)
  425.               (g-cc nil))
  426.             (d-exp (caddr v-form)))
  427.         (d-move 'unstack 'areg)
  428.         (unpush g-locs)
  429.         (decr g-loccnt)
  430.         (e-move 'd1 '(0 a0))
  431.        else (e-move (e-cvt ssimp) '(0 a0)))
  432.        (e-move 'a0 'd0)
  433.        (d-clearreg)
  434.        (makecomment `(d-rplacd done))))
  435.  
  436. ;--- cc-setq :: compile a "setq" expression
  437. ;
  438. (defun cc-setq nil
  439.   (prog nil
  440.   (let (tmp tmp2)
  441.        (if (null (cdr v-form)) 
  442.         then (d-exp nil)  ; (setq) 
  443.          (return)
  444.         elseif (oddp (length (cdr v-form)))
  445.        then (comp-err "wrong number of args to setq "
  446.               (or v-form))
  447.     elseif (cdddr v-form)        ; if multiple setq's
  448.        then (do ((ll (cdr v-form) (cddr ll))
  449.              (g-loc)
  450.              (g-cc nil))
  451.             ((null (cddr ll)) (setq tmp ll))
  452.             (setq g-loc (d-locv (car ll)))
  453.             (d-exp (cadr ll))
  454.             (d-clearuse (car ll)))
  455.     else (setq tmp (cdr v-form)))
  456.  
  457.        ; do final setq
  458.        (let ((g-loc (d-locv (car tmp)))
  459.          (g-cc (if g-loc then nil else g-cc))
  460.          (g-ret nil))
  461.         (d-exp (cadr tmp))
  462.         (d-clearuse (car tmp)))
  463.        (if g-loc
  464.        then (d-move (setq tmp2 (d-locv (car tmp))) g-loc)
  465.         (if g-cc
  466.             then #+for-68k (d-cmpnil tmp2)
  467.              (d-handlecc))))))
  468.  
  469. ; cc-typep :: compile a "typep" expression
  470. ; this returns the type of the expression, it is always non nil
  471. ;
  472. #+(or for-vax for-tahoe)
  473. (defun cc-typep nil
  474.   (let ((argloc (d-simple (cadr v-form)))
  475.     (g-ret))
  476.        (if (null argloc)
  477.        then (let ((g-loc 'reg) g-cc)
  478.             (d-exp (cadr v-form)))
  479.         (setq argloc 'reg))
  480.        (if g-loc
  481.        then #+for-vax (e-write4 'ashl '($ -9) (e-cvt argloc) 'r0)
  482.             #+for-tahoe (e-write4 'shar '($ 9) (e-cvt argloc) 'r0)
  483.         (e-write3 'cvtbl "_typetable+1[r0]" 'r0)
  484.         (e-move "_tynames+4[r0]" 'r0)
  485.         (e-move '(0 r0) (e-cvt g-loc)))
  486.        (if (car g-cc) then (e-goto (car g-cc)))))
  487.  
  488. #+for-68k
  489. (defun cc-typep nil
  490.   (let ((argloc (d-simple (cadr v-form)))
  491.     (g-ret))
  492.        (if (null argloc) 
  493.        then (let ((g-loc 'reg) g-cc)
  494.             (d-exp (cadr v-form)))
  495.         (setq argloc 'reg))
  496.        (if g-loc
  497.        then (e-move (e-cvt argloc) 'd0)
  498.         (e-sub '#.nil-reg 'd0)
  499.         (e-write3 'moveq '($ 9) 'd1)
  500.         (e-write3 'asrl 'd1 'd0)
  501.         (e-write3 'lea '"_typetable+1" 'a5)
  502.         (e-add 'd0 'a5)
  503.         (e-write3 'movb '(0 a5) 'd0)
  504.         (e-write2 'extw 'd0)
  505.         (e-write2 'extl 'd0)
  506.         (e-write3 'asll '($ 2) 'd0)
  507.         (e-write3 'lea "_tynames+4" 'a5)
  508.         (e-add 'd0 'a5)
  509.         (e-move '(0 a5) 'a5)
  510.         (e-move '(0 a5) (e-cvt g-loc)))
  511.        (if (car g-cc) then (e-goto (car g-cc)))))
  512.  
  513. ; cm-symeval :: compile a symeval expression.
  514. ; the symbol cell in franz lisp is just the cdr.
  515. ;
  516. (defun cm-symeval nil
  517.   `(cdr ,(cadr v-form)))
  518.  
  519. ; c-*throw :: compile a "*throw" expression
  520. ;
  521. ; the form of *throw is (*throw 'tag 'val) .
  522. ; we calculate and stack the value of tag, then calculate val 
  523. ; we call Idothrow to do the actual work, and only return if the
  524. ; throw failed.
  525. ;
  526. (defun c-*throw nil
  527.   (let ((arg2loc (d-simple (caddr v-form)))
  528.     g-cc
  529.     g-ret
  530.     arg1loc)
  531.        ; put on the C runtime stack value to throw, and
  532.        ; tag to throw to.
  533.        (if arg2loc
  534.        then (if (setq arg1loc (d-simple (cadr v-form)))
  535.             then (C-push (e-cvt arg2loc))
  536.              (C-push (e-cvt arg1loc))
  537.             else (let ((g-loc 'reg))
  538.                  (d-exp (cadr v-form))    ; calc tag
  539.                  (C-push (e-cvt arg2loc))
  540.                  (C-push (e-cvt 'reg))))
  541.        else (let ((g-loc 'stack))
  542.             (d-exp (cadr v-form))    ; calc tag to stack
  543.             (push nil g-locs)
  544.             (incr g-loccnt)
  545.             (setq g-loc 'reg)
  546.             (d-exp (caddr v-form))    ; calc value into reg
  547.             (C-push (e-cvt 'reg))
  548.             (C-push (e-cvt 'unstack))
  549.             (unpush g-locs)
  550.             (decr g-loccnt)))
  551.        ; now push the type of non local go we are doing, in this case
  552.        ; it is a C_THROW
  553.        (C-push '($ #.C_THROW))
  554.        #+for-vax
  555.        (e-write3 'calls '$3 '_Inonlocalgo)
  556.        #+for-tahoe
  557.        (e-write3 'callf '$16 '_Inonlocalgo)
  558.        #+for-68k
  559.        (e-quick-call '_Inonlocalgo)))
  560.  
  561. ;--- cm-zerop ::  convert zerop to a quick test
  562. ; zerop is only allowed on fixnum and flonum arguments.  In both cases,
  563. ; if the value of the first 32 bits is zero, then we have a zero.
  564. ; thus we can define it as a macro:
  565. #+(or for-vax for-tahoe)
  566. (defun cm-zerop nil
  567.   (cond ((atom (cadr v-form))
  568.      `(and (null (cdr ,(cadr v-form))) (not (bigp ,(cadr v-form)))))
  569.     (t (let ((gnsy (gensym)))
  570.         `((lambda (,gnsy)
  571.               (and (null (cdr ,gnsy)) 
  572.                 (not (bigp ,gnsy))))
  573.           ,(cadr v-form))))))
  574.  
  575. #+for-68k
  576. (defun cm-zerop nil
  577.    (cond ((atom (cadr v-form))
  578.       `(and (=& 0 ,(cadr v-form))    ;was (cdr ,(cadr v-form))
  579.         (not (bigp ,(cadr v-form)))))
  580.      (t (let ((gnsy (gensym)))
  581.         `((lambda (,gnsy)
  582.               (and (=& 0 ,gnsy)        ;was (cdr ,gnsy)
  583.                (not (bigp ,gnsy))))
  584.           ,(cadr v-form))))))
  585.