Correct implementation problems on ix86. - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/jit_ppc-cpu.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月03日 09:40:08 -0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月03日 09:40:08 -0200
commit712877a5a4c967e0db6a6ce4e92162c9a9056192 (patch)
tree9746a00db98bdc684aa6c0e122e822c70eaef597 /lib/jit_ppc-cpu.c
parente6f1df7124f6061f123881300560cf1899bf140b (diff)
downloadlightning-712877a5a4c967e0db6a6ce4e92162c9a9056192.tar.gz
Correct implementation problems on ix86.
* check/all.tst, check/lightning.c: Only declare or use 64 bit interfaces on 64 bit builds. * check/fib.tst: Use simpler logic to not need preprocessor conditionals for 32 or 64 bit. * include/lightning.h: Only declare 64 bit macros on a 64 bit build. Code using lightning must know about wordsize and the jit generation limitations, also, this way it generates a compile time failure, not a runtime assertion. * include/lightning/jit_x86.h: Correct typo in macro name. * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c, lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c, lib/jit_x86.c, lib/jit_x86-cpu.c: Correct wrong code to get current jit function pointer. * lib/lightning.c: Move call to the simplify() optimization to after register liveness is known. Previous code did work by accident but now with proper test cases the problem was noticed. * lib/jit_disasm.c: Always cast bfd_vma to long long when passing it as printf argument.
Diffstat (limited to 'lib/jit_ppc-cpu.c')
-rw-r--r--lib/jit_ppc-cpu.c 18
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/jit_ppc-cpu.c b/lib/jit_ppc-cpu.c
index 3e746bf..4cfa561 100644
--- a/lib/jit_ppc-cpu.c
+++ b/lib/jit_ppc-cpu.c
@@ -2210,11 +2210,7 @@ static void
_prolog(jit_state_t *_jit, jit_node_t *node)
{
unsigned long regno;
- jit_function_t *function;
- jit_pointer_t *functions;
- functions = _jit->functions->v.obj;
- function = functions[node->u.w];
subi(_SP_REGNO, _SP_REGNO, stack_framesize);
/* return address */
MFLR(_R0_REGNO);
@@ -2223,34 +2219,30 @@ _prolog(jit_state_t *_jit, jit_node_t *node)
/* save any clobbered callee save fpr register */
/* FIXME actually, no "clean" interface to use these registers */
for (regno = _F31; regno >= _F14; regno--) {
- if (jit_regset_tstbit(function->regset, regno))
+ if (jit_regset_tstbit(_jit->function->regset, regno))
stxi_d(stack_framesize - rn(regno) * 8, _SP_REGNO, regno);
}
/* save any clobbered callee save gpr register */
- regno = jit_regset_scan1(function->regset, _R14);
+ regno = jit_regset_scan1(_jit->function->regset, _R14);
if (regno == ULONG_MAX || regno > _R31)
regno = _R31; /* aka _FP_REGNO */
STMW(regno, _SP_REGNO, rn(regno) * 4 + 8);
movr(_FP_REGNO, _SP_REGNO);
/* alloca and/or space for excess parameters */
- subi(_SP_REGNO, _SP_REGNO, function->stack);
+ subi(_SP_REGNO, _SP_REGNO, _jit->function->stack);
}
static void
_epilog(jit_state_t *_jit, jit_node_t *node)
{
unsigned long regno;
- jit_function_t *function;
- jit_pointer_t *functions;
- functions = _jit->functions->v.obj;
- function = functions[node->w.w];
movr(_SP_REGNO, _FP_REGNO);
for (regno = _F31; regno >= _F14; regno--) {
- if (jit_regset_tstbit(function->regset, regno))
+ if (jit_regset_tstbit(_jit->function->regset, regno))
ldxi_d(regno, _SP_REGNO, stack_framesize - rn(regno) * 8);
}
- regno = jit_regset_scan1(function->regset, _R14);
+ regno = jit_regset_scan1(_jit->function->regset, _R14);
if (regno == ULONG_MAX || regno > _R31)
regno = _R31; /* aka _FP_REGNO */
LMW(rn(regno), _SP_REGNO, regno * 4 + 8);
generated by cgit v1.2.3 (git 2.39.1) at 2025年10月02日 10:35:50 +0000

AltStyle によって変換されたページ (->オリジナル) /