Skip to content

Commit dcdb45e

Browse files
author
anton
committed
Added configure variable STACK_CACHE_REGS and set useful defaults
currently supported: 0-4 regs, default reg 0-4.
1 parent 2cd15cb commit dcdb45e

11 files changed

+120
-16
lines changed

Makefile.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ XLDFLAGS = @LDFLAGS@
113113
LDFLAGS = $(DEBUGFLAG) $(XLDFLAGS)
114114
LDLIBS = @LIBS@
115115

116+
STACK_CACHE_REGS = @STACK_CACHE_REGS@
116117
STACK_CACHE_DEFAULT_FAST = @STACK_CACHE_DEFAULT_FAST@
117118

118119
# ------------ Install Directories
@@ -763,8 +764,8 @@ prim.b: prim cache0.vmg
763764
$(M4) -Dcondbranch_opt=0 $(srcdir)/prim >$@
764765
sleep 1 #should make hpux-workaround unnecessary
765766

766-
prim-fast.b: prim cache-fast$(STACK_CACHE_DEFAULT_FAST).vmg peeprules.vmg Makefile.in
767-
$(M4) -Dcondbranch_opt=@condbranch_opt@ -DSTACK_CACHE_FILE=cache-fast$(STACK_CACHE_DEFAULT_FAST).vmg $(srcdir)/prim >$@
767+
prim-fast.b: prim cache-fast$(STACK_CACHE_DEFAULT_FAST).vmg cache-regs$(STACK_CACHE_REGS).vmg peeprules.vmg Makefile
768+
$(M4) -Dcondbranch_opt=@condbranch_opt@ -DSTACK_CACHE_FILE=cache-fast$(STACK_CACHE_DEFAULT_FAST).vmg -DSTACK_CACHE_REGS=cache-regs$(STACK_CACHE_REGS).vmg $(srcdir)/prim >$@
768769
sleep 1 #should make hpux-workaround unnecessary
769770

770771
$(FORTH_GEN_ENGINE_FAST): prim-fast.b prims2x.fs

cache-fast0.vmg

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,7 @@
5555
\E state S7
5656
\E state S8
5757

58-
\E S3 state-disable
59-
\E S4 state-disable
60-
\E S5 state-disable
61-
\E S6 state-disable
62-
\E S7 state-disable
63-
\E S8 state-disable
58+
include(STACK_CACHE_REGS)
6459

6560
\E ss0 data-stack S0 set-ss
6661
\E ss1 data-stack S1 set-ss

cache-fast1.vmg

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\ stack cache setup
1+
\ stack cache setup: default state S1
22

33
\ Copyright (C) 2003,2004,2005,2006,2007 Free Software Foundation, Inc.
44

@@ -59,12 +59,7 @@
5959
\E state S7
6060
\E state S8
6161

62-
\E S3 state-disable
63-
\E S4 state-disable
64-
\E S5 state-disable
65-
\E S6 state-disable
66-
\E S7 state-disable
67-
\E S8 state-disable
62+
include(STACK_CACHE_REGS)
6863

6964
\E ss0 data-stack S0 set-ss
7065
\E ss1 data-stack S1 set-ss

cache-fast2.vmg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
\E state S7
5656
\E state S8
5757

58+
include(STACK_CACHE_REGS)
59+
5860
\E ss0 data-stack S0 set-ss
5961
\E ss1 data-stack S1 set-ss
6062
\E ss2 data-stack S2 set-ss

cache-fast3.vmg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
\E state S7
5656
\E state S8
5757

58+
include(STACK_CACHE_REGS)
59+
5860
\E ss0 data-stack S0 set-ss
5961
\E ss1 data-stack S1 set-ss
6062
\E ss2 data-stack S2 set-ss

cache-fast4.vmg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
\E state S7
5656
\E state S8
5757

58+
include(STACK_CACHE_REGS)
59+
5860
\E ss0 data-stack S0 set-ss
5961
\E ss1 data-stack S1 set-ss
6062
\E ss2 data-stack S2 set-ss

cache-regs1.vmg

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
\ stack cache diablers: maximun state S1
2+
3+
\ Copyright (C) 2008 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 3
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, see http://www.gnu.org/licenses/.
19+
20+
\E S2 state-disable
21+
\E S3 state-disable
22+
\E S4 state-disable
23+
\E S5 state-disable
24+
\E S6 state-disable
25+
\E S7 state-disable
26+
\E S8 state-disable

cache-regs2.vmg

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
\ stack cache diablers: maximun state S2
2+
3+
\ Copyright (C) 2008 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 3
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, see http://www.gnu.org/licenses/.
19+
20+
\E S3 state-disable
21+
\E S4 state-disable
22+
\E S5 state-disable
23+
\E S6 state-disable
24+
\E S7 state-disable
25+
\E S8 state-disable

cache-regs3.vmg

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
\ stack cache diablers: maximun state S3
2+
3+
\ Copyright (C) 2008 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 3
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, see http://www.gnu.org/licenses/.
19+
20+
\E S4 state-disable
21+
\E S5 state-disable
22+
\E S6 state-disable
23+
\E S7 state-disable
24+
\E S8 state-disable

cache-regs4.vmg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
\ stack cache diablers: maximun state S4
2+
3+
\ Copyright (C) 2008 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 3
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, see http://www.gnu.org/licenses/.
19+
20+
\E S5 state-disable
21+
\E S6 state-disable
22+
\E S7 state-disable
23+
\E S8 state-disable

0 commit comments

Comments
 (0)