bignum support fixes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1531 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
@@ -10,8 +10,11 @@
|
||||
* *
|
||||
* File: absmi.c *
|
||||
* comments: Portable abstract machine interpreter *
|
||||
* Last rev: $Date: 2006-01-26 19:13:24 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2006-02-01 13:28:56 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.194 2006/01/26 19:13:24 vsc
|
||||
* avoid compilation issues with lack of gmp (Remko Troncon)
|
||||
*
|
||||
* Revision 1.193 2006/01/18 15:34:53 vsc
|
||||
* avoid sideffects from MkBigInt
|
||||
*
|
||||
@@ -9835,9 +9838,7 @@ Yap_absmi(int inp)
|
||||
{
|
||||
Int d1 = PREG->u.xxc.c;
|
||||
if (IsIntTerm(d0)) {
|
||||
fprintf(stderr,"%d<<%d\n",IntOfTerm(d0), d1);
|
||||
d0 = do_sll(IntOfTerm(d0), (Int)d1);
|
||||
fprintf(stderr,"%d\n",IntegerOfTerm(d0));
|
||||
}
|
||||
else {
|
||||
saveregs();
|
||||
|
@@ -38,8 +38,8 @@ Yap_MkBigIntTerm(MP_INT *big)
|
||||
CELL *ret = H;
|
||||
|
||||
if (mpz_fits_slong_p(big)) {
|
||||
int out = mpz_get_si(big);
|
||||
return MkIntegerTerm(out);
|
||||
long int out = mpz_get_si(big);
|
||||
return MkIntegerTerm((Int)out);
|
||||
}
|
||||
nlimbs = (big->_mp_alloc)*(sizeof(mp_limb_t)/CellSize);
|
||||
if (nlimbs > (ASP-ret)-1024) {
|
||||
|
@@ -11,8 +11,11 @@
|
||||
* File: cdmgr.c *
|
||||
* comments: Code manager *
|
||||
* *
|
||||
* Last rev: $Date: 2006-01-08 03:12:00 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2006-02-01 13:28:56 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.175 2006/01/08 03:12:00 vsc
|
||||
* fix small bug in attvar handling.
|
||||
*
|
||||
* Revision 1.174 2005/12/23 00:20:13 vsc
|
||||
* updates to gprof
|
||||
* support for __POWER__
|
||||
@@ -5283,7 +5286,7 @@ p_predicate_erased_statistics(void)
|
||||
Yap_unify(ARG5,MkIntegerTerm(isz));
|
||||
}
|
||||
|
||||
static int
|
||||
static Int
|
||||
p_program_continuation(void)
|
||||
{
|
||||
PredEntry *pe = EnvPreg(((CELL *)ENV[E_E])[E_CP]);
|
||||
|
3
C/exec.c
3
C/exec.c
@@ -263,7 +263,8 @@ do_execute_n(Term t, Term mod, unsigned int n)
|
||||
Atom Name;
|
||||
register CELL *pt;
|
||||
PredEntry *pen;
|
||||
unsigned int i, arity, j = -n;
|
||||
unsigned int i, arity;
|
||||
int j = -n;
|
||||
|
||||
restart_exec:
|
||||
if (IsVarTerm(t)) {
|
||||
|
@@ -11,8 +11,13 @@
|
||||
* File: gprof.c *
|
||||
* comments: Interrupt Driven Profiler *
|
||||
* *
|
||||
* Last rev: $Date: 2006-01-17 14:10:40 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2006-02-01 13:28:56 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.3 2006/01/17 14:10:40 vsc
|
||||
* YENV may be an HW register (breaks some tabling code)
|
||||
* All YAAM instructions are now brackedted, so Op introduced an { and EndOp introduces an }. This is because Ricardo assumes that.
|
||||
* Fix attvars when COROUTING is undefined.
|
||||
*
|
||||
* Revision 1.2 2005/12/23 00:20:13 vsc
|
||||
* updates to gprof
|
||||
* support for __POWER__
|
||||
@@ -905,7 +910,7 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
|
||||
ProfCalls++;
|
||||
if (Yap_PrologMode & TestMode) {
|
||||
if (Yap_OffLineProfiler) {
|
||||
fprintf(FProf,"%p %p\n", (void *) (Yap_PrologMode & TestMode), P);
|
||||
fprintf(FProf,"%p %p\n", (void *) ((CELL)Yap_PrologMode & TestMode), P);
|
||||
ProfOn = FALSE;
|
||||
return;
|
||||
}
|
||||
|
@@ -4142,7 +4142,7 @@ format(volatile Term otail, volatile Term oargs, int sno)
|
||||
if (IsIntegerTerm(t)) {
|
||||
Int il = IntegerOfTerm(t);
|
||||
#if HAVE_SNPRINTF
|
||||
snprintf(tmp1, 256, "%d", il);
|
||||
snprintf(tmp1, 256, "%ld", il);
|
||||
#else
|
||||
sprintf(tmp1, "%ld", (long int)il);
|
||||
#endif
|
||||
|
@@ -1812,7 +1812,7 @@ static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
|
||||
pt0_end = to_visit[1];
|
||||
pt1 = to_visit[2];
|
||||
*pt0 = (CELL)to_visit[3];
|
||||
write_mode = (int)to_visit[4];
|
||||
write_mode = (Int)to_visit[ 4];
|
||||
to_visit += 5;
|
||||
#else
|
||||
pt0 = to_visit[0];
|
||||
|
Reference in New Issue
Block a user