define Optype for xxc, for instructions whose constant argument is a term, like functor(a,X,T).
This commit is contained in:
parent
7663a748a9
commit
df2b11a6ec
26
C/absmi.c
26
C/absmi.c
@ -12429,23 +12429,23 @@ Yap_absmi(int inp)
|
|||||||
ENDD(d0);
|
ENDD(d0);
|
||||||
ENDOp();
|
ENDOp();
|
||||||
|
|
||||||
Op(p_func2s_cv, xxn);
|
Op(p_func2s_cv, xxc);
|
||||||
/* A1 is a variable */
|
/* A1 is a variable */
|
||||||
restart_func2s_cv:
|
restart_func2s_cv:
|
||||||
#ifdef LOW_LEVEL_TRACER
|
#ifdef LOW_LEVEL_TRACER
|
||||||
if (Yap_do_low_level_trace) {
|
if (Yap_do_low_level_trace) {
|
||||||
RESET_VARIABLE(H);
|
RESET_VARIABLE(H);
|
||||||
H[1] = PREG->u.xxn.c;
|
H[1] = PREG->u.xxc.c;
|
||||||
H[2] = XREG(PREG->u.xxn.xi);
|
H[2] = XREG(PREG->u.xxc.xi);
|
||||||
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
||||||
}
|
}
|
||||||
#endif /* LOW_LEVEL_TRACE */
|
#endif /* LOW_LEVEL_TRACE */
|
||||||
BEGD(d0);
|
BEGD(d0);
|
||||||
/* We have to build the structure */
|
/* We have to build the structure */
|
||||||
d0 = PREG->u.xxn.c;
|
d0 = PREG->u.xxc.c;
|
||||||
/* we do, let's get the third argument */
|
/* we do, let's get the third argument */
|
||||||
BEGD(d1);
|
BEGD(d1);
|
||||||
d1 = XREG(PREG->u.xxn.xi);
|
d1 = XREG(PREG->u.xxc.xi);
|
||||||
deref_head(d1, func2s_unk2_cv);
|
deref_head(d1, func2s_unk2_cv);
|
||||||
func2s_nvar2_cv:
|
func2s_nvar2_cv:
|
||||||
/* Uuuff, the second and third argument are bound */
|
/* Uuuff, the second and third argument are bound */
|
||||||
@ -12470,8 +12470,8 @@ Yap_absmi(int inp)
|
|||||||
H += 2;
|
H += 2;
|
||||||
/* else if arity is 0 just pass d0 through */
|
/* else if arity is 0 just pass d0 through */
|
||||||
/* Ding, ding, we made it */
|
/* Ding, ding, we made it */
|
||||||
XREG(PREG->u.xxn.x) = d0;
|
XREG(PREG->u.xxc.x) = d0;
|
||||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l);
|
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),Osbpp),l);
|
||||||
GONext();
|
GONext();
|
||||||
} else if ((Int)d1 > 0) {
|
} else if ((Int)d1 > 0) {
|
||||||
/* now let's build a compound term */
|
/* now let's build a compound term */
|
||||||
@ -12493,7 +12493,7 @@ Yap_absmi(int inp)
|
|||||||
if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) {
|
if (pt1+d1 > ENV || pt1+d1 > (CELL *)B) {
|
||||||
/* make sure we have something to show for our trouble */
|
/* make sure we have something to show for our trouble */
|
||||||
saveregs();
|
saveregs();
|
||||||
if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxn),Osbpp))) {
|
if (!Yap_gcl((1+d1)*sizeof(CELL), 0, YREG, NEXTOP(NEXTOP(PREG,xxc),Osbpp))) {
|
||||||
Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage);
|
Yap_Error(OUT_OF_STACK_ERROR,TermNil,Yap_ErrorMessage);
|
||||||
setregs();
|
setregs();
|
||||||
JMPNext();
|
JMPNext();
|
||||||
@ -12511,12 +12511,12 @@ Yap_absmi(int inp)
|
|||||||
ENDP(pt1);
|
ENDP(pt1);
|
||||||
/* else if arity is 0 just pass d0 through */
|
/* else if arity is 0 just pass d0 through */
|
||||||
/* Ding, ding, we made it */
|
/* Ding, ding, we made it */
|
||||||
XREG(PREG->u.xxn.x) = d0;
|
XREG(PREG->u.xxc.x) = d0;
|
||||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l);
|
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),Osbpp),l);
|
||||||
GONext();
|
GONext();
|
||||||
} else if (d1 == 0) {
|
} else if (d1 == 0) {
|
||||||
XREG(PREG->u.xxn.x) = d0;
|
XREG(PREG->u.xxc.x) = d0;
|
||||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxn),Osbpp),l);
|
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xxc),Osbpp),l);
|
||||||
GONext();
|
GONext();
|
||||||
} else {
|
} else {
|
||||||
saveregs();
|
saveregs();
|
||||||
@ -12545,7 +12545,7 @@ Yap_absmi(int inp)
|
|||||||
Term ti;
|
Term ti;
|
||||||
CELL *hi = H;
|
CELL *hi = H;
|
||||||
|
|
||||||
ti = MkIntegerTerm((Int)(PREG->u.xxn.c));
|
ti = MkIntegerTerm(PREG->u.xxn.c);
|
||||||
RESET_VARIABLE(H);
|
RESET_VARIABLE(H);
|
||||||
H[1] = XREG(PREG->u.xxn.xi);
|
H[1] = XREG(PREG->u.xxn.xi);
|
||||||
H[2] = ti;
|
H[2] = ti;
|
||||||
|
@ -306,7 +306,7 @@
|
|||||||
OPCODE(p_arg_y_vv ,yxx),
|
OPCODE(p_arg_y_vv ,yxx),
|
||||||
OPCODE(p_arg_y_cv ,yxn),
|
OPCODE(p_arg_y_cv ,yxn),
|
||||||
OPCODE(p_func2s_vv ,xxx),
|
OPCODE(p_func2s_vv ,xxx),
|
||||||
OPCODE(p_func2s_cv ,xxn),
|
OPCODE(p_func2s_cv ,xxc),
|
||||||
OPCODE(p_func2s_vc ,xxn),
|
OPCODE(p_func2s_vc ,xxn),
|
||||||
OPCODE(p_func2s_y_vv ,yxx),
|
OPCODE(p_func2s_y_vv ,yxx),
|
||||||
OPCODE(p_func2s_y_cv ,yxn),
|
OPCODE(p_func2s_y_cv ,yxn),
|
||||||
|
18
H/amidefs.h
18
H/amidefs.h
@ -698,6 +698,18 @@ typedef struct yami {
|
|||||||
wamreg xr;
|
wamreg xr;
|
||||||
CELL next;
|
CELL next;
|
||||||
} xx;
|
} xx;
|
||||||
|
struct {
|
||||||
|
wamreg x;
|
||||||
|
wamreg xi;
|
||||||
|
Term c;
|
||||||
|
CELL next;
|
||||||
|
} xxc;
|
||||||
|
struct {
|
||||||
|
wamreg x;
|
||||||
|
wamreg xi;
|
||||||
|
Int c;
|
||||||
|
CELL next;
|
||||||
|
} xxn;
|
||||||
struct {
|
struct {
|
||||||
wamreg x;
|
wamreg x;
|
||||||
wamreg x1;
|
wamreg x1;
|
||||||
@ -711,12 +723,6 @@ typedef struct yami {
|
|||||||
wamreg xr2;
|
wamreg xr2;
|
||||||
CELL next;
|
CELL next;
|
||||||
} xxxx;
|
} xxxx;
|
||||||
struct {
|
|
||||||
wamreg x;
|
|
||||||
wamreg xi;
|
|
||||||
Int c;
|
|
||||||
CELL next;
|
|
||||||
} xxn;
|
|
||||||
struct {
|
struct {
|
||||||
wamreg x;
|
wamreg x;
|
||||||
wamreg x1;
|
wamreg x1;
|
||||||
|
@ -798,6 +798,13 @@
|
|||||||
}
|
}
|
||||||
cl = NEXTOP(cl,xx);
|
cl = NEXTOP(cl,xx);
|
||||||
break;
|
break;
|
||||||
|
case _p_func2s_cv:
|
||||||
|
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxc.x))) {
|
||||||
|
clause->Tag = (CELL)NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cl = NEXTOP(cl,xxc);
|
||||||
|
break;
|
||||||
case _p_and_vc:
|
case _p_and_vc:
|
||||||
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) {
|
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) {
|
||||||
clause->Tag = (CELL)NULL;
|
clause->Tag = (CELL)NULL;
|
||||||
@ -826,13 +833,6 @@
|
|||||||
}
|
}
|
||||||
cl = NEXTOP(cl,xxn);
|
cl = NEXTOP(cl,xxn);
|
||||||
break;
|
break;
|
||||||
case _p_func2s_cv:
|
|
||||||
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) {
|
|
||||||
clause->Tag = (CELL)NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cl = NEXTOP(cl,xxn);
|
|
||||||
break;
|
|
||||||
case _p_func2s_vc:
|
case _p_func2s_vc:
|
||||||
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) {
|
if (!(nofregs = delete_regcopy(myregs, nofregs, cl->u.xxn.x))) {
|
||||||
clause->Tag = (CELL)NULL;
|
clause->Tag = (CELL)NULL;
|
||||||
|
@ -595,12 +595,18 @@ restore_opcodes(yamop *pc, yamop *max)
|
|||||||
pc->u.xx.xr = XAdjust(pc->u.xx.xr);
|
pc->u.xx.xr = XAdjust(pc->u.xx.xr);
|
||||||
pc = NEXTOP(pc,xx);
|
pc = NEXTOP(pc,xx);
|
||||||
break;
|
break;
|
||||||
|
/* instructions type xxc */
|
||||||
|
case _p_func2s_cv:
|
||||||
|
pc->u.xxc.x = XAdjust(pc->u.xxc.x);
|
||||||
|
pc->u.xxc.xi = XAdjust(pc->u.xxc.xi);
|
||||||
|
pc->u.xxc.c = ConstantTermAdjust(pc->u.xxc.c);
|
||||||
|
pc = NEXTOP(pc,xxc);
|
||||||
|
break;
|
||||||
/* instructions type xxn */
|
/* instructions type xxn */
|
||||||
case _p_and_vc:
|
case _p_and_vc:
|
||||||
case _p_arg_cv:
|
case _p_arg_cv:
|
||||||
case _p_div_cv:
|
case _p_div_cv:
|
||||||
case _p_div_vc:
|
case _p_div_vc:
|
||||||
case _p_func2s_cv:
|
|
||||||
case _p_func2s_vc:
|
case _p_func2s_vc:
|
||||||
case _p_minus_cv:
|
case _p_minus_cv:
|
||||||
case _p_or_vc:
|
case _p_or_vc:
|
||||||
|
@ -454,12 +454,15 @@
|
|||||||
case _put_x_var:
|
case _put_x_var:
|
||||||
pc = NEXTOP(pc,xx);
|
pc = NEXTOP(pc,xx);
|
||||||
break;
|
break;
|
||||||
|
/* instructions type xxc */
|
||||||
|
case _p_func2s_cv:
|
||||||
|
pc = NEXTOP(pc,xxc);
|
||||||
|
break;
|
||||||
/* instructions type xxn */
|
/* instructions type xxn */
|
||||||
case _p_and_vc:
|
case _p_and_vc:
|
||||||
case _p_arg_cv:
|
case _p_arg_cv:
|
||||||
case _p_div_cv:
|
case _p_div_cv:
|
||||||
case _p_div_vc:
|
case _p_div_vc:
|
||||||
case _p_func2s_cv:
|
|
||||||
case _p_func2s_vc:
|
case _p_func2s_vc:
|
||||||
case _p_minus_cv:
|
case _p_minus_cv:
|
||||||
case _p_or_vc:
|
case _p_or_vc:
|
||||||
|
Reference in New Issue
Block a user