Use SET64 representation in the compiler.

This commit is contained in:
David Brown 2016-09-30 19:00:33 +01:00
parent 2e02f9204c
commit 7238be5257
38 changed files with 119 additions and 126 deletions

View file

@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
if (k < 0 || k > (int64)OPM_MaxSet) {
OPB_err(202);
} else if (y->class == 7) {
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32));
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64));
(*x)->obj = NIL;
} else {
OPB_BindNodes(12, OPT_booltyp, &*x, y);
@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev)
scope = OPT_topScope;
while (dlev > 0) {
dlev -= 1;
scope->link->conval->setval |= __SETOF(3,32);
scope->link->conval->setval |= __SETOF(3,64);
scope = scope->left;
}
}

View file

@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void);
export void OPM_FPrint (int32 *fp, int64 val);
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
export void OPM_FPrintReal (int32 *fp, REAL real);
export void OPM_FPrintSet (int32 *fp, uint32 set);
export void OPM_FPrintSet (int32 *fp, uint64 set);
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
export void OPM_Get (CHAR *ch);
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void);
export int64 OPM_SymRInt64 (void);
export void OPM_SymRLReal (LONGREAL *lr);
export void OPM_SymRReal (REAL *r);
export void OPM_SymRSet (uint32 *s);
export void OPM_SymRSet (uint64 *s);
export void OPM_SymWCh (CHAR ch);
export void OPM_SymWInt (int64 i);
export void OPM_SymWLReal (LONGREAL lr);
export void OPM_SymWReal (REAL r);
export void OPM_SymWSet (uint32 s);
export void OPM_SymWSet (uint64 s);
static void OPM_VerboseListSizes (void);
export void OPM_Write (CHAR ch);
export void OPM_WriteHex (int64 i);
@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val)
*fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32);
}
void OPM_FPrintSet (int32 *fp, uint32 set)
void OPM_FPrintSet (int32 *fp, uint64 set)
{
OPM_FPrint(&*fp, (int32)set);
OPM_FPrint(&*fp, __VAL(int32, set));
}
void OPM_FPrintReal (int32 *fp, REAL real)
@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void)
return _o_result;
}
void OPM_SymRSet (uint32 *s)
void OPM_SymRSet (uint64 *s)
{
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4);
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8);
}
void OPM_SymRReal (REAL *r)
@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i)
Files_WriteNum(&OPM_newSF, Files_Rider__typ, i);
}
void OPM_SymWSet (uint32 s)
void OPM_SymWSet (uint64 s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s);
}
void OPM_SymWReal (REAL r)

View file

@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void);
import void OPM_FPrint (int32 *fp, int64 val);
import void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
import void OPM_FPrintReal (int32 *fp, REAL real);
import void OPM_FPrintSet (int32 *fp, uint32 set);
import void OPM_FPrintSet (int32 *fp, uint64 set);
import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
import void OPM_InitOptions (void);
@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void);
import int64 OPM_SymRInt64 (void);
import void OPM_SymRLReal (LONGREAL *lr);
import void OPM_SymRReal (REAL *r);
import void OPM_SymRSet (uint32 *s);
import void OPM_SymRSet (uint64 *s);
import void OPM_SymWCh (CHAR ch);
import void OPM_SymWInt (int64 i);
import void OPM_SymWLReal (LONGREAL lr);
import void OPM_SymWReal (REAL r);
import void OPM_SymWSet (uint32 s);
import void OPM_SymWSet (uint64 s);
import void OPM_Write (CHAR ch);
import void OPM_WriteHex (int64 i);
import void OPM_WriteInt (int64 i);

View file

@ -967,7 +967,7 @@ static void GetCode__19 (void)
}
}
}
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32);
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64);
}
static void GetParams__21 (void)
@ -999,7 +999,7 @@ static void Body__17 (void)
OPT_Node procdec = NIL, statseq = NIL;
int32 c;
c = OPM_errpos;
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32);
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64);
OPP_CheckSym(39);
OPP_Block(&procdec, &statseq);
OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc);
@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void)
if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) {
*ProcedureDeclaration__16_s->fwd = NIL;
}
if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) {
if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) {
*ProcedureDeclaration__16_s->proc = OPT_NewObj();
(*ProcedureDeclaration__16_s->proc)->leaf = 1;
if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) {
@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void)
if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) {
OPP_err(109);
}
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32);
(*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64);
}
if (!*ProcedureDeclaration__16_s->forward) {
Body__17();
@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) {
fwd = NIL;
}
if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) {
if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) {
proc = OPT_NewObj();
proc->leaf = 1;
if (fwd->vis != vis) {

View file

@ -20,7 +20,7 @@ typedef
OPT_ConstExt ext;
int64 intval;
int32 intval2;
uint32 setval;
uint64 setval;
LONGREAL realval;
} OPT_ConstDesc;
@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*))
__ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P);
}
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}};
__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}};
__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}};
__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}};
__TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}};

View file

@ -17,7 +17,7 @@ typedef
OPT_ConstExt ext;
int64 intval;
int32 intval2;
uint32 setval;
uint64 setval;
LONGREAL realval;
} OPT_ConstDesc;

View file

@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj)
OPT_FindField(obj->name, typ->BaseTyp, &redef);
if (redef != NIL) {
obj->adr = __ASHL(__ASHR(redef->adr, 16), 16);
if (!__IN(2, obj->conval->setval, 32)) {
if (!__IN(2, obj->conval->setval, 64)) {
OPM_err(119);
}
} else {