1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-19 18:20:22 +02:00

remove pushr/popr from testsuite

2006-11-04  Paolo Bonzini  <bonzini@gnu.org>

	* tests/rpn.c: Remove pushr/popr.

git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-37
This commit is contained in:
Paolo Bonzini 2006-11-06 09:24:36 +00:00
parent be415cc6a5
commit 82d90f4ddc
2 changed files with 25 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2006-11-04 Paolo Bonzini <bonzini@gnu.org>
* tests/rpn.c: Remove pushr/popr.
2006-11-04 Paolo Bonzini <bonzini@gnu.org>
* lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.

View file

@ -172,6 +172,20 @@ gen_reg_reg (int src1, int src2, int tok)
}
}
static void
pushr (int reg, int *sp)
{
jit_stxi_i (*sp, JIT_FP, reg);
*sp += sizeof (int);
}
static void
popr (int reg, int *sp)
{
*sp -= sizeof (int);
jit_ldxi_i (reg, JIT_FP, *sp);
}
/* This function does all of lexing, parsing, and picking a good
order of evaluation... Needless to say, this is not the best
possible design, but it avoids cluttering everything with globals. */
@ -181,6 +195,7 @@ compile_rpn (char *expr)
struct stack_element stack[32];
int sp = 0;
int curr_tos = -1; /* stack element currently in R0 */
int spill_base, spill_sp;
pifi fn;
int ofs;
@ -188,6 +203,8 @@ compile_rpn (char *expr)
jit_leaf (1);
ofs = jit_arg_i ();
spill_sp = spill_base = jit_allocai (32 * sizeof (int));
while (*expr)
{
int with_imm;
@ -333,7 +350,7 @@ compile_rpn (char *expr)
src2 = JIT_R0;
}
else
jit_popr_i (JIT_V0);
popr (JIT_V0, &spill_sp);
curr_tos = -1;
break;
@ -350,7 +367,7 @@ compile_rpn (char *expr)
/* LHS is an immediate, check if we must spill the top of stack. */
if (curr_tos != -1)
{
jit_pushr_i (JIT_R0);
pushr (JIT_R0, &spill_sp);
curr_tos = -1;
}
@ -361,7 +378,7 @@ compile_rpn (char *expr)
/* LHS is an expression, check if it is already in JIT_R0. */
if (curr_tos != sp - 2)
{
jit_popr_i (src1);
popr (src1, &spill_sp);
curr_tos = -1;
}
else
@ -371,7 +388,7 @@ compile_rpn (char *expr)
case ARG:
if (curr_tos != -1)
{
jit_pushr_i (JIT_R0);
pushr (JIT_R0, &spill_sp);
curr_tos = -1;
}