UM #303: integer handling

This commit is contained in:
Vítor Santos Costa 2015-02-09 10:15:11 +00:00
parent 88e3d637ec
commit 8dcdb6ce09
2 changed files with 69 additions and 62 deletions

View File

@ -126,9 +126,10 @@ p_integer( USES_REGS1 )
switch ((CELL)f0) { switch ((CELL)f0) {
case (CELL)FunctorBigInt: case (CELL)FunctorBigInt:
{ CELL *pt = RepAppl(d0); { CELL *pt = RepAppl(d0);
if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { if ( pt[1] != BIG_INT ) {
return FALSE; return FALSE;
} }
return TRUE;
} }
case (CELL)FunctorLongInt: case (CELL)FunctorLongInt:
return(TRUE); return(TRUE);
@ -174,7 +175,8 @@ p_number( USES_REGS1 )
if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) {
return FALSE; return FALSE;
} }
} return(TRUE);
}
case (CELL)FunctorLongInt: case (CELL)FunctorLongInt:
case (CELL)FunctorDouble: case (CELL)FunctorDouble:
return(TRUE); return(TRUE);

View File

@ -114,11 +114,13 @@
switch ((CELL)f0) { switch ((CELL)f0) {
case (CELL)FunctorBigInt: case (CELL)FunctorBigInt:
{ CELL *pt = RepAppl(d0); { CELL *pt = RepAppl(d0);
if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { if ( pt[1] != BIG_INT ) {
PREG = PREG->y_u.xl.F; PREG = PREG->y_u.xl.F;
GONext(); GONext();
} }
} }
PREG = NEXTOP(PREG, xl);
GONext();
break; break;
case (CELL)FunctorLongInt: case (CELL)FunctorLongInt:
PREG = NEXTOP(PREG, xl); PREG = NEXTOP(PREG, xl);
@ -159,14 +161,18 @@
switch ((CELL)f0) { switch ((CELL)f0) {
case (CELL)FunctorBigInt: case (CELL)FunctorBigInt:
{ CELL *pt = RepAppl(d0); { CELL *pt = RepAppl(d0);
if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) { if ( pt[1] != BIG_INT ) {
PREG = PREG->y_u.yl.F; PREG = PREG->y_u.yl.F;
GONext(); GONext();
} }
} }
PREG = NEXTOP(PREG, yl);
GONext();
break;
case (CELL)FunctorLongInt: case (CELL)FunctorLongInt:
PREG = NEXTOP(PREG, yl); PREG = NEXTOP(PREG, yl);
GONext(); GONext();
break;
default: default:
PREG = PREG->y_u.yl.F; PREG = PREG->y_u.yl.F;
GONext(); GONext();
@ -543,4 +549,3 @@
ENDP(pt0); ENDP(pt0);
ENDD(d0); ENDD(d0);
ENDOp(); ENDOp();