mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-08 22:50:27 +02:00
Implement new synthesized IR codes sequences
* lib/jit_rewind.c: New file implementing generic functions to "rewind", or rewrite IR code sequences. * include/lightning.h: Add several new codes, that previously were a function call, that would synthesize the operation. Now, there is a code for the operation, and a new flag to know an operation is synthesized. * include/lightning/jit_private.h: Add several new macros to help construct synthesized IR code sequences. * lib/Makefile.am: Update for lib/jit_rewind.c. * lib/jit_disasm.c: Update for a small rework on jit_node_t, so that --enable-devel-disassembler does not need a change in the layout of jit_node_t. * lib/jit_names.c: Update for the new codes. * lib/jit_print.c: Update to print more readable output, and flag synthesized IR code sequences. * lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_x86-sz.c, lib/jit_x86.c: Update for new synthesized IR code sequences. * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu., lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_s390-fpu.c, lib/jit_s390-sz.c, lib/jit_s390.c: Update for new synthesized IR code sequences and correct bugs in the initial varargs implementation support. * lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_sparc-sz.c, lib/jit_sparc.c: Add generic, untested support for the new synthesized IR code sequences. Known most likely broken right now, and should be corrected once access to these hosts is available. * lib/lightning.c: Update for new IR codes, and add support for not yet existing instructions that change third argument. * size.c: Change to use different tables for LE and BE PowerPC. Correct a wrong endif for x32.
This commit is contained in:
parent
7f1e0dfb34
commit
d0a5bd8d3d
35 changed files with 4397 additions and 1152 deletions
|
@ -32,6 +32,14 @@
|
|||
print_chr('?'); \
|
||||
print_str(_rvs[jit_regno(value)].name); \
|
||||
} while (0)
|
||||
#define print_arg(value) \
|
||||
do { \
|
||||
print_chr('#'); \
|
||||
if (value) \
|
||||
print_dec((value)->v.w); \
|
||||
else \
|
||||
print_chr('?'); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Initialization
|
||||
|
@ -84,19 +92,38 @@ _jit_print_node(jit_state_t *_jit, jit_node_t *node)
|
|||
return;
|
||||
}
|
||||
value = jit_classify(node->code) &
|
||||
(jit_cc_a0_int|jit_cc_a0_jmp|jit_cc_a0_reg|jit_cc_a0_rlh|
|
||||
jit_cc_a1_reg|jit_cc_a1_int|jit_cc_a1_flt|jit_cc_a1_dbl|
|
||||
(jit_cc_a0_int|jit_cc_a0_flt|jit_cc_a0_dbl|jit_cc_a0_jmp|
|
||||
jit_cc_a0_reg|jit_cc_a0_rlh|jit_cc_a0_arg|
|
||||
jit_cc_a1_reg|jit_cc_a1_int|jit_cc_a1_flt|jit_cc_a1_dbl|jit_cc_a1_arg|
|
||||
jit_cc_a2_reg|jit_cc_a2_int|jit_cc_a2_flt|jit_cc_a2_dbl);
|
||||
if (value & jit_cc_a0_jmp)
|
||||
if (!(node->flag & jit_flag_synth) && ((value & jit_cc_a0_jmp) ||
|
||||
node->code == jit_code_finishr ||
|
||||
node->code == jit_code_finishi))
|
||||
print_str(" ");
|
||||
else
|
||||
print_chr('\t');
|
||||
if (node->flag & jit_flag_synth)
|
||||
print_str(" \\__ ");
|
||||
print_str(code_name[node->code]);
|
||||
switch (node->code) {
|
||||
r:
|
||||
print_chr(' '); print_reg(node->u.w); return;
|
||||
w:
|
||||
print_chr(' '); print_hex(node->u.w); return;
|
||||
f:
|
||||
print_chr(' ');
|
||||
if (node->flag & jit_flag_data)
|
||||
print_flt(*(jit_float32_t *)node->u.n->u.w);
|
||||
else
|
||||
print_flt(node->u.f);
|
||||
return;
|
||||
d:
|
||||
print_chr(' ');
|
||||
if (node->flag & jit_flag_data)
|
||||
print_flt(*(jit_float64_t *)node->u.n->u.w);
|
||||
else
|
||||
print_flt(node->u.d);
|
||||
return;
|
||||
n:
|
||||
print_chr(' ');
|
||||
if (!(node->flag & jit_flag_node))
|
||||
|
@ -106,6 +133,8 @@ _jit_print_node(jit_state_t *_jit, jit_node_t *node)
|
|||
print_dec(node->u.n->v.w);
|
||||
}
|
||||
return;
|
||||
a:
|
||||
print_chr(' '); print_arg(node); return;
|
||||
r_r:
|
||||
print_chr(' '); print_reg(node->u.w);
|
||||
print_chr(' '); print_reg(node->v.w); return;
|
||||
|
@ -128,9 +157,36 @@ _jit_print_node(jit_state_t *_jit, jit_node_t *node)
|
|||
else
|
||||
print_flt(node->v.d);
|
||||
return;
|
||||
r_a:
|
||||
print_chr(' '); print_reg(node->u.w);
|
||||
print_chr(' '); print_arg(node->v.n);
|
||||
return;
|
||||
w_r:
|
||||
print_chr(' '); print_hex(node->u.w);
|
||||
print_chr(' '); print_reg(node->v.w); return;
|
||||
w_w:
|
||||
print_chr(' '); print_hex(node->u.w);
|
||||
print_chr(' '); print_hex(node->v.w); return;
|
||||
w_a:
|
||||
print_chr(' '); print_hex(node->u.w);
|
||||
print_chr(' '); print_arg(node->v.n);
|
||||
return;
|
||||
f_a:
|
||||
print_chr(' ');
|
||||
if (node->flag & jit_flag_data)
|
||||
print_flt(*(jit_float32_t *)node->u.n->u.w);
|
||||
else
|
||||
print_flt(node->u.f);
|
||||
print_chr(' '); print_arg(node->v.n);
|
||||
return;
|
||||
d_a:
|
||||
print_chr(' ');
|
||||
if (node->flag & jit_flag_data)
|
||||
print_flt(*(jit_float64_t *)node->u.n->u.w);
|
||||
else
|
||||
print_flt(node->u.d);
|
||||
print_chr(' '); print_arg(node->v.n);
|
||||
return;
|
||||
r_r_r:
|
||||
print_chr(' '); print_reg(node->u.w);
|
||||
print_chr(' '); print_reg(node->v.w);
|
||||
|
@ -237,7 +293,9 @@ _jit_print_node(jit_state_t *_jit, jit_node_t *node)
|
|||
break;
|
||||
case jit_code_data:
|
||||
case jit_code_label:
|
||||
case jit_code_ellipsis:
|
||||
case jit_code_prolog: case jit_code_epilog:
|
||||
case jit_code_ret: case jit_code_prepare:
|
||||
break;
|
||||
case jit_code_save: case jit_code_load:
|
||||
goto r;
|
||||
|
@ -249,8 +307,14 @@ _jit_print_node(jit_state_t *_jit, jit_node_t *node)
|
|||
goto r;
|
||||
case jit_cc_a0_int:
|
||||
goto w;
|
||||
case jit_cc_a0_flt:
|
||||
goto f;
|
||||
case jit_cc_a0_dbl:
|
||||
goto d;
|
||||
case jit_cc_a0_jmp:
|
||||
goto n;
|
||||
case jit_cc_a0_int|jit_cc_a0_arg:
|
||||
goto a;
|
||||
case jit_cc_a0_reg|jit_cc_a1_reg:
|
||||
goto r_r;
|
||||
case jit_cc_a0_reg|jit_cc_a1_int:
|
||||
|
@ -259,8 +323,18 @@ _jit_print_node(jit_state_t *_jit, jit_node_t *node)
|
|||
goto r_f;
|
||||
case jit_cc_a0_reg|jit_cc_a1_dbl:
|
||||
goto r_d;
|
||||
case jit_cc_a0_reg|jit_cc_a1_arg:
|
||||
goto r_a;
|
||||
case jit_cc_a0_int|jit_cc_a1_reg:
|
||||
goto w_r;
|
||||
case jit_cc_a0_int|jit_cc_a1_int:
|
||||
goto w_w;
|
||||
case jit_cc_a0_int|jit_cc_a1_arg:
|
||||
goto w_a;
|
||||
case jit_cc_a0_flt|jit_cc_a1_arg:
|
||||
goto f_a;
|
||||
case jit_cc_a0_dbl|jit_cc_a1_arg:
|
||||
goto d_a;
|
||||
case jit_cc_a0_reg|jit_cc_a1_reg|jit_cc_a2_reg:
|
||||
goto r_r_r;
|
||||
case jit_cc_a0_reg|jit_cc_a1_reg|jit_cc_a2_int:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue