remove optimised arithmetic instructions. They made the emulator even bigger than

usual, and they were not performing.
This commit is contained in:
Vitor Santos Costa 2009-03-09 11:52:01 +00:00
parent 43019a496f
commit 828964c3c1
10 changed files with 4 additions and 2353 deletions

1285
C/absmi.c

File diff suppressed because it is too large Load Diff

266
C/amasm.c
View File

@ -660,113 +660,6 @@ a_fil(op_numbers opcodex, op_numbers opcodey, yamop *code_p, int pass_no, struct
return code_p;
}
static yamop *
a_sdll(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc, UInt lab1, UInt lab2, struct intermediates *cip)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.sdll.s = cpc->rnd2;
code_p->u.sdll.d[0] = (CELL)FunctorDouble;
code_p->u.sdll.d[1] = RepAppl(cpc->rnd1)[1];
#if SIZEOF_DOUBLE == 2*SIZEOF_INT_P
code_p->u.sdll.d[2] = RepAppl(cpc->rnd1)[2];
#endif
if (lab1)
code_p->u.sdll.T = emit_a(Unsigned(cip->code_addr) + cip->label_offset[lab1]);
else
code_p->u.sdll.T = emit_a(Unsigned(NEXTOP(code_p,sdll)));
if (lab2)
code_p->u.sdll.F = emit_a(Unsigned(cip->code_addr) + cip->label_offset[lab2]);
else
code_p->u.sdll.F = FAILCODE;
}
GONEXT(sdll);
return code_p;
}
static yamop *
a_snll(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc, UInt lab1, UInt lab2, struct intermediates *cip)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.snll.s = cpc->rnd2;
code_p->u.snll.I = IntegerOfTerm(cpc->rnd1);
if (lab1)
code_p->u.snll.T = emit_a(Unsigned(cip->code_addr) + cip->label_offset[lab1]);
else
code_p->u.snll.T = emit_a(Unsigned(NEXTOP(code_p,snll)));
if (lab2)
code_p->u.snll.F = emit_a(Unsigned(cip->code_addr) + cip->label_offset[lab2]);
else
code_p->u.snll.F = FAILCODE;
}
GONEXT(snll);
return code_p;
}
static yamop *
a_ssll(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc, UInt lab1, UInt lab2, struct intermediates *cip)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.ssll.s1 = cpc->rnd1;
code_p->u.ssll.s2 = cpc->rnd2;
if (lab1)
code_p->u.ssll.T = emit_a(Unsigned(cip->code_addr) + cip->label_offset[lab1]);
else
code_p->u.ssll.T = emit_a(Unsigned(NEXTOP(code_p,ssll)));
if (lab2)
code_p->u.ssll.F = emit_a(Unsigned(cip->code_addr) + cip->label_offset[lab2]);
else
code_p->u.ssll.F = FAILCODE;
}
GONEXT(ssll);
return code_p;
}
static yamop *
a_ssd(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.ssd.s0 = IntegerOfTerm(cpc->rnd1);
code_p->u.ssd.s1 = IntegerOfTerm(cpc->rnd2);
code_p->u.ssd.d[0] = (CELL)FunctorDouble;
code_p->u.ssd.d[1] = RepAppl(cpc->rnd3)[1];
#if SIZEOF_DOUBLE == 2*SIZEOF_INT_P
code_p->u.ssd.d[2] = RepAppl(cpc->rnd3)[2];
#endif
}
GONEXT(ssd);
return code_p;
}
static yamop *
a_ssn(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.ssn.s0 = IntegerOfTerm(cpc->rnd1);
code_p->u.ssn.s1 = IntegerOfTerm(cpc->rnd2);
code_p->u.ssn.n = IntegerOfTerm(cpc->rnd3);
}
GONEXT(ssn);
return code_p;
}
static yamop *
a_sss(op_numbers opcode, yamop *code_p, int pass_no, struct PSEUDO *cpc)
{
if (pass_no) {
code_p->opc = emit_op(opcode);
code_p->u.sss.s0 = IntegerOfTerm(cpc->rnd1);
code_p->u.sss.s1 = IntegerOfTerm(cpc->rnd2);
code_p->u.sss.s2 = IntegerOfTerm(cpc->rnd3);
}
GONEXT(sss);
return code_p;
}
inline static yamop *
a_vp(op_numbers opcodex, op_numbers opcodey, yamop *code_p, int pass_no, struct PSEUDO *cpc, clause_info *clinfo)
{
@ -3312,165 +3205,6 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
*clause_has_blobsp = TRUE;
code_p = a_rd(_get_float, code_p, pass_no, cip->cpc);
break;
case get_fi_op:
code_p = a_fi(_get_fi_x, _get_fi_y, code_p, pass_no, cip->cpc, cip->exception_handler, cip);
break;
case get_f_op:
code_p = a_fi(_get_f_x, _get_f_y, code_p, pass_no, cip->cpc, cip->exception_handler, cip);
break;
case get_i_op:
code_p = a_fi(_get_i_x, _get_i_y, code_p, pass_no, cip->cpc, cip->exception_handler, cip);
break;
case put_fi_var_op:
code_p = a_fi(_put_fi_var_x, _put_fi_var_y, code_p, pass_no, cip->cpc, cip->success_handler, cip);
break;
case put_f_var_op:
code_p = a_fi(_put_f_var_x, _put_f_var_y, code_p, pass_no, cip->cpc, cip->success_handler, cip);
break;
case put_i_var_op:
code_p = a_fi(_put_i_var_x, _put_i_var_y, code_p, pass_no, cip->cpc, cip->success_handler, cip);
break;
case put_fi_val_op:
code_p = a_fil(_put_fi_val_x, _put_fi_val_y, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case put_f_val_op:
code_p = a_fil(_put_f_val_x, _put_f_val_y, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case put_i_val_op:
code_p = a_fil(_put_i_val_x, _put_i_val_y, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case a_eqc_float_op:
*clause_has_blobsp = TRUE;
code_p = a_sdll(_a_eqc_float, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case a_eqc_int_op:
code_p = a_snll(_a_eqc_int, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case a_eq_op:
code_p = a_ssll(_a_eq, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case ltc_float_op:
*clause_has_blobsp = TRUE;
code_p = a_sdll(_ltc_float, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case ltc_int_op:
code_p = a_snll(_ltc_int, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case lt_op:
code_p = a_ssll(_lt, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case gtc_float_op:
*clause_has_blobsp = TRUE;
code_p = a_sdll(_gtc_float, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case gtc_int_op:
code_p = a_snll(_gtc_int, code_p, pass_no, cip->cpc, cip->success_handler, cip->failure_handler, cip);
break;
case add_float_c_op:
*clause_has_blobsp = TRUE;
code_p = a_ssd(_add_float_c, code_p, pass_no, cip->cpc);
break;
case add_int_c_op:
code_p = a_ssn(_add_int_c, code_p, pass_no, cip->cpc);
break;
case add_op:
code_p = a_sss(_add, code_p, pass_no, cip->cpc);
break;
case sub_float_c_op:
*clause_has_blobsp = TRUE;
code_p = a_ssd(_sub_float_c, code_p, pass_no, cip->cpc);
break;
case sub_int_c_op:
code_p = a_ssn(_sub_int_c, code_p, pass_no, cip->cpc);
break;
case sub_op:
code_p = a_sss(_sub, code_p, pass_no, cip->cpc);
break;
case mul_float_c_op:
*clause_has_blobsp = TRUE;
code_p = a_ssd(_mul_float_c, code_p, pass_no, cip->cpc);
break;
case mul_int_c_op:
code_p = a_ssn(_mul_int_c, code_p, pass_no, cip->cpc);
break;
case mul_op:
code_p = a_sss(_mul, code_p, pass_no, cip->cpc);
break;
case sr_c1_op:
code_p = a_ssn(_sr_c1, code_p, pass_no, cip->cpc);
break;
case sr_c2_op:
code_p = a_ssn(_sr_c2, code_p, pass_no, cip->cpc);
break;
case sr_op:
code_p = a_sss(_sr, code_p, pass_no, cip->cpc);
break;
case sl_c1_op:
code_p = a_ssn(_sl_c1, code_p, pass_no, cip->cpc);
break;
case sl_c2_op:
code_p = a_ssn(_sl_c2, code_p, pass_no, cip->cpc);
break;
case sl_op:
code_p = a_sss(_sl, code_p, pass_no, cip->cpc);
break;
case rem_c1_op:
code_p = a_ssn(_rem_c1, code_p, pass_no, cip->cpc);
break;
case rem_c2_op:
code_p = a_ssn(_rem_c2, code_p, pass_no, cip->cpc);
break;
case rem_op:
code_p = a_sss(_rem, code_p, pass_no, cip->cpc);
break;
case mod_c1_op:
code_p = a_ssn(_mod_c1, code_p, pass_no, cip->cpc);
break;
case mod_c2_op:
code_p = a_ssn(_mod_c2, code_p, pass_no, cip->cpc);
break;
case mod_op:
code_p = a_sss(_mod, code_p, pass_no, cip->cpc);
break;
case idiv_c1_op:
code_p = a_ssn(_idiv_c1, code_p, pass_no, cip->cpc);
break;
case idiv_c2_op:
code_p = a_ssn(_idiv_c2, code_p, pass_no, cip->cpc);
break;
case idiv_op:
code_p = a_sss(_idiv, code_p, pass_no, cip->cpc);
break;
case fdiv_c1_op:
code_p = a_ssd(_fdiv_c1, code_p, pass_no, cip->cpc);
break;
case fdiv_c2_op:
code_p = a_ssd(_fdiv_c2, code_p, pass_no, cip->cpc);
break;
case fdiv_op:
code_p = a_sss(_fdiv, code_p, pass_no, cip->cpc);
break;
case a_and_c_op:
code_p = a_ssn(_a_and_c, code_p, pass_no, cip->cpc);
break;
case a_and_op:
code_p = a_sss(_a_and, code_p, pass_no, cip->cpc);
break;
case a_or_c_op:
code_p = a_ssn(_a_or_c, code_p, pass_no, cip->cpc);
break;
case a_or_op:
code_p = a_sss(_a_or, code_p, pass_no, cip->cpc);
break;
case xor_c_op:
code_p = a_ssn(_xor_c, code_p, pass_no, cip->cpc);
break;
case xor_op:
code_p = a_sss(_xor, code_p, pass_no, cip->cpc);
break;
case uminus_op:
code_p = a_sss(_uminus, code_p, pass_no, cip->cpc);
break;
case label_ctl_op:
code_p = a_special_label(code_p, pass_no, cip);
break;

View File

@ -1865,157 +1865,9 @@ c_goal(Term Goal, int mod, compiler_struct *cglobs)
#endif
}
return;
} else if (op >= _p_put_fi && op <= _p_label_ctl) {
switch(op) {
/* one should never get a new variable here */
case _p_get_fi:
c_p_put(Goal, get_fi_op, get_fi_op, cglobs);
return;
case _p_get_i:
c_p_put(Goal, get_i_op, get_i_op, cglobs);
return;
case _p_get_f:
c_p_put(Goal, get_f_op, get_f_op, cglobs);
return;
case _p_put_fi:
c_p_put(Goal, put_fi_var_op, put_fi_val_op, cglobs);
return;
case _p_put_i:
c_p_put(Goal, put_i_var_op, put_i_val_op, cglobs);
return;
case _p_put_f:
c_p_put(Goal, put_f_var_op, put_f_val_op, cglobs);
return;
case _p_a_eq_float:
Yap_emit(a_eqc_float_op, ArgOfTerm(2, Goal), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_a_eq_int:
Yap_emit(a_eqc_int_op, ArgOfTerm(2, Goal), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_a_eq:
Yap_emit(a_eq_op, IntOfTerm(ArgOfTerm(1, Goal)), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_ltc_float:
Yap_emit(ltc_float_op, ArgOfTerm(2, Goal), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_ltc_int:
Yap_emit(ltc_int_op, ArgOfTerm(2, Goal), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_lt:
Yap_emit(lt_op, IntOfTerm(ArgOfTerm(1, Goal)), IntOfTerm(ArgOfTerm(2, Goal)), &cglobs->cint);
return;
case _p_gtc_float:
Yap_emit(gtc_float_op, ArgOfTerm(2, Goal), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_gtc_int:
Yap_emit(gtc_int_op, ArgOfTerm(2, Goal), IntOfTerm(ArgOfTerm(1, Goal)), &cglobs->cint);
return;
case _p_add_float_c:
Yap_emit_3ops(add_float_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_add_int_c:
Yap_emit_3ops(add_int_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_add:
Yap_emit_3ops(add_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sub_float_c:
Yap_emit_3ops(sub_float_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sub_int_c:
Yap_emit_3ops(sub_int_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sub:
Yap_emit_3ops(sub_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_mul_float_c:
Yap_emit_3ops(mul_float_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_mul_int_c:
Yap_emit_3ops(mul_int_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_mul:
Yap_emit_3ops(mul_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_fdiv_c1:
Yap_emit_3ops(fdiv_c1_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_fdiv_c2:
Yap_emit_3ops(fdiv_c2_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_fdiv:
Yap_emit_3ops(fdiv_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_idiv_c1:
Yap_emit_3ops(idiv_c1_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_idiv_c2:
Yap_emit_3ops(idiv_c2_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_idiv:
Yap_emit_3ops(idiv_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_mod_c1:
Yap_emit_3ops(mod_c1_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_mod_c2:
Yap_emit_3ops(mod_c2_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_mod:
Yap_emit_3ops(mod_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_rem_c1:
Yap_emit_3ops(rem_c1_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_rem_c2:
Yap_emit_3ops(rem_c2_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_rem:
Yap_emit_3ops(rem_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_land_c:
Yap_emit_3ops(a_and_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_land:
Yap_emit_3ops(a_and_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_lor_c:
Yap_emit_3ops(a_or_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_lor:
Yap_emit_3ops(a_or_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_xor_c:
Yap_emit_3ops(xor_c_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_xor:
Yap_emit_3ops(xor_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_uminus:
Yap_emit(uminus_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), &cglobs->cint);
return;
case _p_sr_c1:
Yap_emit_3ops(sr_c1_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sr_c2:
Yap_emit_3ops(sr_c2_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sr:
Yap_emit_3ops(sr_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sl_c1:
Yap_emit_3ops(sl_c1_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sl_c2:
Yap_emit_3ops(sl_c2_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_sl:
Yap_emit_3ops(sl_op, ArgOfTerm(1,Goal), ArgOfTerm(2,Goal), ArgOfTerm(3,Goal), &cglobs->cint);
return;
case _p_label_ctl:
emit_special_label(Goal, cglobs);
return;
}
} else if (op == _p_label_ctl) {
emit_special_label(Goal, cglobs);
return;
} else {
c_args(Goal, 0, cglobs);
}
@ -2278,15 +2130,6 @@ usesvar(compiler_vm_op ic)
case f_var_op:
case fetch_args_for_bccall:
case bccall_op:
case get_fi_op:
case get_i_op:
case get_f_op:
case put_fi_var_op:
case put_i_var_op:
case put_f_var_op:
case put_fi_val_op:
case put_i_val_op:
case put_f_val_op:
return TRUE;
default:
break;
@ -2581,9 +2424,6 @@ CheckUnsafe(PInstr *pc, compiler_struct *cglobs)
case save_appl_op:
case save_pair_op:
case f_var_op:
case put_fi_var_op:
case put_i_var_op:
case put_f_var_op:
{
Ventry *v = (Ventry *) (pc->rnd1);
@ -3041,15 +2881,6 @@ c_layout(compiler_struct *cglobs)
#endif
case fetch_args_for_bccall:
case bccall_op:
case get_fi_op:
case get_f_op:
case get_i_op:
case put_fi_var_op:
case put_f_var_op:
case put_i_var_op:
case put_fi_val_op:
case put_f_val_op:
case put_i_val_op:
checktemp(arg, rn, ic, cglobs);
break;
case get_atom_op:

View File

@ -740,57 +740,6 @@ static char *opformat[] =
"fetch_args_for_bccall\t%v",
"binary_cfunc\t\t%v,%P",
"blob\t%O",
"get_number\t",
"get_integer\t",
"get_float\t",
"put_number_on_var\t",
"put_float_on_var\t",
"put_integer_on_var\t",
"put_number_on_val\t",
"put_float_on_val\t",
"put_integer_on_val\t",
"equal_floats\t",
"equal_ints\t",
"equal_numbers\t",
"lt_floats\t",
"lt_ints\t",
"lt_numbers\t",
"gt_floats\t",
"gt_ints\t",
"add_float\t",
"add_int\t",
"add\t",
"sub_float\t",
"sub_int\t",
"sub\t",
"mul_float\t",
"mul_int\t",
"mul\t",
"shift_right_constant\t",
"shift_right_by_constant\t",
"shift_right\t",
"shift_left_constant\t",
"shift_left_by_constant\t",
"shift_left\t",
"divide_constant\t",
"divide_by_constant\t",
"divide\t",
"integer_divide_constant\t",
"integer_divide_by_constant\t",
"integer_divide\t",
"mod_constant\t",
"mod_by_constant\t",
"mod\t",
"rem_constant\t",
"rem_by_constant\t",
"rem\t",
"and_constant\t",
"and\t",
"or_constant\t",
"or\t",
"xor_constant\t",
"xor\t",
"uminus\t",
"label_control\t"
#ifdef SFUNC
,

View File

@ -939,51 +939,8 @@ fix_compiler_instructions(PInstr *pcpc)
case fetch_args_vv_op:
case fetch_args_cv_op:
case fetch_args_vc_op:
case get_fi_op:
case get_f_op:
case get_i_op:
case put_fi_var_op:
case put_f_var_op:
case put_i_var_op:
case put_fi_val_op:
case put_f_val_op:
case put_i_val_op:
pcpc->rnd1 = GlobalAdjust(pcpc->rnd1);
break;
case a_eqc_float_op:
case a_eqc_int_op:
case ltc_float_op:
case ltc_int_op:
case gtc_float_op:
case gtc_int_op:
case add_float_c_op:
case sub_float_c_op:
case mul_float_c_op:
case fdiv_c1_op:
case fdiv_c2_op:
/* floats might be in the global */
pcpc->rnd1 = AdjustAppl(pcpc->rnd1);
break;
case add_int_c_op:
case sub_int_c_op:
case mul_int_c_op:
case sr_c1_op:
case sr_c2_op:
case sl_c1_op:
case sl_c2_op:
case idiv_c1_op:
case idiv_c2_op:
case rem_c1_op:
case rem_c2_op:
case mod_c1_op:
case mod_c2_op:
case a_and_c_op:
case a_or_c_op:
case xor_c_op:
/* floats might be in the global */
if (!IsIntTerm(pcpc->rnd1))
pcpc->rnd1 = AdjustAppl(pcpc->rnd1);
break;
case get_float_op:
case put_float_op:
case get_longint_op:
@ -1088,22 +1045,8 @@ fix_compiler_instructions(PInstr *pcpc)
case blob_op:
case fetch_args_vi_op:
case fetch_args_iv_op:
case a_eq_op:
case lt_op:
case add_op:
case sub_op:
case mul_op:
case fdiv_op:
case idiv_op:
case mod_op:
case rem_op:
case a_and_op:
case a_or_op:
case xor_op:
case uminus_op:
case sr_op:
case sl_op:
case label_ctl_op:
case f_0_op:
#ifdef TABLING
case table_new_answer_op:
case table_try_single_op:

View File

@ -299,66 +299,6 @@
OPCODE(call_bfunc_yx ,plxys),
OPCODE(call_bfunc_xy ,plxys),
OPCODE(call_bfunc_yy ,plyys),
OPCODE(get_fi_x ,sxl),
OPCODE(get_fi_y ,syl),
OPCODE(get_i_x ,sxl),
OPCODE(get_i_y ,syl),
OPCODE(get_f_x ,sxl),
OPCODE(get_f_y ,syl),
OPCODE(a_eqc_float ,sdll),
OPCODE(a_eqc_int ,snll),
OPCODE(a_eq ,ssll),
OPCODE(ltc_float ,sdll),
OPCODE(ltc_int ,snll),
OPCODE(lt ,ssll),
OPCODE(gtc_float ,sdll),
OPCODE(gtc_int ,snll),
OPCODE(add_float_c ,ssd),
OPCODE(add_int_c ,ssn),
OPCODE(add ,sss),
OPCODE(sub_float_c ,ssd),
OPCODE(sub_int_c ,ssn),
OPCODE(sub ,sss),
OPCODE(mul_float_c ,ssd),
OPCODE(mul_int_c ,ssn),
OPCODE(mul ,sss),
OPCODE(fdiv_c1 ,ssd),
OPCODE(fdiv_c2 ,ssd),
OPCODE(fdiv ,sss),
OPCODE(idiv_c1 ,ssn),
OPCODE(idiv_c2 ,ssn),
OPCODE(idiv ,sss),
OPCODE(mod_c1 ,ssn),
OPCODE(mod_c2 ,ssn),
OPCODE(mod ,sss),
OPCODE(rem_c1 ,ssn),
OPCODE(rem_c2 ,ssn),
OPCODE(rem ,sss),
OPCODE(a_or_c ,ssn),
OPCODE(a_or ,sss),
OPCODE(a_and_c ,ssn),
OPCODE(a_and ,sss),
OPCODE(xor_c ,ssn),
OPCODE(xor ,sss),
OPCODE(uminus ,sss),
OPCODE(sl_c1 ,ssn),
OPCODE(sl_c2 ,ssn),
OPCODE(sl ,sss),
OPCODE(sr_c1 ,ssn),
OPCODE(sr_c2 ,ssn),
OPCODE(sr ,sss),
OPCODE(put_fi_val_x ,sxll),
OPCODE(put_fi_val_y ,syll),
OPCODE(put_i_val_x ,sxll),
OPCODE(put_i_val_y ,syll),
OPCODE(put_f_val_x ,sxll),
OPCODE(put_f_val_y ,syll),
OPCODE(put_fi_var_x ,sxl),
OPCODE(put_fi_var_y ,syl),
OPCODE(put_i_var_x ,sxl),
OPCODE(put_i_var_y ,syl),
OPCODE(put_f_var_x ,sxl),
OPCODE(put_f_var_y ,syl),
OPCODE(p_equal ,e),
OPCODE(p_dif ,l),
OPCODE(p_eq ,l),

View File

@ -180,57 +180,6 @@ typedef enum compiler_op {
fetch_args_for_bccall,
bccall_op,
blob_op,
get_fi_op,
get_i_op,
get_f_op,
put_fi_var_op,
put_f_var_op,
put_i_var_op,
put_fi_val_op,
put_f_val_op,
put_i_val_op,
a_eqc_float_op,
a_eqc_int_op,
a_eq_op,
ltc_float_op,
ltc_int_op,
lt_op,
gtc_float_op,
gtc_int_op,
add_float_c_op,
add_int_c_op,
add_op,
sub_float_c_op,
sub_int_c_op,
sub_op,
mul_float_c_op,
mul_int_c_op,
mul_op,
sr_c1_op,
sr_c2_op,
sr_op,
sl_c1_op,
sl_c2_op,
sl_op,
fdiv_c1_op,
fdiv_c2_op,
fdiv_op,
idiv_c1_op,
idiv_c2_op,
idiv_op,
mod_c1_op,
mod_c2_op,
mod_op,
rem_c1_op,
rem_c2_op,
rem_op,
a_and_c_op,
a_and_op,
a_or_c_op,
a_or_op,
xor_c_op,
xor_op,
uminus_op,
label_ctl_op
#ifdef SFUNC
,

View File

@ -524,201 +524,6 @@
case _write_n_atoms:
cl = NEXTOP(cl,sc);
break;
case _gtc_float:
cl = NEXTOP(cl,sdll);
break;
case _ltc_float:
cl = NEXTOP(cl,sdll);
break;
case _gtc_int:
cl = NEXTOP(cl,snll);
break;
case _ltc_int:
cl = NEXTOP(cl,snll);
break;
case _add_float_c:
cl = NEXTOP(cl,ssd);
break;
case _fdiv_c1:
cl = NEXTOP(cl,ssd);
break;
case _fdiv_c2:
cl = NEXTOP(cl,ssd);
break;
case _mul_float_c:
cl = NEXTOP(cl,ssd);
break;
case _sub_float_c:
cl = NEXTOP(cl,ssd);
break;
case _a_eq:
cl = NEXTOP(cl,ssll);
break;
case _lt:
cl = NEXTOP(cl,ssll);
break;
case _a_and_c:
cl = NEXTOP(cl,ssn);
break;
case _a_or_c:
cl = NEXTOP(cl,ssn);
break;
case _add_int_c:
cl = NEXTOP(cl,ssn);
break;
case _idiv_c1:
cl = NEXTOP(cl,ssn);
break;
case _idiv_c2:
cl = NEXTOP(cl,ssn);
break;
case _mod_c1:
cl = NEXTOP(cl,ssn);
break;
case _mod_c2:
cl = NEXTOP(cl,ssn);
break;
case _mul_int_c:
cl = NEXTOP(cl,ssn);
break;
case _rem_c1:
cl = NEXTOP(cl,ssn);
break;
case _rem_c2:
cl = NEXTOP(cl,ssn);
break;
case _sl_c1:
cl = NEXTOP(cl,ssn);
break;
case _sl_c2:
cl = NEXTOP(cl,ssn);
break;
case _sr_c1:
cl = NEXTOP(cl,ssn);
break;
case _sr_c2:
cl = NEXTOP(cl,ssn);
break;
case _sub_int_c:
cl = NEXTOP(cl,ssn);
break;
case _a_and:
cl = NEXTOP(cl,sss);
break;
case _a_or:
cl = NEXTOP(cl,sss);
break;
case _add:
cl = NEXTOP(cl,sss);
break;
case _fdiv:
cl = NEXTOP(cl,sss);
break;
case _idiv:
cl = NEXTOP(cl,sss);
break;
case _mod:
cl = NEXTOP(cl,sss);
break;
case _mul:
cl = NEXTOP(cl,sss);
break;
case _rem:
cl = NEXTOP(cl,sss);
break;
case _sl:
cl = NEXTOP(cl,sss);
break;
case _sr:
cl = NEXTOP(cl,sss);
break;
case _sub:
cl = NEXTOP(cl,sss);
break;
case _uminus:
cl = NEXTOP(cl,sss);
break;
case _xor:
cl = NEXTOP(cl,sss);
break;
case _get_f_x:
cl = NEXTOP(cl,sxl);
break;
case _get_fi_x:
cl = NEXTOP(cl,sxl);
break;
case _get_i_x:
cl = NEXTOP(cl,sxl);
break;
case _put_f_var_x:
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x))) {
clause->Tag = (CELL)NULL;
return;
}
cl = NEXTOP(cl,sxl);
break;
case _put_fi_var_x:
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x))) {
clause->Tag = (CELL)NULL;
return;
}
cl = NEXTOP(cl,sxl);
break;
case _put_i_var_x:
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.sxl.x))) {
clause->Tag = (CELL)NULL;
return;
}
cl = NEXTOP(cl,sxl);
break;
case _put_f_val_x:
cl = NEXTOP(cl,sxll);
break;
case _put_fi_val_x:
cl = NEXTOP(cl,sxll);
break;
case _put_i_val_x:
cl = NEXTOP(cl,sxll);
break;
case _get_f_y:
cl = NEXTOP(cl,syl);
break;
case _get_fi_y:
cl = NEXTOP(cl,syl);
break;
case _get_i_y:
cl = NEXTOP(cl,syl);
break;
case _put_f_var_y:
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.syl.y))) {
clause->Tag = (CELL)NULL;
return;
}
cl = NEXTOP(cl,syl);
break;
case _put_fi_var_y:
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.syl.y))) {
clause->Tag = (CELL)NULL;
return;
}
cl = NEXTOP(cl,syl);
break;
case _put_i_var_y:
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.syl.y))) {
clause->Tag = (CELL)NULL;
return;
}
cl = NEXTOP(cl,syl);
break;
case _put_f_val_y:
cl = NEXTOP(cl,syll);
break;
case _put_fi_val_y:
cl = NEXTOP(cl,syll);
break;
case _put_i_val_y:
cl = NEXTOP(cl,syll);
break;
case _get_list:
if (is_regcopy(myregs, nofregs, cl->u.x.x)) {
clause->Tag = AbsPair(NULL);

View File

@ -456,16 +456,6 @@ restore_opcodes(yamop *pc)
pc->u.sc.c = ConstantTermAdjust(pc->u.sc.c);
pc = NEXTOP(pc,sc);
break;
/* instructions type sdll */
case _a_eqc_float:
case _gtc_float:
case _ltc_float:
pc->u.sdll.s = ConstantAdjust(pc->u.sdll.s);
DoubleInCodeAdjust(pc->u.sdll.d);
pc->u.sdll.F = PtoOpAdjust(pc->u.sdll.F);
pc->u.sdll.T = PtoOpAdjust(pc->u.sdll.T);
pc = NEXTOP(pc,sdll);
break;
/* instructions type sllll */
case _switch_on_sub_arg_type:
pc->u.sllll.s = ConstantAdjust(pc->u.sllll.s);
@ -482,77 +472,6 @@ restore_opcodes(yamop *pc)
pc->u.slp.p = PtoPredAdjust(pc->u.slp.p);
pc = NEXTOP(pc,slp);
break;
/* instructions type snll */
case _a_eqc_int:
case _gtc_int:
case _ltc_int:
pc->u.snll.s = ConstantAdjust(pc->u.snll.s);
pc->u.snll.I = IntegerAdjust(pc->u.snll.I);
pc->u.snll.F = PtoOpAdjust(pc->u.snll.F);
pc->u.snll.T = PtoOpAdjust(pc->u.snll.T);
pc = NEXTOP(pc,snll);
break;
/* instructions type ssd */
case _add_float_c:
case _fdiv_c1:
case _fdiv_c2:
case _mul_float_c:
case _sub_float_c:
pc->u.ssd.s0 = ConstantAdjust(pc->u.ssd.s0);
pc->u.ssd.s1 = ConstantAdjust(pc->u.ssd.s1);
DoubleInCodeAdjust(pc->u.ssd.d);
pc = NEXTOP(pc,ssd);
break;
/* instructions type ssll */
case _a_eq:
case _lt:
pc->u.ssll.s1 = ConstantAdjust(pc->u.ssll.s1);
pc->u.ssll.s2 = ConstantAdjust(pc->u.ssll.s2);
pc->u.ssll.F = PtoOpAdjust(pc->u.ssll.F);
pc->u.ssll.T = PtoOpAdjust(pc->u.ssll.T);
pc = NEXTOP(pc,ssll);
break;
/* instructions type ssn */
case _a_and_c:
case _a_or_c:
case _add_int_c:
case _idiv_c1:
case _idiv_c2:
case _mod_c1:
case _mod_c2:
case _mul_int_c:
case _rem_c1:
case _rem_c2:
case _sl_c1:
case _sl_c2:
case _sr_c1:
case _sr_c2:
case _sub_int_c:
case _xor_c:
pc->u.ssn.s0 = ConstantAdjust(pc->u.ssn.s0);
pc->u.ssn.s1 = ConstantAdjust(pc->u.ssn.s1);
pc->u.ssn.n = IntegerAdjust(pc->u.ssn.n);
pc = NEXTOP(pc,ssn);
break;
/* instructions type sss */
case _a_and:
case _a_or:
case _add:
case _fdiv:
case _idiv:
case _mod:
case _mul:
case _rem:
case _sl:
case _sr:
case _sub:
case _uminus:
case _xor:
pc->u.sss.s0 = ConstantAdjust(pc->u.sss.s0);
pc->u.sss.s1 = ConstantAdjust(pc->u.sss.s1);
pc->u.sss.s2 = ConstantAdjust(pc->u.sss.s2);
pc = NEXTOP(pc,sss);
break;
/* instructions type sssl */
case _go_on_cons:
case _go_on_func:
@ -577,50 +496,6 @@ restore_opcodes(yamop *pc)
pc->u.sssllp.p = PtoPredAdjust(pc->u.sssllp.p);
pc = NEXTOP(pc,sssllp);
break;
/* instructions type sxl */
case _get_f_x:
case _get_fi_x:
case _get_i_x:
case _put_f_var_x:
case _put_fi_var_x:
case _put_i_var_x:
pc->u.sxl.s = ConstantAdjust(pc->u.sxl.s);
pc->u.sxl.x = XAdjust(pc->u.sxl.x);
pc->u.sxl.l = PtoOpAdjust(pc->u.sxl.l);
pc = NEXTOP(pc,sxl);
break;
/* instructions type sxll */
case _put_f_val_x:
case _put_fi_val_x:
case _put_i_val_x:
pc->u.sxll.s = ConstantAdjust(pc->u.sxll.s);
pc->u.sxll.x = XAdjust(pc->u.sxll.x);
pc->u.sxll.F = PtoOpAdjust(pc->u.sxll.F);
pc->u.sxll.T = PtoOpAdjust(pc->u.sxll.T);
pc = NEXTOP(pc,sxll);
break;
/* instructions type syl */
case _get_f_y:
case _get_fi_y:
case _get_i_y:
case _put_f_var_y:
case _put_fi_var_y:
case _put_i_var_y:
pc->u.syl.s = ConstantAdjust(pc->u.syl.s);
pc->u.syl.y = YAdjust(pc->u.syl.y);
pc->u.syl.l = PtoOpAdjust(pc->u.syl.l);
pc = NEXTOP(pc,syl);
break;
/* instructions type syll */
case _put_f_val_y:
case _put_fi_val_y:
case _put_i_val_y:
pc->u.syll.s = ConstantAdjust(pc->u.syll.s);
pc->u.syll.y = YAdjust(pc->u.syll.y);
pc->u.syll.F = PtoOpAdjust(pc->u.syll.F);
pc->u.syll.T = PtoOpAdjust(pc->u.syll.T);
pc = NEXTOP(pc,syll);
break;
/* instructions type x */
case _get_list:
case _put_list:

View File

@ -363,12 +363,6 @@
case _write_n_atoms:
pc = NEXTOP(pc,sc);
break;
/* instructions type sdll */
case _a_eqc_float:
case _gtc_float:
case _ltc_float:
pc = NEXTOP(pc,sdll);
break;
/* instructions type sllll */
case _switch_on_sub_arg_type:
pc = NEXTOP(pc,sllll);
@ -377,60 +371,6 @@
case _call_c_wfail:
pp = pc->u.slp.p;
return walk_found_c_pred(pp, startp, endp);
/* instructions type snll */
case _a_eqc_int:
case _gtc_int:
case _ltc_int:
pc = NEXTOP(pc,snll);
break;
/* instructions type ssd */
case _add_float_c:
case _fdiv_c1:
case _fdiv_c2:
case _mul_float_c:
case _sub_float_c:
pc = NEXTOP(pc,ssd);
break;
/* instructions type ssll */
case _a_eq:
case _lt:
pc = NEXTOP(pc,ssll);
break;
/* instructions type ssn */
case _a_and_c:
case _a_or_c:
case _add_int_c:
case _idiv_c1:
case _idiv_c2:
case _mod_c1:
case _mod_c2:
case _mul_int_c:
case _rem_c1:
case _rem_c2:
case _sl_c1:
case _sl_c2:
case _sr_c1:
case _sr_c2:
case _sub_int_c:
case _xor_c:
pc = NEXTOP(pc,ssn);
break;
/* instructions type sss */
case _a_and:
case _a_or:
case _add:
case _fdiv:
case _idiv:
case _mod:
case _mul:
case _rem:
case _sl:
case _sr:
case _sub:
case _uminus:
case _xor:
pc = NEXTOP(pc,sss);
break;
/* instructions type sssl */
case _go_on_cons:
case _go_on_func:
@ -445,36 +385,6 @@
return found_expand_index(pc, startp, endp, codeptr);
pc = NEXTOP(pc,sssllp);
break;
/* instructions type sxl */
case _get_f_x:
case _get_fi_x:
case _get_i_x:
case _put_f_var_x:
case _put_fi_var_x:
case _put_i_var_x:
pc = NEXTOP(pc,sxl);
break;
/* instructions type sxll */
case _put_f_val_x:
case _put_fi_val_x:
case _put_i_val_x:
pc = NEXTOP(pc,sxll);
break;
/* instructions type syl */
case _get_f_y:
case _get_fi_y:
case _get_i_y:
case _put_f_var_y:
case _put_fi_var_y:
case _put_i_var_y:
pc = NEXTOP(pc,syl);
break;
/* instructions type syll */
case _put_f_val_y:
case _put_fi_val_y:
case _put_i_val_y:
pc = NEXTOP(pc,syll);
break;
/* instructions type x */
case _get_list:
case _put_list: