2014-07-13 05:30:14 +01:00
|
|
|
#define P_ATOM_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ATOM_X_ATOM \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext(); \
|
|
|
|
|
|
|
|
#define P_ATOM_X_NOATOM \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOM_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_ATOM_Y_IFOK \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOM_Y_NOIF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOM_Y_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOMIC_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ATOMIC_X_NONVAR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOMIC_X_VAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOMIC_X_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOMIC_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_ATOMIC_Y_NONVAR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOMIC_Y_VAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ATOMIC_Y_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_INTEGER_X_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x); \
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_INTEGER_X_INTEGER_X_NVAR_OK \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_INTEGER_X_INTEGER_X_NVAR_NOOK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_INTEGER_X_INTEGER_X_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_INTEGER_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_INTEGER_Y_INTEGER_Y_NVAR_OK \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_INTEGER_Y_INTEGER_Y_NVAR_NOOK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_INTEGER_Y_INTEGER_Y_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NONVAR_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_NONVAR_X_NONVAR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NONVAR_X_NONONVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NONVAR_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_NONVAR_Y_NONVAR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NONVAR_Y_NONONVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_NUMBER_X_INT \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_X_FUNCTORINT \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_X_FUNCTORDEFAULT \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_X_POST_IF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_X_NUMBER_X_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_NUMBER_Y_INT \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_Y_FUNCTORINT \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_Y_FUNCTORDEFAULT \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_Y_POST_IF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_NUMBER_Y_NUMBER_Y_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_VAR_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_VAR_X_NONVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_VAR_X_VAR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_VAR_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_VAR_Y_NONVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_VAR_Y_VAR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DB_REF_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DB_REF_X_DBREF \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DB_REF_X_NODBREF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DB_REF_X_DBREF_X_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DB_REF_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_DB_REF_Y_DBREF \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DB_REF_Y_NODBREF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DB_REF_Y_DBREF_Y_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PRIMITIVE_X_PRIMITIVE \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_X_NOPRIMITIVE \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_X_PRIMI_X_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_Y_PRIMITIVE \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_Y_NOPRIMITIVE \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PRIMITIVE_Y_PRIMI_Y_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_COMPOUND_X_PAIR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_X_APPL_IFOK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_X_APPL \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_X_NOAPPL \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_X_COMPOUND_X_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_COMPOUND_Y_PAIR \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_Y_APPL_IFOK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_Y_APPL \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_Y_NOAPPL \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_COMPOUND_Y_COMPOUND_Y_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FLOAT_X_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xl.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FLOAT_X_FLOAT \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), xl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FLOAT_X_POST_IF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FLOAT_X_FLOAT_X_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.xl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FLOAT_Y_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yl.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define P_FLOAT_Y_FLOAT \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yl); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FLOAT_Y_POST_IF \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FLOAT_Y_FLOAT_Y_UNK \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.yl.F; \
|
2014-07-13 05:30:14 +01:00
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PLUS_VV_PLUS_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PLUS_VV_PLUS_VV_NVAR_NVAR_INT \
|
|
|
|
if (!IsIntTerm(d0) || !IsIntTerm(d1)) { BACK(); } \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) + IntOfTerm(d1)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_VV_PLUS_VV_NVAR_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_VV_PLUS_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is _+B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_PLUS_VV_PLUS_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A+B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_PLUS_VC_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PLUS_VC_PLUS_VC_NVAR_INT \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) + d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_VC_PLUS_VC_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_VC_PLUS_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, (*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PLUS_Y_VV_PLUS_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PLUS_Y_VV_PLUS_Y_VV_NVAR_NVAR_INT \
|
|
|
|
if (!IsIntTerm(d0) || !IsIntTerm(d1)) { BACK(); } \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) + IntOfTerm(d1)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VV_PLUS_Y_VV_NVAR_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VV_PLUS_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A+B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VV_PLUS_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A+B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VC_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_PLUS_Y_VC_PLUS_Y_VC_NVAR_INT \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) + d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VC_PLUS_Y_VC_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_PLUS_Y_VC_PLUS_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A + " Int_FORMAT, (*_PREG)->u.yxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_VV_MINUS_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_VV_MINUS_VV_NVAR_NVAR_INT \
|
|
|
|
if (!IsIntTerm(d0) || !IsIntTerm(d1)) { BACK(); } \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) - IntOfTerm(d1)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_MINUS_VV_MINUS_VV_NVAR_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_MINUS_VV_MINUS_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_VV_MINUS_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_CV_MINUS_CV_NVAR_INT \
|
|
|
|
d0 = MkIntegerTerm(d1 - IntOfTerm(d0)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_MINUS_CV_MINUS_CV_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_minus(MkIntegerTerm(d1),Yap_Eval(d0)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_MINUS_CV_MINUS_CV_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", (*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_MINUS_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) - IntOfTerm(d1));
|
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_MINUS_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_VV_MINUS_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A-B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_MINUS_Y_CV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(d1 - IntOfTerm(d0));
|
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_minus(MkIntegerTerm(d1), Yap_Eval(d0)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_MINUS_Y_CV_MINUS_Y_CV_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "-A", (*_PREG)->u.yxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_TIMES_VV_TIMES_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_TIMES_VV_TIMES_VV_NVAR_NVAR_INT \
|
|
|
|
if (!IsIntTerm(d0) || !IsIntTerm(d1)) { BACK(); } \
|
|
|
|
d0 = times_int(IntOfTerm(d0), IntOfTerm(d1)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_VV_TIMES_VV_NVAR_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_VV_TIMES_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_VV_TIMES_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_VC_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_TIMES_VC_TIMES_VC_NVAR_INT \
|
|
|
|
d0 = times_int(IntOfTerm(d0), d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_VC_TIMES_VC_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_VC_TIMES_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, (*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_TIMES_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_INTTERM \
|
|
|
|
d0 = times_int(IntOfTerm(d0), IntOfTerm(d1));
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_TIMES_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VV_TIMES_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A*B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VC_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_TIMES_Y_VC_TIMES_Y_VC_NVAR_INT \
|
|
|
|
d0 = times_int(IntOfTerm(d0), d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VC_TIMES_Y_VC_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_TIMES_Y_VC_TIMES_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A* " Int_FORMAT, (*_PREG)->u.yxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_VV_DIV_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_VV_DIV_VV_NVAR_NVAR_INT \
|
|
|
|
BLOCK = (CELL)P_DIV_VV_DIV_VV_NVAR_NVAR_INT; \
|
|
|
|
FAILED = 0; \
|
|
|
|
if (!IsIntTerm(d0) || !IsIntTerm(d1)) { BACK(); } \
|
|
|
|
Int div = IntOfTerm(d1); \
|
|
|
|
if (div == 0) { \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); \
|
|
|
|
setregs(); \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
d0 = MkIntTerm(IntOfTerm(d0) / div); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define P_DIV_VV_DIV_VV_NVAR_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DIV_VV_DIV_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_VV_DIV_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_VC_DIV_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_VC_INTTERM \
|
|
|
|
d0 = MkIntTerm(IntOfTerm(d0) / d1);
|
|
|
|
|
|
|
|
#define P_DIV_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_DIV_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DIV_VC_DIV_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_CV_DIV_CV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_CV_INTTERM_INIT \
|
|
|
|
Int div = IntOfTerm(d0);
|
|
|
|
|
|
|
|
#define P_DIV_CV_INTTERM_DIVEQUALS0 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_CV_INTTERM_END \
|
|
|
|
d0 = MkIntegerTerm(d1 / div);
|
|
|
|
|
|
|
|
#define P_DIV_CV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_div(MkIntegerTerm(d1),Yap_Eval(d0));
|
|
|
|
|
|
|
|
#define P_DIV_CV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_CV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DIV_CV_DIV_CV_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", (*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_Y_VV_DIV_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_Y_VV_INTTERM_INIT \
|
|
|
|
Int div = IntOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_INTTERM_DIVEQUALS0 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_INTTERM_END \
|
|
|
|
d0 = MkIntTerm(IntOfTerm(d0) / div);
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_DIV_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VV_DIV_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_Y_VC_DIV_Y_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_Y_VC_INTTERM \
|
|
|
|
d0 = MkIntTerm(IntOfTerm(d0)/d1);
|
|
|
|
|
|
|
|
#define P_DIV_Y_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DIV_Y_VC_DIV_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A//B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_Y_CV_DIV_Y_CV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_DIV_Y_CV_INTTERM_INIT \
|
|
|
|
Int div = IntOfTerm(d0);
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_INTTERM_DIVEQUALS0 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(EVALUATION_ERROR_ZERO_DIVISOR,"// /2"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_INTTERM_END \
|
|
|
|
d0 = MkIntegerTerm(d1 / div);
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_div(MkIntegerTerm(d1), Yap_Eval(d0)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_DIV_Y_CV_DIV_Y_CV_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is " Int_FORMAT "// A", (*_PREG)->u.yxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_VV_AND_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_VV_AND_VV_NVAR_NVAR_INT \
|
|
|
|
if (!IsIntTerm(d0) || !IsIntTerm(d1)) { BACK(); } \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) & IntOfTerm(d1)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_AND_VV_AND_VV_NVAR_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_AND_VV_AND_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_VV_AND_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_VC_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_VC_AND_VC_NVAR_INT \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) & d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_AND_VC_AND_VC_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_AND_VC_AND_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , (*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_Y_VV_AND_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_Y_VV_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) & IntOfTerm(d1));
|
|
|
|
|
|
|
|
#define P_AND_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_AND_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_AND_Y_VV_AND_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_Y_VV_AND_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A/\\B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_Y_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_Y_VC_AND_Y_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_AND_Y_VC_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) & d1);
|
|
|
|
|
|
|
|
#define P_AND_Y_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_AND_Y_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_AND_Y_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_AND_Y_VC_AND_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A /\\ " Int_FORMAT , (*_PREG)->u.yxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_VV_OR_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_VV_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) | IntOfTerm(d1));
|
|
|
|
|
|
|
|
#define P_OR_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_OR_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_OR_VV_OR_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_VV_OR_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_VC_OR_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_VC_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) | d1);
|
|
|
|
|
|
|
|
#define P_OR_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1));
|
|
|
|
|
|
|
|
#define P_OR_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_OR_VC_OR_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , (*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_Y_VV_OR_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_Y_VV_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) | IntOfTerm(d1));
|
|
|
|
|
|
|
|
#define P_OR_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_OR_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_OR_Y_VV_OR_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_Y_VV_OR_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A\\/B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_Y_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_Y_VC_OR_Y_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_OR_Y_VC_INTTERM \
|
|
|
|
d0 = MkIntegerTerm(IntOfTerm(d0) | d1);
|
|
|
|
|
|
|
|
#define P_OR_Y_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_OR_Y_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_OR_Y_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_OR_Y_VC_OR_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A \\/ " Int_FORMAT , (*_PREG)->u.yxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_VV_SLL_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_VV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_SLL_VV_INTTERM_LESS \
|
|
|
|
d0 = MkIntegerTerm(SLR(IntOfTerm(d0), -i2));
|
|
|
|
|
|
|
|
#define P_SLL_VV_INTTERM_GREATER \
|
|
|
|
d0 = do_sll(IntOfTerm(d0),i2);
|
|
|
|
|
|
|
|
#define P_SLL_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLL_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_VV_SLL_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_VV_SLL_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_VC_SLL_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_VC_INTTERM \
|
|
|
|
d0 = do_sll(IntOfTerm(d0), (Int)d1);
|
|
|
|
|
|
|
|
#define P_SLL_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLL_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_VC_SLL_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_CV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_CV_SLL_CV_NVAR_INT \
|
|
|
|
Int i2 = IntOfTerm(d0); \
|
|
|
|
if (i2 < 0) { \
|
|
|
|
d0 = MkIntegerTerm(SLR(d1, -i2)); \
|
|
|
|
} else { \
|
|
|
|
d0 = do_sll(d1,i2); \
|
|
|
|
} \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_CV_SLL_CV_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(d0)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG = NEXTOP((*_PREG, xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_CV_SLL_CV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_Y_VV_SLL_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_Y_VV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_INTERM_LESS \
|
|
|
|
d0 = MkIntegerTerm(SLR(IntOfTerm(d0), -i2));
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_INTTERM_GREATER \
|
|
|
|
d0 = do_sll(IntOfTerm(d0),i2);
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_SLL_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VV_SLL_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_Y_VC_SLL_Y_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_Y_VC_INTTERM \
|
|
|
|
d0 = do_sll(IntOfTerm(d0), Yap_Eval(d1));
|
|
|
|
|
|
|
|
#define P_SLL_Y_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_Y_VC_SLL_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_Y_CV_SLL_Y_CV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLL_Y_CV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d0);
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_INTTERM_LESS \
|
|
|
|
d0 = MkIntegerTerm(SLR(d1, -i2));
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_INTTERM_GREATER \
|
|
|
|
d0 = do_sll(d1,i2);
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(0)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLL_Y_CV_SLL_Y_CV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A<<B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_VV_SLR_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_VV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_SLR_VV_INTTERM_LESS \
|
|
|
|
d0 = do_sll(IntOfTerm(d0), -i2);
|
|
|
|
|
|
|
|
#define P_SLR_VV_INTTERM_GREATER \
|
|
|
|
d0 = MkIntTerm(SLR(IntOfTerm(d0), i2));
|
|
|
|
|
|
|
|
#define P_SLR_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLR_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_VV_SRL_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_VV_SRL_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_VC_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_VC_SLR_VC_NVAR_INT \
|
|
|
|
d0 = MkIntTerm(SLR(IntOfTerm(d0), d1)); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_VC_SLR_VC_NVAR_NOINT \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs(); \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_VC_SRL_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_CV_SLR_CV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_CV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d0);
|
|
|
|
|
|
|
|
#define P_SLR_CV_INTTERM_LESS \
|
|
|
|
d0 = do_sll(d1, -i2);
|
|
|
|
|
|
|
|
#define P_SLR_CV_INTTERM_GREATER \
|
|
|
|
d0 = MkIntegerTerm(SLR(d1, i2));
|
|
|
|
|
|
|
|
#define P_SLR_CV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLR_CV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_CV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_CV_SLR_CV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_INSTINIT \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL8 pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_Y_VV_SLR_Y_VV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_Y_VV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_INTTERM_LESS \
|
|
|
|
d0 = do_sll(IntOfTerm(d0), -i2);
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_INTTERM_GREATER \
|
|
|
|
d0 = MkIntTerm(SLR(IntOfTerm(d0), i2));
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_SLR_Y_VV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VV_SLR_Y_VV_NVAR_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VC_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL8 pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_Y_VC_SLR_Y_VC_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_Y_VC_INTTERM \
|
|
|
|
d0 = MkIntTerm(SLR(IntOfTerm(d0), d1));
|
|
|
|
|
|
|
|
#define P_SLR_Y_VC_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VC_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VC_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_Y_VC_SLR_Y_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_INSTINIT \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_Y_CV_SLR_Y_CV_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
Int d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_SLR_Y_CV_INTTERM_INIT \
|
|
|
|
Int i2 = IntOfTerm(d0);
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_INTTERM_LESS \
|
|
|
|
d0 = do_sll(d1, -i2);
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_INTTERM_GREATER \
|
|
|
|
d0 = MkIntegerTerm(SLR(d1, i2));
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_NOINTTERM \
|
|
|
|
saveregs(); \
|
|
|
|
d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0)); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_D0EQUALS0L \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_NVAR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt0,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_SLR_Y_CV_SLR_Y_CV_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_NilError(INSTANTIATION_ERROR, "X is A>>B"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XX_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL* pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.plxxs.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define CALL_BFUNC_XX_CALL_BFUNC_XX_NVAR \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.plxxs.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define CALL_BFUNC_XX_CALL_BFUNC_XX2_NVAR_INT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_XX_CALL_BFUNC_XX2_NVAR_INT; \
|
|
|
|
if (IsIntTerm(d0) && IsIntTerm(d1)) { \
|
|
|
|
COUNT flags; \
|
|
|
|
Int v = IntOfTerm(d0) - IntOfTerm(d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
flags = (*_PREG)->u.plxxs.flags; \
|
2014-07-13 05:30:14 +01:00
|
|
|
if (v > 0) { \
|
|
|
|
if (flags & GT_OK_IN_CMP) { \
|
|
|
|
yamop *nextp = NEXTOP((*_PREG), plxxs); \
|
|
|
|
(*_PREG) = nextp; \
|
|
|
|
ALWAYS_GONext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
yamop *nextp = (*_PREG)->u.plxxs.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = nextp; \
|
|
|
|
ALWAYS_GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else if (v < 0) { \
|
|
|
|
if (flags & LT_OK_IN_CMP) { \
|
|
|
|
yamop *nextp = NEXTOP((*_PREG), plxxs); \
|
|
|
|
(*_PREG) = nextp; \
|
|
|
|
ALWAYS_GONext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
yamop *nextp = (*_PREG)->u.plxxs.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = nextp; \
|
|
|
|
ALWAYS_GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
if (flags & EQ_OK_IN_CMP) { \
|
|
|
|
yamop *nextp = NEXTOP((*_PREG), plxxs); \
|
|
|
|
(*_PREG) = nextp; \
|
|
|
|
ALWAYS_GONext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
yamop *nextp = (*_PREG)->u.plxxs.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = nextp; \
|
|
|
|
ALWAYS_GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XX_CALL_BFUNC_XX2_NVAR_NOINT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_XX_CALL_BFUNC_XX2_NVAR_NOINT; \
|
2015-01-18 01:32:13 +00:00
|
|
|
CmpPredicate f = (*_PREG)->u.plxxs.p->cs.d_code; \
|
2014-07-13 05:30:14 +01:00
|
|
|
saveregs(); \
|
|
|
|
d0 = (CELL) (f) (d0,d1); \
|
|
|
|
setregs(); \
|
|
|
|
if ((*_PREG) == FAILCODE) { \
|
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
else if (!d0) { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxxs.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxxs); \
|
|
|
|
JMPNext(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XX_CALL_BFUNC_XX_UNK \
|
|
|
|
d1 = Deref(d1);
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YX_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.plxys.y; \
|
|
|
|
d1 = XREG((*_PREG)->u.plxys.x); \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0;
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YX_CALL_BFUNC_YX2_NVAR_INT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_YX_CALL_BFUNC_YX2_NVAR_INT; \
|
|
|
|
if (IsIntTerm(d0) && IsIntTerm(d1)) { \
|
|
|
|
int flags; \
|
|
|
|
Int v = IntOfTerm(d0) - IntOfTerm(d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
flags = (*_PREG)->u.plxys.flags; \
|
2014-07-13 05:30:14 +01:00
|
|
|
if (v > 0) { \
|
|
|
|
if (flags & GT_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} else if (v < 0) { \
|
|
|
|
if (flags & LT_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} else { \
|
|
|
|
if (flags & EQ_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YX_CALL_BFUNC_YX2_NVAR_NOINT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_YX_CALL_BFUNC_YX2_NVAR_NOINT; \
|
2015-01-18 01:32:13 +00:00
|
|
|
CmpPredicate f = (*_PREG)->u.plxys.p->cs.d_code; \
|
2014-07-13 05:30:14 +01:00
|
|
|
saveregs(); \
|
|
|
|
d0 = (CELL) (f) (d0,d1); \
|
|
|
|
setregs(); \
|
|
|
|
if (!d0 || (*_PREG) == FAILCODE) { \
|
|
|
|
if ((*_PREG) != FAILCODE) { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
} \
|
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YX_CALL_BFUNC_YX_UNK \
|
|
|
|
d1 = Deref(d1);
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XY_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.plxys.y; \
|
|
|
|
d0 = XREG((*_PREG)->u.plxys.x); \
|
2014-07-13 05:30:14 +01:00
|
|
|
d1 = *pt0;
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XY_CALL_BFUNC_XY2_NVAR_INT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_XY_CALL_BFUNC_XY2_NVAR_INT; \
|
|
|
|
if (IsIntTerm(d0) && IsIntTerm(d1)) { \
|
|
|
|
int flags; \
|
|
|
|
Int v = IntOfTerm(d0) - IntOfTerm(d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
flags = (*_PREG)->u.plxys.flags; \
|
2014-07-13 05:30:14 +01:00
|
|
|
if (v > 0) { \
|
|
|
|
if (flags & GT_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} else if (v < 0) { \
|
|
|
|
if (flags & LT_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} else { \
|
|
|
|
if (flags & EQ_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XY_CALL_BFUNC_XY2_NVAR_NOINT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_XY_CALL_BFUNC_XY2_NVAR_NOINT; \
|
2015-01-18 01:32:13 +00:00
|
|
|
CmpPredicate f = (*_PREG)->u.plxys.p->cs.d_code; \
|
2014-07-13 05:30:14 +01:00
|
|
|
saveregs(); \
|
|
|
|
d0 = (CELL) (f) (d0,d1); \
|
|
|
|
setregs(); \
|
|
|
|
if (!d0 || (*_PREG) == FAILCODE) { \
|
|
|
|
if ((*_PREG) != FAILCODE) { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plxys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
} \
|
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plxys); \
|
|
|
|
JMPNext(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_XY_CALL_BFUNC_XY_UNK \
|
|
|
|
d1 = Deref(d1);
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt0 = YREG + (*_PREG)->u.plyys.y1; \
|
|
|
|
pt1 = YREG + (*_PREG)->u.plyys.y2; \
|
2014-07-13 05:30:14 +01:00
|
|
|
d0 = *pt0; \
|
|
|
|
d1 = *pt1;
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_CALL_BFUNC_YY2_NVAR_INT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_YY_CALL_BFUNC_YY2_NVAR_INT; \
|
|
|
|
if (IsIntTerm(d0) && IsIntTerm(d1)) { \
|
|
|
|
int flags; \
|
|
|
|
Int v = IntOfTerm(d0) - IntOfTerm(d1); \
|
2015-01-18 01:32:13 +00:00
|
|
|
flags = (*_PREG)->u.plyys.flags; \
|
2014-07-13 05:30:14 +01:00
|
|
|
if (v > 0) { \
|
|
|
|
if (flags & GT_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plyys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plyys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} else if (v < 0) { \
|
|
|
|
if (flags & LT_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plyys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plyys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} else { \
|
|
|
|
if (flags & EQ_OK_IN_CMP) { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plyys); \
|
|
|
|
JMPNext(); \
|
|
|
|
} else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plyys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_CALL_BFUNC_YY2_NVAR_NOINT \
|
|
|
|
BLOCK = (CELL)CALL_BFUNC_YY_CALL_BFUNC_YY2_NVAR_NOINT; \
|
2015-01-18 01:32:13 +00:00
|
|
|
CmpPredicate f = (*_PREG)->u.plyys.p->cs.d_code; \
|
2014-07-13 05:30:14 +01:00
|
|
|
saveregs(); \
|
|
|
|
d0 = (CELL) (f) (d0,d1); \
|
|
|
|
setregs(); \
|
|
|
|
if (!d0 || (*_PREG) == FAILCODE) { \
|
|
|
|
if ((*_PREG) != FAILCODE) { \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plyys.f; \
|
2014-07-13 05:30:14 +01:00
|
|
|
} \
|
|
|
|
JMPNext(); \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plyys); \
|
|
|
|
JMPNext(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_NOINTTERM_NOFAILCODE \
|
2015-01-18 01:32:13 +00:00
|
|
|
(*_PREG) = (*_PREG)->u.plyys.f;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_NOINTTERM_NOD0 \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_NOINTTERM_END \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), plyys); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define CALL_BFUNC_YY_CALL_BFUNC_YY_UNK \
|
|
|
|
d1 = Deref(d1);
|
|
|
|
|
|
|
|
#define P_EQUAL_INSTINIT \
|
|
|
|
save_hb();
|
|
|
|
|
|
|
|
#define P_EQUAL_END \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), e); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#include "p_dif.i"
|
|
|
|
|
|
|
|
#include "p_eq.i"
|
|
|
|
|
|
|
|
#define P_ARG_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_ARG_VV_LOW_LEVEL_TRACER \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[0] = XREG((*_PREG)->u.xxx.x1); \
|
|
|
|
H[1] = XREG((*_PREG)->u.xxx.x2); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_ARG_VV_TEST_D0 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ARG_VV_ARG_ARG1_NVAR \
|
|
|
|
FAILED = 0; \
|
|
|
|
if (IsIntTerm(d0)) { \
|
|
|
|
d0 = IntOfTerm(d0); \
|
|
|
|
} else if (IsLongIntTerm(d0)) { \
|
|
|
|
d0 = LongIntOfTerm(d0); \
|
|
|
|
} else { \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_INTEGER,d0,"arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define P_ARG_VV_TEST_D1 \
|
|
|
|
if (!FAILED) { \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ARG_VV_ARG_ARG2_NVAR \
|
|
|
|
BLOCK = (CELL)P_ARG_VV_ARG_ARG2_NVAR; \
|
|
|
|
if (IsApplTerm(d1)) { \
|
|
|
|
pt0 = RepAppl(d1); \
|
|
|
|
d1 = *pt0; \
|
|
|
|
if (IsExtensionFunctor((Functor) d1)) { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else if ((Int)d0 <= 0 || \
|
|
|
|
(Int)d0 > ArityOfFunctor((Functor) d1)) { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = pt0[d0]; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else if (IsPairTerm(d1)) { \
|
|
|
|
pt0 = RepPair(d1); \
|
|
|
|
if (d0 != 1 && d0 != 2) { \
|
|
|
|
if ((Int)d0 < 0) { \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, \
|
|
|
|
MkIntegerTerm(d0),"arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
} \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = pt0[d0-1]; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define P_ARG_VV_ARG_ARG2_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1,"arg 2 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_ARG_VV_ARG_ARG1_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_ARG_CV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_ARG_CV_LOW_LEVEL_TRACER \
|
|
|
|
CELL *Ho = HR; \
|
2015-01-18 01:32:13 +00:00
|
|
|
Term t = MkIntegerTerm((*_PREG)->u.xxn.c); \
|
|
|
|
H[0] = t; \
|
|
|
|
H[1] = XREG((*_PREG)->u.xxn.xi); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),H); \
|
|
|
|
H = HRo;
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_ARG_CV_TEST_D1 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = (*_PREG)->u.xxn.c; \
|
|
|
|
d1 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ARG_CV_ARG_ARG2_VC_NVAR \
|
|
|
|
BLOCK = (CELL)P_ARG_CV_ARG_ARG2_VC_NVAR; \
|
|
|
|
FAILED = 0; \
|
|
|
|
if (IsApplTerm(d1)) { \
|
|
|
|
pt0 = RepAppl(d1); \
|
|
|
|
d1 = *pt0; \
|
|
|
|
if (IsExtensionFunctor((Functor) d1)) { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else if ((Int)d0 <= 0 || \
|
|
|
|
(Int)d0 > ArityOfFunctor((Functor) d1)) { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = pt0[d0]; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else if (IsPairTerm(d1)) { \
|
|
|
|
pt0 = RepPair(d1); \
|
|
|
|
if (d0 != 1 && d0 != 2) { \
|
|
|
|
if ((Int)d0 < 0) { \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, \
|
|
|
|
MkIntegerTerm(d0),"arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
} \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = pt0[d0-1]; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxn); \
|
|
|
|
GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define P_ARG_CV_ARG_ARG2_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1,"arg 2 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_ARG_Y_VV_INSTINIT \
|
|
|
|
BLOCKADDRESS = (CELL)(*_PREG); \
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_ARG_Y_VV_LOW_LEVEL_TRACER \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[0] = XREG((*_PREG)->u.yxx.x1); \
|
|
|
|
H[1] = XREG((*_PREG)->u.yxx.x2); \
|
|
|
|
H[2] = YREG[(*_PREG)->u.yxx.y]; \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_ARG_Y_VV_TEST_D0 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ARG_Y_VV_ARG_Y_ARG1_NVAR \
|
|
|
|
FAILED = 0; \
|
|
|
|
if (IsIntTerm(d0)) { \
|
|
|
|
d0 = IntOfTerm(d0); \
|
|
|
|
} else if (IsLongIntTerm(d0)) { \
|
|
|
|
d0 = LongIntOfTerm(d0); \
|
|
|
|
} else { \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_INTEGER,d0,"arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define P_ARG_Y_VV_TEST_D1 \
|
|
|
|
if (!FAILED) { \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.yxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ARG_Y_VV_ARG_Y_ARG2_NVAR \
|
|
|
|
BLOCK = (CELL)P_ARG_Y_VV_ARG_Y_ARG2_NVAR; \
|
|
|
|
if (IsApplTerm(d1)) { \
|
|
|
|
pt0 = RepAppl(d1); \
|
|
|
|
d1 = *pt0; \
|
|
|
|
if (IsExtensionFunctor((Functor) d1)) { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else if ((Int)d0 <= 0 || \
|
|
|
|
(Int)d0 > ArityOfFunctor((Functor) d1)) { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,pt0[d0]); \
|
|
|
|
GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else if (IsPairTerm(d1)) { \
|
|
|
|
pt0 = RepPair(d1); \
|
|
|
|
if (d0 != 1 && d0 != 2) { \
|
|
|
|
if ((Int)d0 < 0) { \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, \
|
|
|
|
MkIntegerTerm(d0),"arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
} \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
else { \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,pt0[d0-1]); \
|
|
|
|
GONext(); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
YAAM_FAIL; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define P_ARG_Y_VV_ARG_Y_ARG2_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1,"arg 2 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_ARG_Y_VV_ARG_Y_ARG1_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "arg 1 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_ARG_Y_CV_LOW_LEVEL_TRACER \
|
|
|
|
CELL *Ho = HR; \
|
2015-01-18 01:32:13 +00:00
|
|
|
Term t = MkIntegerTerm((*_PREG)->u.yxn.c); \
|
|
|
|
H[0] = t; \
|
|
|
|
H[1] = XREG((*_PREG)->u.yxn.xi); \
|
|
|
|
H[2] = YREG[(*_PREG)->u.yxn.y]; \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorArg,0)),H); \
|
|
|
|
H = HRo;
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_TEST_D1 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = (*_PREG)->u.yxn.c; \
|
|
|
|
d1 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_ARG_Y_CV_D1APPL_INIT \
|
|
|
|
pt0 = RepAppl(d1); \
|
|
|
|
d1 = *pt0;
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_D1APPL_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,pt0[d0]); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_D1PAIR_INIT \
|
|
|
|
pt0 = RepPair(d1);
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_D1PAIR_LESS0 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, \
|
|
|
|
MkIntegerTerm(d0),"arg 1 of arg/3"); \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_D1PAIR_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxn); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,pt0[d0-1]); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_ARG_Y_CV_ARG_Y_ARG2_VC_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1,"arg 2 of arg/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2S_VV_LOW_LEVEL_TRACER \
|
|
|
|
RESET_VARIABLE(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[1] = XREG((*_PREG)->u.xxx.x1); \
|
|
|
|
H[2] = XREG((*_PREG)->u.xxx.x2); \
|
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2S_TEST_D0 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_VV_TEST_D1 \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.xxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_VV_D1INT \
|
|
|
|
d1 = IntegerOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_D1NOTINT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_D1BIGINT \
|
|
|
|
Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_D1NOTBIGINT \
|
|
|
|
Yap_Error(TYPE_ERROR_INTEGER, d1, "functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_D1NOTINT_END \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_D0NOTATOMIC \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_FIRSTIFOK \
|
|
|
|
RESET_VARIABLE(HR); \
|
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
d0 = AbsPair(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H += 2; \
|
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxx),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_D0NOTATOM \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_D0ATOM \
|
|
|
|
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_POST_D0ATOM \
|
|
|
|
pt1 = HR; \
|
|
|
|
*pt1++ = d0; \
|
|
|
|
d0 = AbsAppl(HR);
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_FIRSTIFOK_INIT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_FIRSTIFOK_IFOK \
|
2015-09-25 10:57:26 +01:00
|
|
|
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_FIRSTIFOK_NOIF \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_INSIDEWHILE \
|
|
|
|
RESET_VARIABLE(pt1); \
|
|
|
|
pt1++;
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_SECONDIFOK_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
H = pt1; \
|
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxx),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_THIRDIFOK \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxx),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_ELSE \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,MkIntegerTerm(d1),"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_FUNC2S_UNK2 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VV_FUNC2S_UNK \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2S_CV_LOW_LEVEL_TRACER \
|
|
|
|
RESET_VARIABLE(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[1] = (*_PREG)->u.xxc.c; \
|
|
|
|
H[2] = XREG((*_PREG)->u.xxc.xi); \
|
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_TEST_D1 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = (*_PREG)->u.xxc.c; \
|
|
|
|
d1 = XREG((*_PREG)->u.xxc.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1INT \
|
|
|
|
d1 = IntegerOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1NOTINT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1NOINT_D1BIGINT \
|
|
|
|
Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1NOTBIGINT \
|
|
|
|
Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_POST_IF \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_FIRSTIFOK \
|
|
|
|
RESET_VARIABLE(HR); \
|
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
d0 = AbsPair(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H += 2; \
|
|
|
|
XREG((*_PREG)->u.xxc.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxc),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_D0NOTATOM \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_D0ATOM \
|
|
|
|
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_POST_IF \
|
|
|
|
pt1 = HR; \
|
|
|
|
*pt1++ = d0; \
|
|
|
|
d0 = AbsAppl(HR);
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_IFOK_INIT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_IFOK_IFOK \
|
2015-09-25 10:57:26 +01:00
|
|
|
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_IFOK_NOIF \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_INSIDEWHILE \
|
|
|
|
RESET_VARIABLE(pt1); \
|
|
|
|
pt1++;
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1GREATER_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
H = pt1; \
|
|
|
|
XREG((*_PREG)->u.xxc.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxc),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_D1ISZERO \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxc.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxc),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_ELSE \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,MkIntegerTerm(d1),"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_CV_END \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2S_VC_LOW_LEVEL_TRACER \
|
|
|
|
Term ti; \
|
|
|
|
CELL *hi = HR; \
|
2015-01-18 01:32:13 +00:00
|
|
|
ti = MkIntegerTerm((*_PREG)->u.xxn.c); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[1] = XREG((*_PREG)->u.xxn.xi); \
|
|
|
|
H[2] = ti; \
|
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H); \
|
|
|
|
H = hi;
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_TEST_D0 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_VC_FUNC2S_NVAR_VC \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = (*_PREG)->u.xxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_VC_D0NOATOMIC \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_EQUALS \
|
|
|
|
RESET_VARIABLE(HR); \
|
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
d0 = AbsPair(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H += 2; \
|
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxn),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_D1ISZERO \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxn),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_D0NOATOM \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_D0ATOM \
|
|
|
|
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_POST_ELSE \
|
|
|
|
pt1 = HR; \
|
|
|
|
*pt1++ = d0; \
|
|
|
|
d0 = AbsAppl(HR);
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_IFOK_INIT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_IFOK_IFOK \
|
2015-09-25 10:57:26 +01:00
|
|
|
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_IFOK_NOIF \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_INSIDEWHILE \
|
|
|
|
RESET_VARIABLE(pt1); \
|
|
|
|
pt1++;
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_END1 \
|
|
|
|
HR = pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxn.x) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), xxn),Osbpp),l); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_VC_END2 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2S_Y_VV_LOW_LEVEL_TRACER \
|
|
|
|
RESET_VARIABLE(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[1] = XREG((*_PREG)->u.yxx.x1); \
|
|
|
|
H[2] = XREG((*_PREG)->u.yxx.x2); \
|
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_TEST_D0 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x1);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_TEST_D1 \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = XREG((*_PREG)->u.yxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1INT \
|
|
|
|
d1 = IntegerOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1NOTINT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1BIGINT \
|
|
|
|
Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1NOTBIGINT \
|
|
|
|
Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_POST_IF \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D0NOATOMIC \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_EQUALS \
|
|
|
|
RESET_VARIABLE(HR); \
|
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
d0 = AbsPair(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H += 2; \
|
|
|
|
pt1 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxx),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_D0NOATOM \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_D0ATOM \
|
|
|
|
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_POST_ELSE \
|
|
|
|
pt1 = HR; \
|
|
|
|
*pt1++ = d0; \
|
|
|
|
d0 = AbsAppl(HR);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_IFOK_INIT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_IFOK_IFOK \
|
2015-09-25 10:57:26 +01:00
|
|
|
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_IFOK_NOIF \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_INSIDEWHILE \
|
|
|
|
RESET_VARIABLE(pt1); \
|
|
|
|
pt1++;
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1GREATER_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
H = pt1; \
|
|
|
|
pt1 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxx),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_D1ISZERO \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxx.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxx),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_ELSE \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,MkIntegerTerm(d1),"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_END1 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VV_END2 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2S_Y_CV_LOW_LEVEL_TRACER \
|
|
|
|
RESET_VARIABLE(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[1] = (*_PREG)->u.yxn.c; \
|
|
|
|
H[2] = XREG((*_PREG)->u.yxn.xi); \
|
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_TEST_D1 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = (*_PREG)->u.yxn.c; \
|
|
|
|
d1 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1INT \
|
|
|
|
d1 = IntegerOfTerm(d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1NOTINT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1BIGINT \
|
|
|
|
Yap_Error(RESOURCE_ERROR_STACK, d1, "functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1NOTBIGINT \
|
|
|
|
Yap_Error(TYPE_ERROR_INTEGER,d1,"functor/3");
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_POST_IF \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_EQUALS \
|
|
|
|
RESET_VARIABLE(HR); \
|
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
d0 = AbsPair(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H += 2; \
|
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxn),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_D0NOATOM \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_D0ATOM \
|
|
|
|
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_POST_ELSE \
|
|
|
|
pt1 = HR; \
|
|
|
|
*pt1++ = d0; \
|
|
|
|
d0 = AbsAppl(HR);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_IFOK_INIT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_IFOK_IFOK \
|
2015-09-25 10:57:26 +01:00
|
|
|
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_IFOK_NOIF \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_INSIDEWHILE \
|
|
|
|
RESET_VARIABLE(pt1); \
|
|
|
|
pt1++;
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1GREATER_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
H = pt1; \
|
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxn),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_D1ISZERO \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxn),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_ELSE \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,MkIntegerTerm(d1),"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_CV_END \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d1, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2S_Y_VC_LOW_LEVEL_TRACER \
|
|
|
|
Term ti; \
|
|
|
|
CELL *hi = HR; \
|
2015-01-18 01:32:13 +00:00
|
|
|
ti = MkIntegerTerm((Int)((*_PREG)->u.yxn.c)); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[1] = XREG((*_PREG)->u.yxn.xi); \
|
|
|
|
H[2] = ti; \
|
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H); \
|
|
|
|
H = hi;
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_TEST_D0 \
|
|
|
|
register CELL d0, d1; \
|
|
|
|
register CELL *pt0, *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxn.xi);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_FUNC2S_Y_NVAR_VC \
|
2015-01-18 01:32:13 +00:00
|
|
|
d1 = (*_PREG)->u.yxn.c;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_D0NOATOMIC \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_EQUALS \
|
|
|
|
RESET_VARIABLE(HR); \
|
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
d0 = AbsPair(HR); \
|
2015-01-18 01:32:13 +00:00
|
|
|
H += 2; \
|
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxn),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_D1ISZERO \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxn),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_D0NOATOM1 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_D0NOATOM2 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(TYPE_ERROR_ATOM,d0,"functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_D0ATOM \
|
|
|
|
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_POST_ELSE \
|
|
|
|
pt1 = HR; \
|
|
|
|
*pt1++ = d0; \
|
|
|
|
d0 = AbsAppl(HR);
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_IFOK_INIT \
|
|
|
|
saveregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_IFOK_IFOK \
|
2015-09-25 10:57:26 +01:00
|
|
|
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage); \
|
2014-07-13 05:30:14 +01:00
|
|
|
setregs(); \
|
|
|
|
JMPNext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_IFOK_NOIF \
|
|
|
|
setregs();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_INSIDEWHILE \
|
|
|
|
RESET_VARIABLE(pt1); \
|
|
|
|
pt1++;
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_END1 \
|
|
|
|
HR = pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
pt1 = YREG + (*_PREG)->u.yxn.y; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP(NEXTOP(NEXTOP((*_PREG), yxn),Osbpp),l); \
|
|
|
|
INITIALIZE_PERMVAR(pt1,d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2S_Y_VC_END2 \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2F_XX_LOW_LEVEL_TRACER \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[0] = XREG((*_PREG)->u.xxx.x); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_TEST_D0 \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL* pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxx.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_XX_D0APPL \
|
|
|
|
Functor d1 = FunctorOfTerm(d0);
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_D0APPL_D1EXTFUNC \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x1) = d0; \
|
|
|
|
XREG((*_PREG)->u.xxx.x2) = MkIntTerm(0); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_D0APPL_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x1) = MkAtomTerm(NameOfFunctor(d1)); \
|
|
|
|
XREG((*_PREG)->u.xxx.x2) = MkIntegerTerm(ArityOfFunctor(d1)); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_D0PAIR \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x1) = TermDot; \
|
|
|
|
XREG((*_PREG)->u.xxx.x2) = MkIntTerm(2); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_D0NOCOMPOUND \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxx.x1) = d0; \
|
|
|
|
XREG((*_PREG)->u.xxx.x2) = MkIntTerm(0); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxx); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XX_END \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XY_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2F_XY_LOW_LEVEL_TRACER \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[0] = XREG((*_PREG)->u.xxy.x); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2F_XY_TEST_D0 \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.xxy.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_XY_D0APPL \
|
|
|
|
Functor d1 = FunctorOfTerm(d0); \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.xxy.y2;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_XY_D0APPL_D1EXTFUNC \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxy.x1) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxy); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, MkIntTerm(0)); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XY_D0APPL_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.xxy.x1) = MkAtomTerm(NameOfFunctor(d1)); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxy); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, MkIntegerTerm(ArityOfFunctor(d1))); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XY_D0PAIR \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.xxy.y2; \
|
|
|
|
XREG((*_PREG)->u.xxy.x1) = TermDot; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxy); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, MkIntTerm(2)); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XY_D0NOCOMPOUND \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.xxy.y2; \
|
|
|
|
XREG((*_PREG)->u.xxy.x1) = d0; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), xxy); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, MkIntTerm(0)); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_XY_END \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YX_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2F_YX_LOW_LEVEL_TRACER \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[0] = XREG((*_PREG)->u.yxx.x2); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2F_YX_TEST_D0 \
|
|
|
|
register CELL d0; \
|
|
|
|
register CELL *pt1; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yxx.x2);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_YX_D0APPL \
|
|
|
|
Functor d1 = FunctorOfTerm(d0); \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.yxx.y;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_YX_D0APPL_D1EXTFUNC \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.yxx.x1) = MkIntTerm(0); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YX_D0APPL_END \
|
2015-01-18 01:32:13 +00:00
|
|
|
XREG((*_PREG)->u.yxx.x1) = MkIntegerTerm(ArityOfFunctor(d1)); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, MkAtomTerm(NameOfFunctor(d1))); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YX_D0PAIR \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.yxx.y; \
|
|
|
|
XREG((*_PREG)->u.yxx.x1) = MkIntTerm(2); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0 ,TermDot); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YX_D0NOCOMPOUND \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.yxx.y; \
|
|
|
|
XREG((*_PREG)->u.yxx.x1) = MkIntTerm(0); \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yxx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, d0); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YX_END \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YY_INSTINIT
|
|
|
|
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
#define P_FUNC2F_YY_LOW_LEVEL_TRACER \
|
2015-01-18 01:32:13 +00:00
|
|
|
H[0] = XREG((*_PREG)->u.yyx.x); \
|
2014-07-13 05:30:14 +01:00
|
|
|
RESET_VARIABLE(HR+1); \
|
|
|
|
RESET_VARIABLE(HR+2); \
|
2015-01-18 01:32:13 +00:00
|
|
|
low_level_trace(enter_pred,RepPredProp(Yap_GetPredPropByFunc(FunctorFunctor,0)),H);
|
2014-07-13 05:30:14 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define P_FUNC2F_YY_TEST_D0 \
|
|
|
|
register CELL d0; \
|
2015-01-18 01:32:13 +00:00
|
|
|
d0 = XREG((*_PREG)->u.yyx.x);
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_YY_D0APPL \
|
|
|
|
Functor d1 = FunctorOfTerm(d0); \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.yyx.y1; \
|
|
|
|
CELL *pt1 = YREG+(*_PREG)->u.yyx.y2;
|
2014-07-13 05:30:14 +01:00
|
|
|
|
|
|
|
#define P_FUNC2F_YY_D0APPL_D1EXTFUNC \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yyx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, d0); \
|
|
|
|
INITIALIZE_PERMVAR(pt1, MkIntTerm(0)); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YY_D0APPL_END \
|
|
|
|
(*_PREG) = NEXTOP((*_PREG), yyx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, MkAtomTerm(NameOfFunctor(d1))); \
|
|
|
|
INITIALIZE_PERMVAR(pt1, MkIntegerTerm(ArityOfFunctor(d1))); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YY_D0PAIR \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.yyx.y1; \
|
|
|
|
CELL *pt1 = YREG+(*_PREG)->u.yyx.y2; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yyx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, TermDot); \
|
|
|
|
INITIALIZE_PERMVAR(pt1, MkIntTerm(2)); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YY_D0NOCOMPOUND \
|
2015-01-18 01:32:13 +00:00
|
|
|
CELL *pt0 = YREG+(*_PREG)->u.yyx.y1; \
|
|
|
|
CELL *pt1 = YREG+(*_PREG)->u.yyx.y2; \
|
2014-07-13 05:30:14 +01:00
|
|
|
(*_PREG) = NEXTOP((*_PREG), yyx); \
|
|
|
|
INITIALIZE_PERMVAR(pt0, d0); \
|
|
|
|
INITIALIZE_PERMVAR(pt1, MkIntTerm(0)); \
|
|
|
|
GONext();
|
|
|
|
|
|
|
|
#define P_FUNC2F_YY_END \
|
|
|
|
saveregs(); \
|
|
|
|
Yap_Error(INSTANTIATION_ERROR, d0, "functor/3"); \
|
|
|
|
setregs(); \
|
|
|
|
FAIL();
|
|
|
|
|
|
|
|
#include "p_functor.i"
|