diff --git a/mach/sparc/ce/EM_table.x b/mach/sparc/ce/EM_table.x index 1194d33a8..b79b7e204 100644 --- a/mach/sparc/ce/EM_table.x +++ b/mach/sparc/ce/EM_table.x @@ -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(); diff --git a/mach/sparc/ce/Makefile b/mach/sparc/ce/Makefile index 94b961361..9bbc66697 100644 --- a/mach/sparc/ce/Makefile +++ b/mach/sparc/ce/Makefile @@ -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 diff --git a/mach/sparc/ce/mach.h b/mach/sparc/ce/mach.h index 741ff607d..c652f98b8 100644 --- a/mach/sparc/ce/mach.h +++ b/mach/sparc/ce/mach.h @@ -5,6 +5,12 @@ mach.h #ifndef MACH_H #define MACH_H +#ifdef __solaris__ +#include +#else +#include +#endif + #define alloc_double B_alloc_double #define alloc_double_var B_allc_double_var #define alloc_float B_alloc_float diff --git a/mach/sparc/ce/mach_em.h b/mach/sparc/ce/mach_em.h index bf9f2d626..b9625f5cd 100644 --- a/mach/sparc/ce/mach_em.h +++ b/mach/sparc/ce/mach_em.h @@ -1,14 +1,12 @@ /*#define DEBUG 1 /* define when debugging */ -#ifdef __solaris__ -#include -#else -#include -#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 diff --git a/mach/sparc/ce/proto.make b/mach/sparc/ce/proto.make index c25b68f2a..0b3c73643 100644 --- a/mach/sparc/ce/proto.make +++ b/mach/sparc/ce/proto.make @@ -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: