Fix: sometimes wrote register gotten from pop_reg(); Fix: WINDOWSIZE; Fix: make distr

This commit is contained in:
ceriel 1994-10-25 16:14:08 +00:00
parent d992ed4935
commit 4c26480d25
5 changed files with 51 additions and 35 deletions

View file

@ -287,7 +287,8 @@ C_los
arg_error ("loi", size); arg_error ("loi", size);
} }
else { else {
a = pop_reg(); /* count */ a = alloc_reg(); /* count */
pop_reg_as(a);
b = pop_reg(); /* addr */ b = pop_reg(); /* addr */
c = alloc_reg(); c = alloc_reg();
flush_cache(); flush_cache();
@ -1584,7 +1585,8 @@ C_zer_narg ==>
} }
else else
{ {
a= pop_reg(); a= alloc_reg();
pop_reg_as(a);
flush_cache(); flush_cache();
"sub $reg_sp, $a, $reg_sp"; "sub $reg_sp, $a, $reg_sp";
"1:" "1:"
@ -1618,7 +1620,8 @@ C_cii ==>
if (type_of_tos() != T_cst) if (type_of_tos() != T_cst)
{ {
a= pop_reg(); a= alloc_reg();
pop_reg_as(a);
b= pop_reg(); b= pop_reg();
} }
else else
@ -2843,7 +2846,8 @@ C_com_narg ==>
} }
else else
{ {
a= pop_reg(); a= alloc_reg();
pop_reg_as(a);
b= alloc_reg(); b= alloc_reg();
c= alloc_reg(); c= alloc_reg();
flush_cache(); flush_cache();
@ -2881,7 +2885,8 @@ C_rol
n= n % 32; n= n % 32;
if (n) if (n)
{ {
a= pop_reg(); a= alloc_reg();
pop_reg_as(a);
b= alloc_reg(); b= alloc_reg();
c= alloc_reg(); c= alloc_reg();
sprint(n_str, "%d", n); sprint(n_str, "%d", n);
@ -2897,8 +2902,10 @@ C_rol
} }
else else
{ {
a= pop_reg(); a= alloc_reg();
b= pop_reg(); pop_reg_as(a);
b= alloc_reg();
pop_reg_as(b);
c= alloc_reg(); c= alloc_reg();
d= alloc_reg(); d= alloc_reg();
"and $a, 31, $c"; "and $a, 31, $c";
@ -2940,7 +2947,8 @@ C_ror
n= n % 32; n= n % 32;
if (n) if (n)
{ {
a= pop_reg(); a= alloc_reg();
pop_reg_as(a);
b= alloc_reg(); b= alloc_reg();
c= alloc_reg(); c= alloc_reg();
sprint(n_str, "%d", n); sprint(n_str, "%d", n);
@ -2956,8 +2964,10 @@ C_ror
} }
else else
{ {
a= pop_reg(); a= alloc_reg();
b= pop_reg(); pop_reg_as(a);
b= alloc_reg();
pop_reg_as(b);
c= alloc_reg(); c= alloc_reg();
d= alloc_reg(); d= alloc_reg();
"and $a, 31, $c"; "and $a, 31, $c";
@ -3014,12 +3024,10 @@ C_inn_narg ==>
{ {
a= pop_reg(); a= pop_reg();
b= alloc_reg(); b= alloc_reg();
c= alloc_reg();
"srl $a, $i_str, $b"; "srl $a, $i_str, $b";
"and $b, 1, $c"; "and $b, 1, $b";
free_reg(a); free_reg(a);
free_reg(b); push_reg(b);
push_reg(c);
} }
} }
else else
@ -3028,10 +3036,10 @@ C_inn_narg ==>
b= pop_reg(); b= pop_reg();
c= alloc_reg(); c= alloc_reg();
"srl $b, $a, $c"; "srl $b, $a, $c";
"and $c, 1, $a"; "and $c, 1, $c";
push_reg(a); push_reg(c);
free_reg(b); free_reg(b);
free_reg(c); free_reg(a);
} }
} }
else if (n == 2*EM_WSIZE) else if (n == 2*EM_WSIZE)
@ -3162,8 +3170,10 @@ C_set_narg ==>
free_reg(d); free_reg(d);
} }
} else { } else {
a= pop_reg(); a= alloc_reg();
b= pop_reg(); pop_reg_as(a);
b= alloc_reg();
pop_reg_as(b);
flush_cache(); flush_cache();
c= alloc_reg(); c= alloc_reg();
d= alloc_reg(); d= alloc_reg();
@ -4144,7 +4154,8 @@ C_bls
else else
{ {
c= pop_reg(); /* size */ c= alloc_reg(); /* size */
pop_reg_as(c);
a= pop_reg(); /* dest */ a= pop_reg(); /* dest */
b= pop_reg(); /* src */ b= pop_reg(); /* src */
d= alloc_reg(); d= alloc_reg();

View file

@ -1,13 +1,14 @@
SED = sed SED = sed
M4 = m4 M4 = m4
CPP = /lib/cpp
all: EM_table cache.c all: EM_table cache.c
distr: all EM_table:
if [ -x /usr/ccs/lib/cpp ] ; then /usr/ccs/lib/cpp < EM_table.x -P | $(M4) | $(SED) -f cegpp > $@ ; else /lib/cpp < EM_table.x -P | $(M4) | $(SED) -f cegpp > $@ ; fi
EM_table: EM_table.x cegpp
$(CPP) < EM_table.x -P | $(M4) | $(SED) -f cegpp > $@
cache.c: cache.c.x cegpp cache.c:
$(SED) -f cegpp cache.c.x > $@ $(SED) -f cegpp cache.c.x > $@
distr:
rm -f EM_table cache.c
make all

View file

@ -5,6 +5,12 @@ mach.h
#ifndef MACH_H #ifndef MACH_H
#define MACH_H #define MACH_H
#ifdef __solaris__
#include <sys/asm_linkage.h>
#else
#include <sun4/asm_linkage.h>
#endif
#define alloc_double B_alloc_double #define alloc_double B_alloc_double
#define alloc_double_var B_allc_double_var #define alloc_double_var B_allc_double_var
#define alloc_float B_alloc_float #define alloc_float B_alloc_float

View file

@ -1,14 +1,12 @@
/*#define DEBUG 1 /* define when debugging */ /*#define DEBUG 1 /* define when debugging */
#ifdef __solaris__
#include <sys/asm_linkage.h>
#else
#include <sun4/asm_linkage.h>
#endif
#define BYTES_REVERSED #define BYTES_REVERSED
#define WORDS_REVERSED #define WORDS_REVERSED
#ifndef WINDOWSIZE
#define WINDOWSIZE (16*4)
#endif
#define ONE_BYTE int #define ONE_BYTE int
#define TWO_BYTES int #define TWO_BYTES int
#define FOUR_BYTES long #define FOUR_BYTES long

View file

@ -9,16 +9,16 @@ SRC_DIR = $(SRC_HOME)/mach/$(MACH)/ce
CEG = $(TARGET_HOME)/lib.bin/ceg/util CEG = $(TARGET_HOME)/lib.bin/ceg/util
all: all:
( cd $(SRC_DIR); make ) ( cd $(SRC_DIR); make CPP=$(UTIL_HOME)/lib.bin/cpp )
make -f $(CEG)/make_asobj "OBJ="$(OBJ) "MACH="$(MACH) make -f $(CEG)/make_asobj "OBJ="$(OBJ) "MACH="$(MACH)
install: install:
( cd $(SRC_DIR); make ) ( cd $(SRC_DIR); make CPP=$(UTIL_HOME)/lib.bin/cpp )
-mkdir $(TARGET_HOME)/lib.bin/sparc -mkdir $(TARGET_HOME)/lib.bin/sparc
make -f $(CEG)/make_asobj "OBJ="$(OBJ) "MACH="$(MACH) install make -f $(CEG)/make_asobj "OBJ="$(OBJ) "MACH="$(MACH) install
cmp: cmp:
( cd $(SRC_DIR); make ) ( cd $(SRC_DIR); make CPP=$(UTIL_HOME)/lib.bin/cpp )
-make -f $(CEG)/make_asobj "OBJ="$(OBJ) "MACH="$(MACH) cmp -make -f $(CEG)/make_asobj "OBJ="$(OBJ) "MACH="$(MACH) cmp
pr: pr: