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

View file

@ -1,13 +1,14 @@
SED = sed
M4 = m4
CPP = /lib/cpp
all: EM_table cache.c
distr: all
EM_table: EM_table.x cegpp
$(CPP) < EM_table.x -P | $(M4) | $(SED) -f cegpp > $@
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
cache.c: cache.c.x cegpp
cache.c:
$(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
#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_var B_allc_double_var
#define alloc_float B_alloc_float

View file

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

View file

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