more icc fixes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2166 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
0c0826b938
commit
5a88dc6333
57
C/absmi.c
57
C/absmi.c
@ -10,8 +10,11 @@
|
||||
* *
|
||||
* File: absmi.c *
|
||||
* comments: Portable abstract machine interpreter *
|
||||
* Last rev: $Date: 2008-03-25 16:45:52 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2008-03-26 14:37:07 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.236 2008/03/25 16:45:52 vsc
|
||||
* make or-parallelism compile again
|
||||
*
|
||||
* Revision 1.235 2008/02/12 17:03:50 vsc
|
||||
* SWI-portability changes
|
||||
*
|
||||
@ -592,23 +595,23 @@ Yap_absmi(int inp)
|
||||
|
||||
#endif /* LONG_LIVED_REGISTERS */
|
||||
|
||||
#if SHADOW_P
|
||||
#ifdef SHADOW_P
|
||||
register yamop *PREG = P;
|
||||
#endif /* SHADOW_P */
|
||||
|
||||
#if SHADOW_CP
|
||||
#ifdef SHADOW_CP
|
||||
register yamop *CPREG = CP;
|
||||
#endif /* SHADOW_CP */
|
||||
|
||||
#if SHADOW_HB
|
||||
#ifdef SHADOW_HB
|
||||
register CELL *HBREG = HB;
|
||||
#endif /* SHADOW_HB */
|
||||
|
||||
#if SHADOW_Y
|
||||
#ifdef SHADOW_Y
|
||||
register CELL *YREG = Yap_REGS.YENV_;
|
||||
#endif /* SHADOW_Y */
|
||||
|
||||
#if SHADOW_S
|
||||
#ifdef SHADOW_S
|
||||
register CELL *SREG = Yap_REGS.S_;
|
||||
#else
|
||||
#define SREG S
|
||||
@ -633,7 +636,7 @@ Yap_absmi(int inp)
|
||||
|
||||
#endif /* USE_THREADED_CODE */
|
||||
|
||||
#if SHADOW_REGS
|
||||
#ifdef SHADOW_REGS
|
||||
|
||||
/* work with a local pointer to the registers */
|
||||
register REGSTORE *regp = &Yap_REGS;
|
||||
@ -697,7 +700,7 @@ Yap_absmi(int inp)
|
||||
|
||||
#endif /* PUSH_REGS */
|
||||
|
||||
#if SHADOW_REGS
|
||||
#ifdef SHADOW_REGS
|
||||
|
||||
/* use regp as a copy of REGS */
|
||||
regp = &Yap_REGS;
|
||||
@ -784,7 +787,7 @@ Yap_absmi(int inp)
|
||||
{
|
||||
CELL cut_b;
|
||||
|
||||
#if SHADOW_S
|
||||
#ifdef SHADOW_S
|
||||
S = SREG;
|
||||
#endif
|
||||
/* YREG was pointing to where we were going to build the
|
||||
@ -3113,7 +3116,7 @@ Yap_absmi(int inp)
|
||||
/* and now CREEP */
|
||||
|
||||
creep:
|
||||
#if _MSC_VER || defined(__MINGW32__)
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
/* I need this for Windows and other systems where SIGINT
|
||||
is not proceesed by same thread as absmi */
|
||||
LOCK(SignalLock);
|
||||
@ -3134,7 +3137,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
UNLOCK(SignalLock);
|
||||
#endif
|
||||
#if SHADOW_S
|
||||
#ifdef SHADOW_S
|
||||
S = SREG;
|
||||
#endif
|
||||
BEGD(d0);
|
||||
@ -4955,7 +4958,7 @@ Yap_absmi(int inp)
|
||||
READ_IN_S();
|
||||
BEGD(d0);
|
||||
d0 = *S_SREG;
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0)
|
||||
d0 = (CELL)S_SREG;
|
||||
#endif
|
||||
@ -4990,7 +4993,7 @@ Yap_absmi(int inp)
|
||||
d0 = SREG[0];
|
||||
pt0 = &XREG(PREG->u.ox.x);
|
||||
PREG = NEXTOP(PREG, ox);
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0)
|
||||
d0 = (CELL)SREG;
|
||||
#endif
|
||||
@ -5026,7 +5029,7 @@ Yap_absmi(int inp)
|
||||
d0 = S_SREG[0];
|
||||
BEGD(d1);
|
||||
d1 = S_SREG[1];
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0)
|
||||
d0 = (CELL)S_SREG;
|
||||
if (d1 == 0)
|
||||
@ -5071,14 +5074,14 @@ Yap_absmi(int inp)
|
||||
d0 = S_SREG[0];
|
||||
BEGD(d1);
|
||||
d1 = S_SREG[1];
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0)
|
||||
XREG(PREG->u.oxx.xl) = (CELL)S_SREG;
|
||||
else
|
||||
#endif
|
||||
XREG(PREG->u.oxx.xl) = d0;
|
||||
PREG = NEXTOP(PREG, oxx);
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d1 == 0)
|
||||
*pt0 = (CELL)(S_SREG+1);
|
||||
else
|
||||
@ -5359,7 +5362,7 @@ Yap_absmi(int inp)
|
||||
/* we are in write mode */
|
||||
BEGD(d0);
|
||||
d0 = YREG[PREG->u.oy.y];
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0) /* free variable */
|
||||
*SREG++ = (CELL)(YREG+PREG->u.oy.y);
|
||||
else
|
||||
@ -5455,7 +5458,7 @@ Yap_absmi(int inp)
|
||||
/* we are in write mode */
|
||||
BEGD(d0);
|
||||
d0 = YREG[PREG->u.oy.y];
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0) /* new variable */
|
||||
SREG[0] = (CELL)(YREG+PREG->u.oy.y);
|
||||
else
|
||||
@ -6864,7 +6867,7 @@ Yap_absmi(int inp)
|
||||
Op(put_y_val, yx);
|
||||
BEGD(d0);
|
||||
d0 = YREG[PREG->u.yx.y];
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0) /* new variable */
|
||||
XREG(PREG->u.yx.x) = (CELL)(YREG+PREG->u.yx.y);
|
||||
else
|
||||
@ -7052,7 +7055,7 @@ Yap_absmi(int inp)
|
||||
Op(write_y_val, y);
|
||||
BEGD(d0);
|
||||
d0 = YREG[PREG->u.y.y];
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
if (d0 == 0) /* new variable */
|
||||
*SREG++ = (CELL)(YREG+PREG->u.y.y);
|
||||
else
|
||||
@ -7500,7 +7503,7 @@ Yap_absmi(int inp)
|
||||
saveregs();
|
||||
d0 = (f)();
|
||||
setregs();
|
||||
#if SHADOW_S
|
||||
#ifdef SHADOW_S
|
||||
SREG = Yap_REGS.S_;
|
||||
#endif
|
||||
if (!d0) {
|
||||
@ -13379,7 +13382,7 @@ Yap_absmi(int inp)
|
||||
pt1 = RepAppl(d0);
|
||||
BEGD(d2);
|
||||
for (d2 = ArityOfFunctor(f); d2; d2--) {
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
BEGD(d1);
|
||||
d1 = pt1[d2];
|
||||
if (d1 == 0) {
|
||||
@ -13532,7 +13535,7 @@ Yap_absmi(int inp)
|
||||
ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),mod));
|
||||
ENV_YREG[-EnvSizeInCells-3] = mod;
|
||||
} else if (IsApplTerm(d1)) {
|
||||
Functor f = FunctorOfTerm(d1);
|
||||
f = FunctorOfTerm(d1);
|
||||
if (IsExtensionFunctor(f)) {
|
||||
goto execute_metacall;
|
||||
} else {
|
||||
@ -13575,7 +13578,7 @@ Yap_absmi(int inp)
|
||||
pt1 = RepAppl(d0);
|
||||
BEGD(d2);
|
||||
for (d2 = ArityOfFunctor(f); d2; d2--) {
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
BEGD(d1);
|
||||
d1 = pt1[d2];
|
||||
if (d1 == 0) {
|
||||
@ -13840,7 +13843,7 @@ Yap_absmi(int inp)
|
||||
pt1 = RepAppl(d0);
|
||||
BEGD(d2);
|
||||
for (d2 = arity; d2; d2--) {
|
||||
#if SBA
|
||||
#ifdef SBA
|
||||
BEGD(d1);
|
||||
d1 = pt1[d2];
|
||||
if (d1 == 0)
|
||||
@ -13940,7 +13943,7 @@ Yap_absmi(int inp)
|
||||
}
|
||||
}
|
||||
if (ActiveSignals & YAP_TROVF_SIGNAL) {
|
||||
#if SHADOW_S
|
||||
#ifdef SHADOW_S
|
||||
S = SREG;
|
||||
#endif
|
||||
saveregs_and_ycache();
|
||||
@ -13997,8 +14000,6 @@ Yap_absmi(int inp)
|
||||
|
||||
}
|
||||
|
||||
int STD_PROTO(Yap_absmiEND,(void));
|
||||
|
||||
/* dummy function that is needed for profiler */
|
||||
int Yap_absmiEND(void)
|
||||
{
|
||||
|
@ -11,8 +11,11 @@
|
||||
* File: gprof.c *
|
||||
* comments: Interrupt Driven Profiler *
|
||||
* *
|
||||
* Last rev: $Date: 2007-10-08 23:02:15 $,$Author: vsc $ *
|
||||
* Last rev: $Date: 2008-03-26 14:37:07 $,$Author: vsc $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.9 2007/10/08 23:02:15 vsc
|
||||
* minor fixes
|
||||
*
|
||||
* Revision 1.8 2007/04/10 22:13:20 vsc
|
||||
* fix max modules limitation
|
||||
*
|
||||
@ -905,8 +908,6 @@ showprofres(UInt type) {
|
||||
|
||||
#define TestMode (GCMode | GrowHeapMode | GrowStackMode | ErrorHandlingMode | InErrorMode | AbortMode | MallocMode)
|
||||
|
||||
extern int Yap_absmiEND(void);
|
||||
|
||||
static void
|
||||
prof_alrm(int signo, siginfo_t *si, void *scv)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@
|
||||
* File: Yap.proto *
|
||||
* mods: *
|
||||
* comments: Function declarations for YAP *
|
||||
* version: $Id: Yapproto.h,v 1.83 2008-03-25 22:03:13 vsc Exp $ *
|
||||
* version: $Id: Yapproto.h,v 1.84 2008-03-26 14:37:08 vsc Exp $ *
|
||||
*************************************************************************/
|
||||
|
||||
/* prototype file for Yap */
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
/* absmi.c */
|
||||
Int STD_PROTO(Yap_absmi,(int));
|
||||
int STD_PROTO(Yap_absmiEND,(void));
|
||||
|
||||
/* adtdefs.c */
|
||||
Term STD_PROTO(Yap_ArrayToList,(Term *,int));
|
||||
|
22
H/absmi.h
22
H/absmi.h
@ -1039,27 +1039,27 @@ Macros to check the limits of stacks
|
||||
#define UnifyBound(d0,d1) \
|
||||
if (d0 == d1) GONext(); \
|
||||
if (IsPairTerm(d0)) { \
|
||||
register CELL *pt0, *pt1; \
|
||||
register CELL *ipt0, *ipt1; \
|
||||
if (!IsPairTerm(d1)) { FAIL(); } \
|
||||
pt0 = RepPair(d0); \
|
||||
pt1 = RepPair(d1); \
|
||||
ipt0 = RepPair(d0); \
|
||||
ipt1 = RepPair(d1); \
|
||||
save_hb(); \
|
||||
always_save_pc(); \
|
||||
if (IUnify_complex(pt0-1,pt0+1,pt1-1)) {always_set_pc(); GONext();}\
|
||||
if (IUnify_complex(ipt0-1,ipt0+1,ipt1-1)) {always_set_pc(); GONext();}\
|
||||
else { FAIL(); } \
|
||||
} else if (IsApplTerm(d0)) { \
|
||||
register CELL *pt0, *pt1; \
|
||||
register CELL *ipt0, *ipt1; \
|
||||
register Functor f; \
|
||||
if (!IsApplTerm(d1)) { FAIL(); } \
|
||||
pt0 = RepAppl(d0); \
|
||||
pt1 = RepAppl(d1); \
|
||||
f = (Functor)*pt0; \
|
||||
if (f != (Functor)*pt1) { FAIL(); } \
|
||||
UnifyBound_TEST_ATTACHED(f,d0,pt0,d1); \
|
||||
ipt0 = RepAppl(d0); \
|
||||
ipt1 = RepAppl(d1); \
|
||||
f = (Functor)*ipt0; \
|
||||
if (f != (Functor)*ipt1) { FAIL(); } \
|
||||
UnifyBound_TEST_ATTACHED(f,d0,ipt0,d1); \
|
||||
d0 = ArityOfFunctor(f); \
|
||||
always_save_pc(); \
|
||||
save_hb(); \
|
||||
if (IUnify_complex(pt0, pt0+d0, pt1)) {always_set_pc(); GONext();} \
|
||||
if (IUnify_complex(ipt0, ipt0+d0, ipt1)) {always_set_pc(); GONext();} \
|
||||
else { FAIL(); } \
|
||||
} \
|
||||
else { FAIL(); }
|
||||
|
@ -81,8 +81,8 @@
|
||||
extern char *Yap_bp;
|
||||
#endif
|
||||
|
||||
#define MARK_BIT 1
|
||||
#define RMARK_BIT 2
|
||||
#define MARK_BIT ((char)1)
|
||||
#define RMARK_BIT ((char)2)
|
||||
|
||||
#define mcell(X) Yap_bp[(X)-(CELL *)Yap_GlobalBase]
|
||||
|
||||
|
Reference in New Issue
Block a user