pass regs when constructing long ints and floats.
fix small gcc complaints.
This commit is contained in:
parent
a599699f0c
commit
d163cadda1
104
C/absmi.c
104
C/absmi.c
@ -9376,7 +9376,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9421,7 +9421,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9462,7 +9462,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_plus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9510,7 +9510,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_plus(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9554,7 +9554,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9599,7 +9599,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_minus(MkIntegerTerm(d1),Yap_Eval(d0));
|
||||
d0 = p_minus(MkIntegerTerm(d1),Yap_Eval(d0) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9640,7 +9640,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_minus(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9688,7 +9688,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_minus(MkIntegerTerm(d1), Yap_Eval(d0));
|
||||
d0 = p_minus(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9728,11 +9728,11 @@ Yap_absmi(int inp)
|
||||
times_vv_nvar_nvar:
|
||||
/* d0 and d1 are where I want them */
|
||||
if (IsIntTerm(d0) && IsIntTerm(d1)) {
|
||||
d0 = times_int(IntOfTerm(d0), IntOfTerm(d1));
|
||||
d0 = times_int(IntOfTerm(d0), IntOfTerm(d1) PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9773,11 +9773,11 @@ Yap_absmi(int inp)
|
||||
{
|
||||
Int d1 = PREG->u.xxn.c;
|
||||
if (IsIntTerm(d0)) {
|
||||
d0 = times_int(IntOfTerm(d0), d1);
|
||||
d0 = times_int(IntOfTerm(d0), d1 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9814,11 +9814,11 @@ Yap_absmi(int inp)
|
||||
times_y_vv_nvar_nvar:
|
||||
/* d0 and d1 are where I want them */
|
||||
if (IsIntTerm(d0) && IsIntTerm(d1)) {
|
||||
d0 = times_int(IntOfTerm(d0), IntOfTerm(d1));
|
||||
d0 = times_int(IntOfTerm(d0), IntOfTerm(d1) PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_times(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9862,11 +9862,11 @@ Yap_absmi(int inp)
|
||||
{
|
||||
Int d1 = PREG->u.yxn.c;
|
||||
if (IsIntTerm(d0)) {
|
||||
d0 = times_int(IntOfTerm(d0), d1);
|
||||
d0 = times_int(IntOfTerm(d0), d1 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_times(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9917,7 +9917,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -9962,7 +9962,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1));
|
||||
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10006,7 +10006,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_div(MkIntegerTerm(d1),Yap_Eval(d0));
|
||||
d0 = p_div(MkIntegerTerm(d1),Yap_Eval(d0) PASS_REGS);
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage);
|
||||
@ -10053,7 +10053,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_div(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10101,7 +10101,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1));
|
||||
d0 = p_div(Yap_Eval(d0),MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10148,7 +10148,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_div(MkIntegerTerm(d1), Yap_Eval(d0));
|
||||
d0 = p_div(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10193,7 +10193,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10238,7 +10238,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10279,7 +10279,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_and(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10327,7 +10327,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_and(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10372,7 +10372,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10417,7 +10417,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage);
|
||||
@ -10457,7 +10457,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_or(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10505,7 +10505,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_or(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10549,11 +10549,11 @@ Yap_absmi(int inp)
|
||||
if (i2 < 0)
|
||||
d0 = MkIntegerTerm(SLR(IntOfTerm(d0), -i2));
|
||||
else
|
||||
d0 = do_sll(IntOfTerm(d0),i2);
|
||||
d0 = do_sll(IntOfTerm(d0),i2 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
if (d0 == 0L) {
|
||||
@ -10594,11 +10594,11 @@ Yap_absmi(int inp)
|
||||
{
|
||||
Int d1 = PREG->u.xxn.c;
|
||||
if (IsIntTerm(d0)) {
|
||||
d0 = do_sll(IntOfTerm(d0), (Int)d1);
|
||||
d0 = do_sll(IntOfTerm(d0), (Int)d1 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
}
|
||||
@ -10635,11 +10635,11 @@ Yap_absmi(int inp)
|
||||
if (i2 < 0)
|
||||
d0 = MkIntegerTerm(SLR(d1, -i2));
|
||||
else
|
||||
d0 = do_sll(d1,i2);
|
||||
d0 = do_sll(d1,i2 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(d0));
|
||||
d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
}
|
||||
@ -10680,11 +10680,11 @@ Yap_absmi(int inp)
|
||||
if (i2 < 0)
|
||||
d0 = MkIntegerTerm(SLR(IntOfTerm(d0), -i2));
|
||||
else
|
||||
d0 = do_sll(IntOfTerm(d0),i2);
|
||||
d0 = do_sll(IntOfTerm(d0),i2 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_sll(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
if (d0 == 0L) {
|
||||
@ -10728,11 +10728,11 @@ Yap_absmi(int inp)
|
||||
{
|
||||
Int d1 = PREG->u.yxn.c;
|
||||
if (IsIntTerm(d0)) {
|
||||
d0 = do_sll(IntOfTerm(d0), Yap_Eval(d1));
|
||||
d0 = do_sll(IntOfTerm(d0), Yap_Eval(d1) PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_sll(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
}
|
||||
@ -10773,11 +10773,11 @@ Yap_absmi(int inp)
|
||||
if (i2 < 0)
|
||||
d0 = MkIntegerTerm(SLR(d1, -i2));
|
||||
else
|
||||
d0 = do_sll(d1,i2);
|
||||
d0 = do_sll(d1,i2 PASS_REGS);
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(0));
|
||||
d0 = p_sll(MkIntegerTerm(d1), Yap_Eval(0) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
}
|
||||
@ -10819,13 +10819,13 @@ Yap_absmi(int inp)
|
||||
if (IsIntTerm(d0) && IsIntTerm(d1)) {
|
||||
Int i2 = IntOfTerm(d1);
|
||||
if (i2 < 0)
|
||||
d0 = do_sll(IntOfTerm(d0), -i2);
|
||||
d0 = do_sll(IntOfTerm(d0), -i2 PASS_REGS);
|
||||
else
|
||||
d0 = MkIntTerm(SLR(IntOfTerm(d0), i2));
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
if (d0 == 0L) {
|
||||
@ -10870,7 +10870,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -10905,13 +10905,13 @@ Yap_absmi(int inp)
|
||||
if (IsIntTerm(d0)) {
|
||||
Int i2 = IntOfTerm(d0);
|
||||
if (i2 < 0)
|
||||
d0 = do_sll(d1, -i2);
|
||||
d0 = do_sll(d1, -i2 PASS_REGS);
|
||||
else
|
||||
d0 = MkIntegerTerm(SLR(d1, i2));
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0));
|
||||
d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
}
|
||||
@ -10950,13 +10950,13 @@ Yap_absmi(int inp)
|
||||
if (IsIntTerm(d0) && IsIntTerm(d1)) {
|
||||
Int i2 = IntOfTerm(d1);
|
||||
if (i2 < 0)
|
||||
d0 = do_sll(IntOfTerm(d0), -i2);
|
||||
d0 = do_sll(IntOfTerm(d0), -i2 PASS_REGS);
|
||||
else
|
||||
d0 = MkIntTerm(SLR(IntOfTerm(d0), i2));
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1));
|
||||
d0 = p_slr(Yap_Eval(d0), Yap_Eval(d1) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
BEGP(pt0);
|
||||
@ -11004,7 +11004,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1));
|
||||
d0 = p_slr(Yap_Eval(d0), MkIntegerTerm(d1) PASS_REGS);
|
||||
setregs();
|
||||
if (d0 == 0L) {
|
||||
saveregs();
|
||||
@ -11041,13 +11041,13 @@ Yap_absmi(int inp)
|
||||
if (IsIntTerm(d0)) {
|
||||
Int i2 = IntOfTerm(d0);
|
||||
if (i2 < 0)
|
||||
d0 = do_sll(d1, -i2);
|
||||
d0 = do_sll(d1, -i2 PASS_REGS);
|
||||
else
|
||||
d0 = MkIntegerTerm(SLR(d1, i2));
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0));
|
||||
d0 = p_slr(MkIntegerTerm(d1), Yap_Eval(d0) PASS_REGS);
|
||||
setregs();
|
||||
}
|
||||
}
|
||||
|
@ -852,7 +852,6 @@ Yap_NewPredPropByFunctor(FunctorEntry *fe, Term cur_mod)
|
||||
p->FunctorOfPred = fe;
|
||||
WRITE_UNLOCK(fe->FRWLock);
|
||||
{
|
||||
CACHE_REGS
|
||||
Yap_inform_profiler_of_clause(&(p->OpcodeOfPred), &(p->OpcodeOfPred)+1, p, GPROF_NEW_PRED_FUNC);
|
||||
if (!(p->PredFlags & (CPredFlag|AsmPredFlag))) {
|
||||
Yap_inform_profiler_of_clause(&(p->cs.p_code.ExpandCode), &(p->cs.p_code.ExpandCode)+1, p, GPROF_NEW_PRED_FUNC);
|
||||
@ -966,7 +965,6 @@ Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod)
|
||||
p->FunctorOfPred = (Functor)AbsAtom(ae);
|
||||
WRITE_UNLOCK(ae->ARWLock);
|
||||
{
|
||||
CACHE_REGS
|
||||
Yap_inform_profiler_of_clause(&(p->OpcodeOfPred), &(p->OpcodeOfPred)+1, p, GPROF_NEW_PRED_ATOM);
|
||||
if (!(p->PredFlags & (CPredFlag|AsmPredFlag))) {
|
||||
Yap_inform_profiler_of_clause(&(p->cs.p_code.ExpandCode), &(p->cs.p_code.ExpandCode)+1, p, GPROF_NEW_PRED_ATOM);
|
||||
@ -1057,8 +1055,10 @@ Yap_GetValue(Atom a)
|
||||
if (IsApplTerm(out)) {
|
||||
Functor f = FunctorOfTerm(out);
|
||||
if (f == FunctorDouble) {
|
||||
CACHE_REGS
|
||||
out = MkFloatTerm(FloatOfTerm(out));
|
||||
} else if (f == FunctorLongInt) {
|
||||
CACHE_REGS
|
||||
out = MkLongIntTerm(LongIntOfTerm(out));
|
||||
}
|
||||
#ifdef USE_GMP
|
||||
|
@ -2056,10 +2056,7 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod
|
||||
save_machine_regs();
|
||||
siglongjmp(cip->CompilerBotch,2);
|
||||
}
|
||||
{
|
||||
CACHE_REGS
|
||||
Yap_inform_profiler_of_clause(newcp, (char *)(newcp)+size, ap, GPROF_INDEX);
|
||||
}
|
||||
Yap_LUIndexSpace_CP += size;
|
||||
#ifdef DEBUG
|
||||
Yap_NewCps++;
|
||||
|
25
C/arith1.c
25
C/arith1.c
@ -29,7 +29,7 @@ static char SccsId[] = "%W% %G%";
|
||||
#include "eval.h"
|
||||
|
||||
static Term
|
||||
float_to_int(Float v)
|
||||
float_to_int(Float v USES_REGS)
|
||||
{
|
||||
#if USE_GMP
|
||||
Int i = (Int)v;
|
||||
@ -44,7 +44,7 @@ float_to_int(Float v)
|
||||
#endif
|
||||
}
|
||||
|
||||
#define RBIG_FL(v) return(float_to_int(v))
|
||||
#define RBIG_FL(v) return(float_to_int(v PASS_REGS))
|
||||
|
||||
typedef struct init_un_eval {
|
||||
char *OpName;
|
||||
@ -118,7 +118,7 @@ double my_rint(double x)
|
||||
#endif
|
||||
|
||||
static Int
|
||||
msb(Int inp) /* calculate the most significant bit for an integer */
|
||||
msb(Int inp USES_REGS) /* calculate the most significant bit for an integer */
|
||||
{
|
||||
/* the obvious solution: do it by using binary search */
|
||||
Int out = 0;
|
||||
@ -141,7 +141,7 @@ msb(Int inp) /* calculate the most significant bit for an integer */
|
||||
}
|
||||
|
||||
static Int
|
||||
lsb(Int inp) /* calculate the least significant bit for an integer */
|
||||
lsb(Int inp USES_REGS) /* calculate the least significant bit for an integer */
|
||||
{
|
||||
/* the obvious solution: do it by using binary search */
|
||||
Int out = 0;
|
||||
@ -165,7 +165,7 @@ lsb(Int inp) /* calculate the least significant bit for an integer */
|
||||
}
|
||||
|
||||
static Int
|
||||
popcount(Int inp) /* calculate the least significant bit for an integer */
|
||||
popcount(Int inp USES_REGS) /* calculate the least significant bit for an integer */
|
||||
{
|
||||
/* the obvious solution: do it by using binary search */
|
||||
Int c = 0, j = 0, m = ((CELL)1);
|
||||
@ -185,7 +185,7 @@ popcount(Int inp) /* calculate the least significant bit for an integer */
|
||||
}
|
||||
|
||||
static Term
|
||||
eval1(Int fi, Term t) {
|
||||
eval1(Int fi, Term t USES_REGS) {
|
||||
arith1_op f = fi;
|
||||
switch (f) {
|
||||
case op_uplus:
|
||||
@ -586,7 +586,7 @@ eval1(Int fi, Term t) {
|
||||
case op_msb:
|
||||
switch (ETypeOfTerm(t)) {
|
||||
case long_int_e:
|
||||
RINT(msb(IntegerOfTerm(t)));
|
||||
RINT(msb(IntegerOfTerm(t) PASS_REGS));
|
||||
case double_e:
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "msb(%f)", FloatOfTerm(t));
|
||||
case big_int_e:
|
||||
@ -599,7 +599,7 @@ eval1(Int fi, Term t) {
|
||||
case op_lsb:
|
||||
switch (ETypeOfTerm(t)) {
|
||||
case long_int_e:
|
||||
RINT(lsb(IntegerOfTerm(t)));
|
||||
RINT(lsb(IntegerOfTerm(t) PASS_REGS));
|
||||
case double_e:
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "lsb(%f)", FloatOfTerm(t));
|
||||
case big_int_e:
|
||||
@ -612,7 +612,7 @@ eval1(Int fi, Term t) {
|
||||
case op_popcount:
|
||||
switch (ETypeOfTerm(t)) {
|
||||
case long_int_e:
|
||||
RINT(popcount(IntegerOfTerm(t)));
|
||||
RINT(popcount(IntegerOfTerm(t) PASS_REGS));
|
||||
case double_e:
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "popcount(%f)", FloatOfTerm(t));
|
||||
case big_int_e:
|
||||
@ -699,7 +699,8 @@ eval1(Int fi, Term t) {
|
||||
|
||||
Term Yap_eval_unary(Int f, Term t)
|
||||
{
|
||||
return eval1(f,t);
|
||||
CACHE_REGS
|
||||
return eval1(f,t PASS_REGS);
|
||||
}
|
||||
|
||||
static InitUnEntry InitUnTab[] = {
|
||||
@ -758,7 +759,7 @@ p_unary_is( USES_REGS1 )
|
||||
return FALSE;
|
||||
}
|
||||
if (IsIntTerm(t)) {
|
||||
Term tout = Yap_FoundArithError(eval1(IntegerOfTerm(t), top), Deref(ARG3));
|
||||
Term tout = Yap_FoundArithError(eval1(IntegerOfTerm(t), top PASS_REGS), Deref(ARG3));
|
||||
if (!tout)
|
||||
return FALSE;
|
||||
return Yap_unify_constant(ARG1,tout);
|
||||
@ -781,7 +782,7 @@ p_unary_is( USES_REGS1 )
|
||||
P = FAILCODE;
|
||||
return(FALSE);
|
||||
}
|
||||
if (!(out=Yap_FoundArithError(eval1(p->FOfEE, top),Deref(ARG3))))
|
||||
if (!(out=Yap_FoundArithError(eval1(p->FOfEE, top PASS_REGS),Deref(ARG3))))
|
||||
return FALSE;
|
||||
return Yap_unify_constant(ARG1,out);
|
||||
}
|
||||
|
71
C/arith2.c
71
C/arith2.c
@ -37,7 +37,7 @@ typedef struct init_un_eval {
|
||||
|
||||
|
||||
static Term
|
||||
p_mod(Term t1, Term t2) {
|
||||
p_mod(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case (CELL)long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -97,7 +97,7 @@ p_mod(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_div2(Term t1, Term t2) {
|
||||
p_div2(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case (CELL)long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -163,7 +163,7 @@ p_div2(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_rem(Term t1, Term t2) {
|
||||
p_rem(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case (CELL)long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -215,7 +215,7 @@ p_rem(Term t1, Term t2) {
|
||||
|
||||
|
||||
static Term
|
||||
p_rdiv(Term t1, Term t2) {
|
||||
p_rdiv(Term t1, Term t2 USES_REGS) {
|
||||
#ifdef USE_GMP
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case (CELL)double_e:
|
||||
@ -266,7 +266,7 @@ p_rdiv(Term t1, Term t2) {
|
||||
Floating point division: /
|
||||
*/
|
||||
static Term
|
||||
p_fdiv(Term t1, Term t2)
|
||||
p_fdiv(Term t1, Term t2 USES_REGS)
|
||||
{
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
@ -338,7 +338,7 @@ p_fdiv(Term t1, Term t2)
|
||||
xor #
|
||||
*/
|
||||
static Term
|
||||
p_xor(Term t1, Term t2)
|
||||
p_xor(Term t1, Term t2 USES_REGS)
|
||||
{
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
@ -382,7 +382,7 @@ p_xor(Term t1, Term t2)
|
||||
atan2: arc tangent x/y
|
||||
*/
|
||||
static Term
|
||||
p_atan2(Term t1, Term t2)
|
||||
p_atan2(Term t1, Term t2 USES_REGS)
|
||||
{
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
@ -461,7 +461,7 @@ p_atan2(Term t1, Term t2)
|
||||
power: x^y
|
||||
*/
|
||||
static Term
|
||||
p_power(Term t1, Term t2)
|
||||
p_power(Term t1, Term t2 USES_REGS)
|
||||
{
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
@ -577,7 +577,7 @@ ipow(Int x, Int p)
|
||||
power: x^y
|
||||
*/
|
||||
static Term
|
||||
p_exp(Term t1, Term t2)
|
||||
p_exp(Term t1, Term t2 USES_REGS)
|
||||
{
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
@ -669,7 +669,7 @@ p_exp(Term t1, Term t2)
|
||||
}
|
||||
|
||||
static Int
|
||||
gcd(Int m11,Int m21)
|
||||
gcd(Int m11,Int m21 USES_REGS)
|
||||
{
|
||||
/* Blankinship algorithm, provided by Miguel Filgueiras */
|
||||
Int m12=1, m22=0, k;
|
||||
@ -719,7 +719,7 @@ Int gcdmult(Int m11,Int m21,Int *pm11) /* *pm11 gets multiplier of m11 */
|
||||
module gcd
|
||||
*/
|
||||
static Term
|
||||
p_gcd(Term t1, Term t2)
|
||||
p_gcd(Term t1, Term t2 USES_REGS)
|
||||
{
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
@ -731,7 +731,7 @@ p_gcd(Term t1, Term t2)
|
||||
i1 = (i1 >= 0 ? i1 : -i1);
|
||||
i2 = (i2 >= 0 ? i2 : -i2);
|
||||
|
||||
RINT(gcd(i1,i2));
|
||||
RINT(gcd(i1,i2 PASS_REGS));
|
||||
}
|
||||
case double_e:
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
|
||||
@ -957,56 +957,57 @@ p_max(Term t1, Term t2)
|
||||
}
|
||||
|
||||
static Term
|
||||
eval2(Int fi, Term t1, Term t2) {
|
||||
eval2(Int fi, Term t1, Term t2 USES_REGS) {
|
||||
arith2_op f = fi;
|
||||
switch (f) {
|
||||
case op_plus:
|
||||
return p_plus(t1, t2);
|
||||
return p_plus(t1, t2 PASS_REGS);
|
||||
case op_minus:
|
||||
return p_minus(t1, t2);
|
||||
return p_minus(t1, t2 PASS_REGS);
|
||||
case op_times:
|
||||
return p_times(t1, t2);
|
||||
return p_times(t1, t2 PASS_REGS);
|
||||
case op_div:
|
||||
return p_div(t1, t2);
|
||||
return p_div(t1, t2 PASS_REGS);
|
||||
case op_idiv:
|
||||
return p_div2(t1, t2);
|
||||
return p_div2(t1, t2 PASS_REGS);
|
||||
case op_and:
|
||||
return p_and(t1, t2);
|
||||
return p_and(t1, t2 PASS_REGS);
|
||||
case op_or:
|
||||
return p_or(t1, t2);
|
||||
return p_or(t1, t2 PASS_REGS);
|
||||
case op_sll:
|
||||
return p_sll(t1, t2);
|
||||
return p_sll(t1, t2 PASS_REGS);
|
||||
case op_slr:
|
||||
return p_slr(t1, t2);
|
||||
return p_slr(t1, t2 PASS_REGS);
|
||||
case op_mod:
|
||||
return p_mod(t1, t2);
|
||||
return p_mod(t1, t2 PASS_REGS);
|
||||
case op_rem:
|
||||
return p_rem(t1, t2);
|
||||
return p_rem(t1, t2 PASS_REGS);
|
||||
case op_fdiv:
|
||||
return p_fdiv(t1, t2);
|
||||
return p_fdiv(t1, t2 PASS_REGS);
|
||||
case op_xor:
|
||||
return p_xor(t1, t2);
|
||||
return p_xor(t1, t2 PASS_REGS);
|
||||
case op_atan2:
|
||||
return p_atan2(t1, t2);
|
||||
return p_atan2(t1, t2 PASS_REGS);
|
||||
case op_power:
|
||||
return p_exp(t1, t2);
|
||||
return p_exp(t1, t2 PASS_REGS);
|
||||
case op_power2:
|
||||
return p_power(t1, t2);
|
||||
return p_power(t1, t2 PASS_REGS);
|
||||
case op_gcd:
|
||||
return p_gcd(t1, t2);
|
||||
return p_gcd(t1, t2 PASS_REGS);
|
||||
case op_min:
|
||||
return p_min(t1, t2);
|
||||
case op_max:
|
||||
return p_max(t1, t2);
|
||||
case op_rdiv:
|
||||
return p_rdiv(t1, t2);
|
||||
return p_rdiv(t1, t2 PASS_REGS);
|
||||
}
|
||||
RERROR();
|
||||
}
|
||||
|
||||
Term Yap_eval_binary(Int f, Term t1, Term t2)
|
||||
{
|
||||
return eval2(f,t1,t2);
|
||||
CACHE_REGS
|
||||
return eval2(f,t1,t2 PASS_REGS);
|
||||
}
|
||||
|
||||
static InitBinEntry InitBinTab[] = {
|
||||
@ -1058,7 +1059,7 @@ p_binary_is( USES_REGS1 )
|
||||
return FALSE;
|
||||
}
|
||||
if (IsIntTerm(t)) {
|
||||
Term tout = Yap_FoundArithError(eval2(IntOfTerm(t), t1, t2), 0L);
|
||||
Term tout = Yap_FoundArithError(eval2(IntOfTerm(t), t1, t2 PASS_REGS), 0L);
|
||||
if (!tout)
|
||||
return FALSE;
|
||||
return Yap_unify_constant(ARG1,tout);
|
||||
@ -1081,7 +1082,7 @@ p_binary_is( USES_REGS1 )
|
||||
P = FAILCODE;
|
||||
return(FALSE);
|
||||
}
|
||||
if (!(out=Yap_FoundArithError(eval2(p->FOfEE, t1, t2), 0L)))
|
||||
if (!(out=Yap_FoundArithError(eval2(p->FOfEE, t1, t2 PASS_REGS), 0L)))
|
||||
return FALSE;
|
||||
return Yap_unify_constant(ARG1,out);
|
||||
}
|
||||
@ -1105,7 +1106,7 @@ do_arith23(arith2_op op USES_REGS)
|
||||
t2 = Yap_Eval(Deref(ARG2));
|
||||
if (t2 == 0L)
|
||||
return FALSE;
|
||||
if (!(out=Yap_FoundArithError(eval2(op, t1, t2), 0L)))
|
||||
if (!(out=Yap_FoundArithError(eval2(op, t1, t2 PASS_REGS), 0L)))
|
||||
return FALSE;
|
||||
return Yap_unify_constant(ARG3,out);
|
||||
}
|
||||
|
34
C/bignum.c
34
C/bignum.c
@ -320,6 +320,7 @@ Yap_MkULLIntTerm(YAP_ULONG_LONG n)
|
||||
/* try to scan it as a bignum */
|
||||
mpz_init_set_str (new, tmp, 10);
|
||||
if (mpz_fits_slong_p(new)) {
|
||||
CACHE_REGS
|
||||
return MkIntegerTerm(mpz_get_si(new));
|
||||
}
|
||||
t = Yap_MkBigIntTerm(new);
|
||||
@ -346,6 +347,38 @@ p_is_bignum( USES_REGS1 )
|
||||
#endif
|
||||
}
|
||||
|
||||
static Int
|
||||
p_nb_set_bit( USES_REGS1 )
|
||||
{
|
||||
#ifdef USE_GMP
|
||||
Term t = Deref(ARG1);
|
||||
Term ti = Deref(ARG2);
|
||||
Int i;
|
||||
|
||||
if (!(
|
||||
IsNonVarTerm(t) &&
|
||||
IsApplTerm(t) &&
|
||||
FunctorOfTerm(t) == FunctorBigInt &&
|
||||
RepAppl(t)[1] == BIG_INT
|
||||
))
|
||||
return FALSE;
|
||||
if (!IsIntegerTerm(ti)) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!IsIntegerTerm(ti)) {
|
||||
return FALSE;
|
||||
}
|
||||
i = IntegerOfTerm(ti);
|
||||
if (i < 0) {
|
||||
return FALSE;
|
||||
}
|
||||
Yap_gmp_set_bit(i, t);
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
static Int
|
||||
p_has_bignums( USES_REGS1 )
|
||||
{
|
||||
@ -560,4 +593,5 @@ Yap_InitBigNums(void)
|
||||
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag);
|
||||
Yap_InitCPred("rational", 3, p_rational, 0);
|
||||
Yap_InitCPred("rational", 1, p_is_rational, SafePredFlag);
|
||||
Yap_InitCPred("nb_set_bit", 2, p_nb_set_bit, SafePredFlag);
|
||||
}
|
||||
|
@ -738,6 +738,7 @@ YAP_IsCompoundTerm(Term t)
|
||||
X_API Term
|
||||
YAP_MkIntTerm(Int n)
|
||||
{
|
||||
CACHE_REGS
|
||||
Term I;
|
||||
BACKUP_H();
|
||||
|
||||
@ -854,6 +855,7 @@ YAP_BlobOfTerm(Term t)
|
||||
X_API Term
|
||||
YAP_MkFloatTerm(double n)
|
||||
{
|
||||
CACHE_REGS
|
||||
Term t;
|
||||
BACKUP_H();
|
||||
|
||||
|
@ -4910,6 +4910,7 @@ replace_integer(Term orig, UInt new)
|
||||
return MkIntTerm(new);
|
||||
/* should create an old integer */
|
||||
if (!IsApplTerm(orig)) {
|
||||
CACHE_REGS
|
||||
Yap_Error(SYSTEM_ERROR,orig,"%uld-->%uld where it should increase",(unsigned long int)IntegerOfTerm(orig),(unsigned long int)new);
|
||||
return MkIntegerTerm(new);
|
||||
}
|
||||
|
@ -471,6 +471,7 @@ ShowOp (char *f, struct PSEUDO *cpc)
|
||||
case 'b':
|
||||
/* write a variable bitmap for a call */
|
||||
{
|
||||
CACHE_REGS
|
||||
int max = arg/(8*sizeof(CELL)), i;
|
||||
CELL *ptr = cptr;
|
||||
for (i = 0; i <= max; i++) {
|
||||
@ -490,7 +491,10 @@ ShowOp (char *f, struct PSEUDO *cpc)
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
{
|
||||
CACHE_REGS
|
||||
Yap_DebugPlWrite (MkIntegerTerm (arg));
|
||||
}
|
||||
break;
|
||||
case 'z':
|
||||
Yap_DebugPlWrite (MkIntTerm (cpc->rnd3));
|
||||
|
@ -2381,6 +2381,7 @@ GetDBLUKey(PredEntry *ap)
|
||||
{
|
||||
PELOCK(63,ap);
|
||||
if (ap->PredFlags & NumberDBPredFlag) {
|
||||
CACHE_REGS
|
||||
Int id = ap->src.IndxId;
|
||||
UNLOCK(ap->PELock);
|
||||
return MkIntegerTerm(id);
|
||||
@ -2430,6 +2431,7 @@ UnifyDBKey(DBRef DBSP, PropFlags flags, Term t)
|
||||
static int
|
||||
UnifyDBNumber(DBRef DBSP, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
DBProp p = DBSP->Parent;
|
||||
DBRef ref;
|
||||
Int i = 1;
|
||||
|
@ -2121,6 +2121,7 @@ p_nb_beam_close( USES_REGS1 )
|
||||
static void
|
||||
PushBeam(CELL *pt, CELL *npt, UInt hsize, Term key, Term to)
|
||||
{
|
||||
CACHE_REGS
|
||||
UInt off = hsize, off2 = hsize;
|
||||
Term toff, toff2;
|
||||
|
||||
@ -2166,6 +2167,7 @@ PushBeam(CELL *pt, CELL *npt, UInt hsize, Term key, Term to)
|
||||
static void
|
||||
DelBeamMax(CELL *pt, CELL *pt2, UInt sz)
|
||||
{
|
||||
CACHE_REGS
|
||||
UInt off = IntegerOfTerm(pt2[1]);
|
||||
UInt indx = 0;
|
||||
Term tk, ti, tv;
|
||||
@ -2240,6 +2242,7 @@ DelBeamMax(CELL *pt, CELL *pt2, UInt sz)
|
||||
static Term
|
||||
DelBeamMin(CELL *pt, CELL *pt2, UInt sz)
|
||||
{
|
||||
CACHE_REGS
|
||||
UInt off2 = IntegerOfTerm(pt[1]);
|
||||
Term ov = pt2[3*off2+2]; /* return value */
|
||||
UInt indx = 0;
|
||||
|
@ -132,6 +132,14 @@ Yap_gmp_add_int_big(Int i, Term t)
|
||||
}
|
||||
}
|
||||
|
||||
/* add i + b using temporary bigint new */
|
||||
void
|
||||
Yap_gmp_set_bit(Int i, Term t)
|
||||
{
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
mpz_setbit(b, i);
|
||||
}
|
||||
|
||||
/* sub i - b using temporary bigint new */
|
||||
Term
|
||||
Yap_gmp_sub_int_big(Int i, Term t)
|
||||
@ -384,6 +392,7 @@ Yap_gmp_sll_big_int(Term t, Int i)
|
||||
} else {
|
||||
mpz_init(&new);
|
||||
if (i == Int_MIN) {
|
||||
CACHE_REGS
|
||||
return Yap_ArithError(RESOURCE_ERROR_HUGE_INT, MkIntegerTerm(i), "<</2");
|
||||
}
|
||||
mpz_fdiv_q_2exp(&new, b, -i);
|
||||
@ -706,6 +715,7 @@ Yap_gmp_mod_big_int(Term t, Int i2)
|
||||
Term
|
||||
Yap_gmp_mod_int_big(Int i1, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] != BIG_INT) {
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
|
||||
@ -782,6 +792,7 @@ Yap_gmp_rem_big_int(Term t, Int i2)
|
||||
Term
|
||||
Yap_gmp_rem_int_big(Int i1, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] != BIG_INT) {
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
|
||||
@ -815,6 +826,7 @@ Yap_gmp_gcd_big_big(Term t1, Term t2)
|
||||
Term
|
||||
Yap_gmp_gcd_int_big(Int i, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] != BIG_INT) {
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
|
||||
@ -855,6 +867,7 @@ Yap_gmp_to_float(Term t)
|
||||
Term
|
||||
Yap_gmp_add_float_big(Float d, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
@ -868,6 +881,7 @@ Yap_gmp_add_float_big(Float d, Term t)
|
||||
Term
|
||||
Yap_gmp_sub_float_big(Float d, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
@ -881,6 +895,7 @@ Yap_gmp_sub_float_big(Float d, Term t)
|
||||
Term
|
||||
Yap_gmp_sub_big_float(Term t, Float d)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
@ -894,6 +909,7 @@ Yap_gmp_sub_big_float(Term t, Float d)
|
||||
Term
|
||||
Yap_gmp_mul_float_big(Float d, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
@ -907,6 +923,7 @@ Yap_gmp_mul_float_big(Float d, Term t)
|
||||
Term
|
||||
Yap_gmp_fdiv_float_big(Float d, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
@ -920,6 +937,7 @@ Yap_gmp_fdiv_float_big(Float d, Term t)
|
||||
Term
|
||||
Yap_gmp_fdiv_big_float(Term t, Float d)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *b = Yap_BigIntOfTerm(t);
|
||||
@ -943,6 +961,7 @@ Yap_gmp_exp_int_int(Int i1, Int i2)
|
||||
Term
|
||||
Yap_gmp_exp_big_int(Term t, Int i)
|
||||
{
|
||||
CACHE_REGS
|
||||
MP_INT new;
|
||||
|
||||
CELL *pt = RepAppl(t);
|
||||
@ -969,6 +988,7 @@ Yap_gmp_exp_big_int(Term t, Int i)
|
||||
Term
|
||||
Yap_gmp_exp_int_big(Int i, Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
return Yap_ArithError(RESOURCE_ERROR_HUGE_INT, t, "^/2");
|
||||
@ -982,6 +1002,7 @@ Yap_gmp_exp_int_big(Int i, Term t)
|
||||
Term
|
||||
Yap_gmp_exp_big_big(Term t1, Term t2)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt1 = RepAppl(t1);
|
||||
CELL *pt2 = RepAppl(t2);
|
||||
Float dbl1, dbl2;
|
||||
@ -1116,6 +1137,7 @@ Yap_gmq_rdiv_big_big(Term t1, Term t2)
|
||||
Term
|
||||
Yap_gmp_fdiv_int_big(Int i1, Term t2)
|
||||
{
|
||||
CACHE_REGS
|
||||
MP_RAT new;
|
||||
MP_RAT *b1, *b2;
|
||||
MP_RAT bb1, bb2;
|
||||
@ -1142,6 +1164,7 @@ Yap_gmp_fdiv_int_big(Int i1, Term t2)
|
||||
Term
|
||||
Yap_gmp_fdiv_big_int(Term t2, Int i1)
|
||||
{
|
||||
CACHE_REGS
|
||||
MP_RAT new;
|
||||
MP_RAT *b1, *b2;
|
||||
MP_RAT bb1, bb2;
|
||||
@ -1168,6 +1191,7 @@ Yap_gmp_fdiv_big_int(Term t2, Int i1)
|
||||
Term
|
||||
Yap_gmp_fdiv_big_big(Term t1, Term t2)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt1 = RepAppl(t1);
|
||||
CELL *pt2 = RepAppl(t2);
|
||||
MP_RAT new;
|
||||
@ -1602,6 +1626,7 @@ Yap_gmp_float_integer_part(Term t)
|
||||
Term
|
||||
Yap_gmp_sign(Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
return MkIntegerTerm(mpz_sgn(Yap_BigIntOfTerm(t)));
|
||||
@ -1613,6 +1638,7 @@ Yap_gmp_sign(Term t)
|
||||
Term
|
||||
Yap_gmp_lsb(Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *big = Yap_BigIntOfTerm(t);
|
||||
@ -1629,6 +1655,7 @@ Yap_gmp_lsb(Term t)
|
||||
Term
|
||||
Yap_gmp_msb(Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *big = Yap_BigIntOfTerm(t);
|
||||
@ -1645,6 +1672,7 @@ Yap_gmp_msb(Term t)
|
||||
Term
|
||||
Yap_gmp_popcount(Term t)
|
||||
{
|
||||
CACHE_REGS
|
||||
CELL *pt = RepAppl(t);
|
||||
if (pt[1] == BIG_INT) {
|
||||
MP_INT *big = Yap_BigIntOfTerm(t);
|
||||
|
@ -1923,10 +1923,7 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi
|
||||
} else {
|
||||
Yap_IndexSpace_EXT += sz;
|
||||
}
|
||||
{
|
||||
CACHE_REGS
|
||||
Yap_inform_profiler_of_clause(ncode, (CODEADDR)ncode+sz, ap, GPROF_NEW_EXPAND_BLOCK);
|
||||
}
|
||||
/* create an expand_block */
|
||||
ncode->opc = Yap_opcode(_expand_clauses);
|
||||
ncode->u.sssllp.p = ap;
|
||||
|
@ -230,6 +230,7 @@ extern double atof(const char *);
|
||||
static Term
|
||||
float_send(char *s, int sign)
|
||||
{
|
||||
CACHE_REGS
|
||||
Float f = (Float)atof(s);
|
||||
#if HAVE_FINITE
|
||||
if (yap_flags[LANGUAGE_MODE_FLAG] == 1) { /* iso */
|
||||
@ -512,6 +513,7 @@ num_send_error_message(char s[])
|
||||
static Term
|
||||
get_num(int *chp, int *chbuffp, IOSTREAM *inp_stream, char *s, UInt max_size, int sign)
|
||||
{
|
||||
CACHE_REGS
|
||||
char *sp = s;
|
||||
int ch = *chp;
|
||||
Int val = 0L, base = ch - '0';
|
||||
|
@ -74,9 +74,6 @@ p_creep( USES_REGS1 )
|
||||
static Int
|
||||
p_stop_creeping( USES_REGS1 )
|
||||
{
|
||||
Atom at;
|
||||
PredEntry *pred;
|
||||
|
||||
LOCK(LOCAL_SignalLock);
|
||||
LOCAL_ActiveSignals &= ~(YAP_CREEP_SIGNAL|YAP_DELAY_CREEP_SIGNAL);
|
||||
if (!LOCAL_ActiveSignals) {
|
||||
|
14
C/stdpreds.c
14
C/stdpreds.c
@ -292,7 +292,7 @@ STD_PROTO(static Int p_values, ( USES_REGS1 ));
|
||||
STD_PROTO(static CODEADDR *FindAtom, (CODEADDR, int *));
|
||||
#endif /* undefined */
|
||||
STD_PROTO(static Int p_opdec, ( USES_REGS1 ));
|
||||
STD_PROTO(static Term get_num, (char *));
|
||||
STD_PROTO(static Term get_num, (char * USES_REGS));
|
||||
STD_PROTO(static Int p_name, ( USES_REGS1 ));
|
||||
STD_PROTO(static Int p_atom_chars, ( USES_REGS1 ));
|
||||
STD_PROTO(static Int p_atom_codes, ( USES_REGS1 ));
|
||||
@ -537,7 +537,7 @@ strtod(s, pe)
|
||||
#endif
|
||||
|
||||
static Term
|
||||
get_num(char *t)
|
||||
get_num(char *t USES_REGS)
|
||||
{
|
||||
Term out;
|
||||
IOSTREAM *smem = Sopenmem(&t, NULL, "r");
|
||||
@ -832,7 +832,7 @@ p_name( USES_REGS1 )
|
||||
return(FALSE);
|
||||
}
|
||||
if (IsAtomTerm(t) && AtomOfTerm(t) == AtomNil) {
|
||||
if ((NewT = get_num(String)) == TermNil) {
|
||||
if ((NewT = get_num(String PASS_REGS)) == TermNil) {
|
||||
Atom at;
|
||||
while ((at = Yap_LookupAtom(String)) == NIL) {
|
||||
if (!Yap_growheap(FALSE, 0, NULL)) {
|
||||
@ -2227,7 +2227,7 @@ p_number_chars( USES_REGS1 )
|
||||
}
|
||||
}
|
||||
*s++ = '\0';
|
||||
if ((NewT = get_num(String)) == TermNil) {
|
||||
if ((NewT = get_num(String PASS_REGS)) == TermNil) {
|
||||
Yap_Error(SYNTAX_ERROR, gen_syntax_error(Yap_LookupAtom(String), "number_chars"), "while scanning %s", String);
|
||||
return (FALSE);
|
||||
}
|
||||
@ -2294,7 +2294,7 @@ p_number_atom( USES_REGS1 )
|
||||
return(FALSE);
|
||||
}
|
||||
s = RepAtom(AtomOfTerm(t))->StrOfAE;
|
||||
if ((NewT = get_num(s)) == TermNil) {
|
||||
if ((NewT = get_num(s PASS_REGS)) == TermNil) {
|
||||
Yap_Error(SYNTAX_ERROR, gen_syntax_error(Yap_LookupAtom(String), "number_atom"), "while scanning %s", s);
|
||||
return (FALSE);
|
||||
}
|
||||
@ -2387,7 +2387,7 @@ p_number_codes( USES_REGS1 )
|
||||
}
|
||||
}
|
||||
*s++ = '\0';
|
||||
if ((NewT = get_num(String)) == TermNil) {
|
||||
if ((NewT = get_num(String PASS_REGS)) == TermNil) {
|
||||
Yap_Error(SYNTAX_ERROR, gen_syntax_error(Yap_LookupAtom(String), "number_codes"), "while scanning %s", String);
|
||||
return (FALSE);
|
||||
}
|
||||
@ -2452,7 +2452,7 @@ p_atom_number( USES_REGS1 )
|
||||
return FALSE;
|
||||
}
|
||||
s = RepAtom(at)->StrOfAE; /* alloc temp space on Trail */
|
||||
if ((NewT = get_num(s)) == TermNil) {
|
||||
if ((NewT = get_num(s PASS_REGS)) == TermNil) {
|
||||
Yap_Error(SYNTAX_ERROR, gen_syntax_error(at, "atom_number"), "while scanning %s", s);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -4921,7 +4921,7 @@ numbervar_singleton(USES_REGS1)
|
||||
}
|
||||
|
||||
static void
|
||||
renumbervar(Term t, Int id)
|
||||
renumbervar(Term t, Int id USES_REGS)
|
||||
{
|
||||
Term *ts = RepAppl(t);
|
||||
ts[1] = MkIntegerTerm(id);
|
||||
@ -4975,7 +4975,7 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end
|
||||
continue;
|
||||
}
|
||||
if (singles && ap2 >= InitialH && ap2 < H) {
|
||||
renumbervar(d0, numbv++);
|
||||
renumbervar(d0, numbv++ PASS_REGS);
|
||||
continue;
|
||||
}
|
||||
/* store the terms to visit */
|
||||
|
13
H/TermExt.h
13
H/TermExt.h
@ -182,13 +182,13 @@ INLINE_ONLY inline EXTERN Float CpFloatUnaligned(CELL *ptr);
|
||||
|
||||
#if SIZEOF_DOUBLE == SIZEOF_LONG_INT
|
||||
|
||||
#define MkFloatTerm(fl) __MkFloatTerm((fl) PASS_REGS)
|
||||
|
||||
INLINE_ONLY inline EXTERN Term MkFloatTerm (Float);
|
||||
INLINE_ONLY inline EXTERN Term __MkFloatTerm (Float USES_REGS);
|
||||
|
||||
INLINE_ONLY inline EXTERN Term
|
||||
MkFloatTerm (Float dbl)
|
||||
__MkFloatTerm (Float dbl USES_REGS)
|
||||
{
|
||||
CACHE_REGS
|
||||
return (Term) ((H[0] = (CELL) FunctorDouble, *(Float *) (H + 1) =
|
||||
dbl, H[2] = EndSpecials, H +=
|
||||
3, AbsAppl (H - 3)));
|
||||
@ -303,12 +303,13 @@ IsFloatTerm (Term t)
|
||||
|
||||
/* extern Functor FunctorLongInt; */
|
||||
|
||||
INLINE_ONLY inline EXTERN Term MkLongIntTerm (Int);
|
||||
#define MkLongIntTerm(i) __MkLongIntTerm((i) PASS_REGS)
|
||||
|
||||
INLINE_ONLY inline EXTERN Term __MkLongIntTerm (Int USES_REGS);
|
||||
|
||||
INLINE_ONLY inline EXTERN Term
|
||||
MkLongIntTerm (Int i)
|
||||
__MkLongIntTerm (Int i USES_REGS)
|
||||
{
|
||||
CACHE_REGS
|
||||
H[0] = (CELL) FunctorLongInt;
|
||||
H[1] = (CELL) (i);
|
||||
H[2] = EndSpecials;
|
||||
|
@ -364,10 +364,13 @@ MkPairTerm__ (Term head, Term tail USES_REGS)
|
||||
#define IsAccessFunc(func) ((func) == FunctorAccess)
|
||||
|
||||
#ifdef YAP_H
|
||||
INLINE_ONLY inline EXTERN Term MkIntegerTerm (Int);
|
||||
|
||||
#define MkIntegerTerm(i) __MkIntegerTerm(i PASS_REGS)
|
||||
|
||||
INLINE_ONLY inline EXTERN Term __MkIntegerTerm (Int USES_REGS);
|
||||
|
||||
INLINE_ONLY inline EXTERN Term
|
||||
MkIntegerTerm (Int n)
|
||||
__MkIntegerTerm (Int n USES_REGS)
|
||||
{
|
||||
return (Term) (IntInBnd (n) ? MkIntTerm (n) : MkLongIntTerm (n));
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ void STD_PROTO(Yap_InitSavePreds,(void));
|
||||
/* signals.c */
|
||||
void STD_PROTO(Yap_signal,(yap_signals));
|
||||
void STD_PROTO(Yap_undo_signal,(yap_signals));
|
||||
void STD_PROTO(Yap_InitSignalPreds,(void));
|
||||
void STD_PROTO(Yap_InitSignalCPreds,(void));
|
||||
|
||||
/* sort.c */
|
||||
void STD_PROTO(Yap_InitSortPreds,(void));
|
||||
|
34
H/arith2.h
34
H/arith2.h
@ -26,7 +26,7 @@ add_overflow(Int x, Int i, Int j)
|
||||
}
|
||||
|
||||
inline static Term
|
||||
add_int(Int i, Int j)
|
||||
add_int(Int i, Int j USES_REGS)
|
||||
{
|
||||
Int x = i+j;
|
||||
#if USE_GMP
|
||||
@ -51,7 +51,7 @@ sub_overflow(Int x, Int i, Int j)
|
||||
}
|
||||
|
||||
inline static Term
|
||||
sub_int(Int i, Int j)
|
||||
sub_int(Int i, Int j USES_REGS)
|
||||
{
|
||||
Int x = i-j;
|
||||
#if USE_GMP
|
||||
@ -105,7 +105,7 @@ mul_overflow(Int z, Int i1, Int i2)
|
||||
#endif
|
||||
|
||||
inline static Term
|
||||
times_int(Int i1, Int i2) {
|
||||
times_int(Int i1, Int i2 USES_REGS) {
|
||||
#ifdef USE_GMP
|
||||
Int z;
|
||||
DO_MULTI();
|
||||
@ -151,7 +151,7 @@ clrsb(Int i)
|
||||
#endif
|
||||
|
||||
inline static Term
|
||||
do_sll(Int i, Int j) /* j > 0 */
|
||||
do_sll(Int i, Int j USES_REGS) /* j > 0 */
|
||||
{
|
||||
#ifdef USE_GMP
|
||||
if (
|
||||
@ -174,13 +174,13 @@ do_sll(Int i, Int j) /* j > 0 */
|
||||
|
||||
|
||||
static inline Term
|
||||
p_plus(Term t1, Term t2) {
|
||||
p_plus(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
case long_int_e:
|
||||
/* two integers */
|
||||
return add_int(IntegerOfTerm(t1),IntegerOfTerm(t2));
|
||||
return add_int(IntegerOfTerm(t1),IntegerOfTerm(t2) PASS_REGS);
|
||||
case double_e:
|
||||
{
|
||||
/* integer, double */
|
||||
@ -230,13 +230,13 @@ p_plus(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_minus(Term t1, Term t2) {
|
||||
p_minus(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
case long_int_e:
|
||||
/* two integers */
|
||||
return sub_int(IntegerOfTerm(t1), IntegerOfTerm(t2));
|
||||
return sub_int(IntegerOfTerm(t1), IntegerOfTerm(t2) PASS_REGS);
|
||||
case double_e:
|
||||
{
|
||||
/* integer, double */
|
||||
@ -290,13 +290,13 @@ p_minus(Term t1, Term t2) {
|
||||
|
||||
|
||||
static Term
|
||||
p_times(Term t1, Term t2) {
|
||||
p_times(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
case long_int_e:
|
||||
/* two integers */
|
||||
return(times_int(IntegerOfTerm(t1),IntegerOfTerm(t2)));
|
||||
return(times_int(IntegerOfTerm(t1),IntegerOfTerm(t2) PASS_REGS));
|
||||
case double_e:
|
||||
{
|
||||
/* integer, double */
|
||||
@ -348,7 +348,7 @@ p_times(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_div(Term t1, Term t2) {
|
||||
p_div(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -405,7 +405,7 @@ p_div(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_and(Term t1, Term t2) {
|
||||
p_and(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -446,7 +446,7 @@ p_and(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_or(Term t1, Term t2) {
|
||||
p_or(Term t1, Term t2 USES_REGS) {
|
||||
switch(ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -487,7 +487,7 @@ p_or(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_sll(Term t1, Term t2) {
|
||||
p_sll(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -501,7 +501,7 @@ p_sll(Term t1, Term t2) {
|
||||
}
|
||||
RINT(SLR(IntegerOfTerm(t1), -i2));
|
||||
}
|
||||
return do_sll(IntegerOfTerm(t1),i2);
|
||||
return do_sll(IntegerOfTerm(t1),i2 PASS_REGS);
|
||||
}
|
||||
case double_e:
|
||||
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "<</2");
|
||||
@ -535,7 +535,7 @@ p_sll(Term t1, Term t2) {
|
||||
}
|
||||
|
||||
static Term
|
||||
p_slr(Term t1, Term t2) {
|
||||
p_slr(Term t1, Term t2 USES_REGS) {
|
||||
switch (ETypeOfTerm(t1)) {
|
||||
case long_int_e:
|
||||
switch (ETypeOfTerm(t2)) {
|
||||
@ -547,7 +547,7 @@ p_slr(Term t1, Term t2) {
|
||||
if (i2 == Int_MIN) {
|
||||
return Yap_ArithError(RESOURCE_ERROR_HUGE_INT, t2, ">>/2");
|
||||
}
|
||||
return do_sll(IntegerOfTerm(t1), -i2);
|
||||
return do_sll(IntegerOfTerm(t1), -i2 PASS_REGS);
|
||||
}
|
||||
RINT(SLR(IntegerOfTerm(t1), i2));
|
||||
}
|
||||
|
@ -341,8 +341,10 @@ same_lu_block(yamop **paddr, yamop *p)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define Yap_MkStaticRefTerm(cp) __Yap_MkStaticRefTerm((cp) PASS_REGS)
|
||||
|
||||
static inline Term
|
||||
Yap_MkStaticRefTerm(StaticClause *cp)
|
||||
__Yap_MkStaticRefTerm(StaticClause *cp USES_REGS)
|
||||
{
|
||||
Term t[1];
|
||||
t[0] = MkIntegerTerm((Int)cp);
|
||||
@ -355,8 +357,10 @@ Yap_ClauseFromTerm(Term t)
|
||||
return (StaticClause *)IntegerOfTerm(ArgOfTerm(1,t));
|
||||
}
|
||||
|
||||
#define Yap_MkMegaRefTerm(ap, ipc) __Yap_MkMegaRefTerm((ap), (ipc) PASS_REGS)
|
||||
|
||||
static inline Term
|
||||
Yap_MkMegaRefTerm(PredEntry *ap,yamop *ipc)
|
||||
__Yap_MkMegaRefTerm(PredEntry *ap,yamop *ipc USES_REGS)
|
||||
{
|
||||
Term t[2];
|
||||
t[0] = MkIntegerTerm((Int)ap);
|
||||
|
8
H/eval.h
8
H/eval.h
@ -314,12 +314,16 @@ size_t STD_PROTO(Yap_gmp_to_size,(Term, int));
|
||||
|
||||
int STD_PROTO(Yap_term_to_existing_big,(Term, MP_INT *));
|
||||
int STD_PROTO(Yap_term_to_existing_rat,(Term, MP_RAT *));
|
||||
|
||||
void Yap_gmp_set_bit(Int i, Term t);
|
||||
#endif
|
||||
|
||||
INLINE_ONLY inline EXTERN Term Yap_Mk64IntegerTerm(YAP_LONG_LONG);
|
||||
#define Yap_Mk64IntegerTerm(i) __Yap_Mk64IntegerTerm((i) PASS_REGS)
|
||||
|
||||
INLINE_ONLY inline EXTERN Term __Yap_Mk64IntegerTerm(YAP_LONG_LONG USES_REGS);
|
||||
|
||||
INLINE_ONLY inline EXTERN Term
|
||||
Yap_Mk64IntegerTerm(YAP_LONG_LONG i)
|
||||
__Yap_Mk64IntegerTerm(YAP_LONG_LONG i USES_REGS)
|
||||
{
|
||||
if (i <= Int_MAX && i >= Int_MIN) {
|
||||
return MkIntegerTerm((Int)i);
|
||||
|
@ -10,6 +10,7 @@ INIT_SEQ_STRING(size_t n)
|
||||
|
||||
static inline Word
|
||||
EXTEND_SEQ_CODES(Word ptr, int c) {
|
||||
CACHE_REGS
|
||||
ptr[0] = MkIntegerTerm(c);
|
||||
ptr[1] = AbsPair(ptr+2);
|
||||
|
||||
|
Reference in New Issue
Block a user