Fix and simplify fingerprinting for 64 bit values

This commit is contained in:
David Brown 2016-11-15 11:51:29 +00:00
parent f9c72a37b0
commit f08e49d856
187 changed files with 366 additions and 349 deletions

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef Files__h
#define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPB__h
#define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPC__h
#define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -49,10 +49,11 @@ export void OPM_CloseFiles (void);
export void OPM_CloseOldSym (void);
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, UINT64 set);
export void OPM_FPrintLReal (INT32 *fp, LONGREAL val);
export void OPM_FPrintReal (INT32 *fp, REAL val);
export void OPM_FPrintSet (INT32 *fp, UINT64 val);
static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos);
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len);
export void OPM_Get (CHAR *ch);
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
export void OPM_InitOptions (void);
@ -707,31 +708,37 @@ void OPM_err (INT16 n)
OPM_Mark(n, OPM_errpos);
}
void OPM_FPrint (INT32 *fp, INT64 val)
{
*fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32);
}
void OPM_FPrintSet (INT32 *fp, UINT64 set)
{
OPM_FPrint(&*fp, __VAL(INT32, set));
}
void OPM_FPrintReal (INT32 *fp, REAL real)
static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len)
{
INT16 i;
INT32 l;
__GET((ADDRESS)&real, l, INT32);
OPM_FPrint(&*fp, l);
__ASSERT(__MASK(bytes__len, -4) == 0, 0);
i = 0;
while (i < bytes__len) {
__GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32);
*fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32);
i += 4;
}
}
void OPM_FPrintLReal (INT32 *fp, LONGREAL lr)
void OPM_FPrint (INT32 *fp, INT64 val)
{
INT32 l, h;
__GET((ADDRESS)&lr, l, INT32);
__GET((ADDRESS)&lr + 4, h, INT32);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
OPM_FingerprintBytes(&*fp, (void*)&val, 8);
}
void OPM_FPrintSet (INT32 *fp, UINT64 val)
{
OPM_FingerprintBytes(&*fp, (void*)&val, 8);
}
void OPM_FPrintReal (INT32 *fp, REAL val)
{
OPM_FingerprintBytes(&*fp, (void*)&val, 4);
}
void OPM_FPrintLReal (INT32 *fp, LONGREAL val)
{
OPM_FingerprintBytes(&*fp, (void*)&val, 8);
}
void OPM_SymRCh (CHAR *ch)

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPM__h
#define OPM__h
@ -24,9 +24,9 @@ import void OPM_CloseFiles (void);
import void OPM_CloseOldSym (void);
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, UINT64 set);
import void OPM_FPrintLReal (INT32 *fp, LONGREAL val);
import void OPM_FPrintReal (INT32 *fp, REAL val);
import void OPM_FPrintSet (INT32 *fp, UINT64 val);
import void OPM_Get (CHAR *ch);
import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
import void OPM_InitOptions (void);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPT__h
#define OPT__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Out__h
#define Out__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Platform__h
#define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Reals__h
#define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Texts__h
#define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef VT100__h
#define VT100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef extTools__h
#define extTools__h