mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-20 02:30:23 +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:
parent
be415cc6a5
commit
82d90f4ddc
2 changed files with 25 additions and 4 deletions
|
@ -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>
|
2006-11-04 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
|
||||||
* lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.
|
* lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.
|
||||||
|
|
25
tests/rpn.c
25
tests/rpn.c
|
@ -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
|
/* This function does all of lexing, parsing, and picking a good
|
||||||
order of evaluation... Needless to say, this is not the best
|
order of evaluation... Needless to say, this is not the best
|
||||||
possible design, but it avoids cluttering everything with globals. */
|
possible design, but it avoids cluttering everything with globals. */
|
||||||
|
@ -181,6 +195,7 @@ compile_rpn (char *expr)
|
||||||
struct stack_element stack[32];
|
struct stack_element stack[32];
|
||||||
int sp = 0;
|
int sp = 0;
|
||||||
int curr_tos = -1; /* stack element currently in R0 */
|
int curr_tos = -1; /* stack element currently in R0 */
|
||||||
|
int spill_base, spill_sp;
|
||||||
|
|
||||||
pifi fn;
|
pifi fn;
|
||||||
int ofs;
|
int ofs;
|
||||||
|
@ -188,6 +203,8 @@ compile_rpn (char *expr)
|
||||||
jit_leaf (1);
|
jit_leaf (1);
|
||||||
ofs = jit_arg_i ();
|
ofs = jit_arg_i ();
|
||||||
|
|
||||||
|
spill_sp = spill_base = jit_allocai (32 * sizeof (int));
|
||||||
|
|
||||||
while (*expr)
|
while (*expr)
|
||||||
{
|
{
|
||||||
int with_imm;
|
int with_imm;
|
||||||
|
@ -333,7 +350,7 @@ compile_rpn (char *expr)
|
||||||
src2 = JIT_R0;
|
src2 = JIT_R0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
jit_popr_i (JIT_V0);
|
popr (JIT_V0, &spill_sp);
|
||||||
|
|
||||||
curr_tos = -1;
|
curr_tos = -1;
|
||||||
break;
|
break;
|
||||||
|
@ -350,7 +367,7 @@ compile_rpn (char *expr)
|
||||||
/* LHS is an immediate, check if we must spill the top of stack. */
|
/* LHS is an immediate, check if we must spill the top of stack. */
|
||||||
if (curr_tos != -1)
|
if (curr_tos != -1)
|
||||||
{
|
{
|
||||||
jit_pushr_i (JIT_R0);
|
pushr (JIT_R0, &spill_sp);
|
||||||
curr_tos = -1;
|
curr_tos = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +378,7 @@ compile_rpn (char *expr)
|
||||||
/* LHS is an expression, check if it is already in JIT_R0. */
|
/* LHS is an expression, check if it is already in JIT_R0. */
|
||||||
if (curr_tos != sp - 2)
|
if (curr_tos != sp - 2)
|
||||||
{
|
{
|
||||||
jit_popr_i (src1);
|
popr (src1, &spill_sp);
|
||||||
curr_tos = -1;
|
curr_tos = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -371,7 +388,7 @@ compile_rpn (char *expr)
|
||||||
case ARG:
|
case ARG:
|
||||||
if (curr_tos != -1)
|
if (curr_tos != -1)
|
||||||
{
|
{
|
||||||
jit_pushr_i (JIT_R0);
|
pushr (JIT_R0, &spill_sp);
|
||||||
curr_tos = -1;
|
curr_tos = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue