File:  [gforth] / gforth / cache1.vmg
Revision 1.5: download - view: text, annotated - select for diffs
Sun Jan 25 12:35:58 2004 UTC (15 years, 7 months ago) by anton
Branches: MAIN
CVS tags: HEAD
minore bugfixes (Makefile.in)
enabled 3-state stack caching for gforth-fast and gforth-native
   bugfixes (EXECUTE and PERFORM; spbREG use)
   explicit register allocation to spb for gforth-native, but not gforth-fast
   Due to the shortest-path algorithm this means that gforth-fast uses only
     S0 and S1, not S2, so we could keep that.
     However, we probably want to use more states etc. for other
     architectures, so we may want to have a way to select different
       cache.vmg and different peeprules.vmg files for different
       archs, builds, and binaries.

    1: \ stack cache setup
    2: 
    3: \ Copyright (C) 2003 Free Software Foundation, Inc.
    4: 
    5: \ This file is part of Gforth.
    6: 
    7: \ Gforth is free software; you can redistribute it and/or
    8: \ modify it under the terms of the GNU General Public License
    9: \ as published by the Free Software Foundation; either version 2
   10: \ of the License, or (at your option) any later version.
   11: 
   12: \ This program is distributed in the hope that it will be useful,
   13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15: \ GNU General Public License for more details.
   16: 
   17: \ You should have received a copy of the GNU General Public License
   18: \ along with this program; if not, write to the Free Software
   19: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
   20: 
   21: \E register IPTOS Cell
   22: \E register spTOS Cell
   23: \E register spb Cell
   24: \E register spc Cell
   25: \  \E register spd Cell
   26: 
   27: \E create IPregs IPTOS ,
   28: \E create regs spc , spb , spTOS ,
   29: \ \E create regs spTOS ,
   30: 
   31: \E IPregs 1 0 stack-state IPss1
   32: \E regs 3 cells + 0  -1 stack-state ss0
   33: \E regs 2 cells + 1  0 stack-state ss1
   34: \E regs 1 cells + 2  1 stack-state ss2
   35: \ \E regs 0 cells + 3  2 stack-state ss3
   36: \ \E regs 1 cells + 0 -1 stack-state ss0
   37: \ \E regs           1  0 stack-state ss1
   38: 
   39: \ the first of these is the default state (for now)
   40: \E state S1
   41: \E state S0
   42: \E state S2
   43: \ \E state S3
   44: 
   45: \E ss0 data-stack S0 set-ss
   46: \E ss1 data-stack S1 set-ss
   47: \E ss2 data-stack S2 set-ss
   48: \  \E ss3 data-stack S3 set-ss
   49: 
   50: \E IPss1 inst-stream S0 set-ss
   51: \E IPss1 inst-stream S1 set-ss
   52: \E IPss1 inst-stream S2 set-ss
   53: \  \E IPss1 inst-stream S3 set-ss
   54: 
   55: \E data-stack to cache-stack
   56: \E here 3 cache-states 2! s0 , s1 , s2 ,
   57: \ \E here 2 cache-states 2! s0 , s1 ,
   58: 
   59: \ !! the following should be automatic
   60: \E S1 to state-default
   61: \E state-default to state-in
   62: \E state-default to state-out

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