Diff for /gforth/prims2x.fs between versions 1.79 and 1.80

version 1.79, 2001/02/08 21:30:08 version 1.80, 2001/02/09 20:15:31
Line 40 Line 40
 \ add the store optimization for doubles  \ add the store optimization for doubles
 \ regarding problem 1 above: It would be better (for over) to implement  \ regarding problem 1 above: It would be better (for over) to implement
 \       the alternative  \       the alternative
   \ store optimization for combined instructions.
   \ eliminate stack-cast (no longer used)
   
   \ Design Uglyness:
   
   \ - global state (values, variables) in connection with combined instructions.
   
   \ - index computation is different for instruction-stream and the
   \ stacks; there are two mechanisms for dealing with that
   \ (stack-in-index-xt and a test for stack==instruction-stream); there
   \ should be only one.
   
 warnings off  warnings off
   
Line 253  Variable function-number 0 function-numb Line 264  Variable function-number 0 function-numb
 : complement ( set1 -- set2 )  : complement ( set1 -- set2 )
  empty ['] bit-equivalent binary-set-operation ;   empty ['] bit-equivalent binary-set-operation ;
   
 \ types  \ stack access stuff
   
   
 : normal-stack-access ( n stack -- )  : normal-stack-access ( n stack -- )
     stack-pointer 2@ type      stack-pointer 2@ type
Line 265  Variable function-number 0 function-numb Line 275  Variable function-number 0 function-numb
         drop ." TOS"          drop ." TOS"
     endif ;      endif ;
   
   \ forward declaration for inst-stream (breaks cycle in definitions)
   defer inst-stream-f ( -- stack )
   
 : part-stack-access { n stack -- }  : part-stack-access { n stack -- }
     \ print _<stack><x>, x=maxdepth-currentdepth-n-1      \ print _<stack><x>, x=inst-stream? n : maxdepth-currentdepth-n-1
     ." _" stack stack-pointer 2@ type      ." _" stack stack-pointer 2@ type
     stack stack-number @ { stack# }      stack stack-number @ { stack# }
     combined prim-stacks-in stack# th @ assert( dup max-depth stack# th @ = )      current-depth stack# th @ n + { access-depth }
     current-depth stack# th @ - n - 1-      stack inst-stream-f = if
           access-depth
       else
           combined prim-stacks-in stack# th @
           assert( dup max-depth stack# th @ = )
           access-depth - 1-
       endif
     0 .r ;      0 .r ;
   
 : stack-access ( n stack -- )  : stack-access ( n stack -- )
Line 468  s" fp" save-mem float-type s" "       ma Line 487  s" fp" save-mem float-type s" "       ma
 s" rp" save-mem cell-type  s" (Cell)" make-stack return-stack  s" rp" save-mem cell-type  s" (Cell)" make-stack return-stack
 s" IP" save-mem cell-type  s" error don't use # on results" make-stack inst-stream  s" IP" save-mem cell-type  s" error don't use # on results" make-stack inst-stream
 ' inst-in-index inst-stream stack-in-index-xt !  ' inst-in-index inst-stream stack-in-index-xt !
   ' inst-stream <is> inst-stream-f
 \ !! initialize stack-in and stack-out  \ !! initialize stack-in and stack-out
   
 \ offset computation  \ offset computation

Removed from v.1.79  
changed lines
  Added in v.1.80


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>