[Vm-dev] [commit][3144] CogVM source as per VMMaker.oscog-eem.950

commits at squeakvm.org commits at squeakvm.org
Fri Nov 21 23:07:39 UTC 2014


Revision: 3144
Author:   eliot
Date:     2014-11-21 15:07:35 -0800 (Fri, 21 Nov 2014)
Log Message:
-----------
CogVM source as per  VMMaker.oscog-eem.950

Fix regression in new primitiveBitShift.
Introduce >>> as an explicitly signed shift.
64-bit ize magnitude64BitIntegerFor:neg:,
positive64BitIntegerFor: & signed64BitIntegerFor:

Modified Paths:
--------------
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/sistasrc/vm/cointerp.c
    branches/Cog/sistasrc/vm/cointerp.h
    branches/Cog/sistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c

Property Changed:
----------------
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-11-21 23:07:35 UTC (rev 3144)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
    from
-	CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2093,7 +2093,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.948";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.950";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -7931,7 +7931,7 @@
 			/* bytecodePrimBitShift */
 			{
 				sqInt integerArgument;
-				sqLong integerReceiver;
+				usqInt integerReceiver;
 				sqInt shifted;
 				char *sp;
 
@@ -7959,7 +7959,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -7970,7 +7970,7 @@
 							goto l88;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -7991,11 +7991,9 @@
 							null;
 							goto l88;
 						}
-						shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -10868,7 +10866,7 @@
 			/* bytecodePrimBitShift */
 			{
 				sqInt integerArgument;
-				sqLong integerReceiver;
+				usqInt integerReceiver;
 				sqInt shifted;
 				char *sp;
 
@@ -10896,7 +10894,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -10907,7 +10905,7 @@
 							goto l203;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -10928,11 +10926,9 @@
 							null;
 							goto l203;
 						}
-						shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -19113,13 +19109,13 @@
     sqInt classArrayClass;
     sqInt classArrayObj;
     size_t dataSize;
-    long firstSegSize;
+    sqInt firstSegSize;
     sqInt hdrCogCodeSize;
     sqInt hdrEdenBytes;
     sqInt hdrMaxExtSemTabSize;
     sqInt hdrNumStackPages;
     sqInt header;
-    long headerFlags;
+    sqInt headerFlags;
     sqInt headerSize;
     squeakFileOffsetType headerStart;
     usqInt heapSize;
@@ -19136,7 +19132,7 @@
     sqInt memEnd;
     sqInt memLimit;
     usqInt minimumMemory;
-    long oldBaseAddr;
+    sqInt oldBaseAddr;
     sqInt oop;
     sqInt swapBytes;
     sqInt sz;
@@ -19176,9 +19172,9 @@
 	/* begin getLongFromFile:swap: */
 	w1 = 0;
 	sqImageFileRead((&w1), sizeof(long), 1, f);
-	dataSize = ((long) ((swapBytes
-	? byteSwapped(w1)
-	: w1)));
+	dataSize = (swapBytes
+		? byteSwapped(w1)
+		: w1);
 	/* begin getLongFromFile:swap: */
 	w2 = 0;
 	sqImageFileRead((&w2), sizeof(long), 1, f);
@@ -19189,24 +19185,24 @@
 	/* begin getLongFromFile:swap: */
 	w11 = 0;
 	sqImageFileRead((&w11), sizeof(long), 1, f);
-	anObject = ((long) ((swapBytes
-	? byteSwapped(w11)
-	: w11)));
+	anObject = (swapBytes
+		? byteSwapped(w11)
+		: w11);
 	GIV(specialObjectsOop) = anObject;
 	/* begin lastHash: */
 	/* begin getLongFromFile:swap: */
 	w12 = 0;
 	sqImageFileRead((&w12), sizeof(long), 1, f);
-	aValue = ((long) ((swapBytes
-	? byteSwapped(w12)
-	: w12)));
+	aValue = (swapBytes
+		? byteSwapped(w12)
+		: w12);
 	lastHash = aValue;
 	/* begin getLongFromFile:swap: */
 	w3 = 0;
 	sqImageFileRead((&w3), sizeof(long), 1, f);
-	GIV(savedWindowSize) = ((long) ((swapBytes
-	? byteSwapped(w3)
-	: w3)));
+	GIV(savedWindowSize) = (swapBytes
+		? byteSwapped(w3)
+		: w3);
 	/* begin getLongFromFile:swap: */
 	w4 = 0;
 	sqImageFileRead((&w4), sizeof(long), 1, f);
@@ -22976,7 +22972,7 @@
     sqInt sz;
 
 	isSmall = (isNegative
-		? magnitude <= ((MaxSmallInteger) + 1)
+		? magnitude < (MaxSmallInteger)
 		: magnitude < ((MaxSmallInteger) + 1));
 	if (isSmall) {
 		smallVal = ((sqInt) magnitude);
@@ -22988,22 +22984,22 @@
 	largeClass = (isNegative
 		? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargeNegativeInteger << (shiftForWord())))
 		: longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << (shiftForWord()))));
-	highWord = magnitude >> 32;
-	if (highWord == 0) {
+	if (((highWord = magnitude >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
 	for (i = 0; i < sz; i += 1) {
 		intValue = (magnitude >> (i * 8)) & 0xFF;
@@ -24471,7 +24467,7 @@
 primitiveBitShift(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt integerArgument;
-    sqLong integerReceiver;
+    usqInt integerReceiver;
     sqInt shifted;
     char *sp;
 
@@ -24489,7 +24485,7 @@
 	if (!GIV(primFailCode)) {
 		if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-			/* Left shift -- must fail if we lose bits beyond 32 */
+			/* Left shift -- must fail bits would be lost */
 
 			if (!(integerArgument <= 0x1F)) {
 				/* begin primitiveFail */
@@ -24499,7 +24495,7 @@
 				return;
 			}
 			shifted = integerReceiver << integerArgument;
-			if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+			if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 				/* begin primitiveFail */
 				if (!GIV(primFailCode)) {
 					GIV(primFailCode) = 1;
@@ -24518,11 +24514,9 @@
 				}
 				return;
 			}
-			shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+			shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 		}
-		shifted = ((shifted ^ (shifted << 1)) >= 0
-			? ((shifted << 1) | 1)
-			: positive32BitIntegerFor(shifted));
+		shifted = positive32BitIntegerFor(shifted);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 		GIV(stackPointer) = sp;
@@ -48458,23 +48452,20 @@
     sqInt newLargeInteger;
     sqInt sz;
 
-
-	/* shift is coerced to usqInt otherwise */
-
-	highWord = integerValue >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((sqInt) integerValue) >> 32)) == 0) {
 		return positive32BitIntegerFor(integerValue);
 	}
 	sz = 5;
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
+		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+			}
+		}
 	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
+
 	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + ((4 - sz) & 3), 8 / BytesPerOop);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 7, (((unsigned sqLong)integerValue) >> 56) & 0xFF);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 6, (((unsigned sqLong)integerValue) >> 48) & 0xFF);
@@ -51395,6 +51386,7 @@
     sqInt newLargeInteger;
     sqInt sz;
 
+	
 	if (integerValue < 0) {
 		largeClass = ClassLargeNegativeIntegerCompactIndex;
 		magnitude = 0 - integerValue;
@@ -51408,22 +51400,22 @@
 	 || (0 != (integerValue << 1)))) {
 		return signed32BitIntegerFor(integerValue);
 	}
-	highWord = ((unsigned sqLong)magnitude) >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((unsigned sqLong)magnitude) >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(largeClass, 8 + ((4 - sz) & 3), (sz + 3) / BytesPerOop);
 	if (sz > 4) {
 		byteAtput((newLargeInteger + BaseHeaderSize) + 7, (((unsigned sqLong)magnitude) >> 56) & 0xFF);

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-11-21 23:07:35 UTC (rev 3144)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-11-21 23:07:35 UTC (rev 3144)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
    from
-	CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2096,7 +2096,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.948";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.950";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -7940,7 +7940,7 @@
 			/* bytecodePrimBitShift */
 			{
 				sqInt integerArgument;
-				sqLong integerReceiver;
+				usqInt integerReceiver;
 				sqInt shifted;
 				char *sp;
 
@@ -7968,7 +7968,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -7979,7 +7979,7 @@
 							goto l88;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -8000,11 +8000,9 @@
 							null;
 							goto l88;
 						}
-						shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -10877,7 +10875,7 @@
 			/* bytecodePrimBitShift */
 			{
 				sqInt integerArgument;
-				sqLong integerReceiver;
+				usqInt integerReceiver;
 				sqInt shifted;
 				char *sp;
 
@@ -10905,7 +10903,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -10916,7 +10914,7 @@
 							goto l203;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -10937,11 +10935,9 @@
 							null;
 							goto l203;
 						}
-						shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -19122,13 +19118,13 @@
     sqInt classArrayClass;
     sqInt classArrayObj;
     size_t dataSize;
-    long firstSegSize;
+    sqInt firstSegSize;
     sqInt hdrCogCodeSize;
     sqInt hdrEdenBytes;
     sqInt hdrMaxExtSemTabSize;
     sqInt hdrNumStackPages;
     sqInt header;
-    long headerFlags;
+    sqInt headerFlags;
     sqInt headerSize;
     squeakFileOffsetType headerStart;
     usqInt heapSize;
@@ -19145,7 +19141,7 @@
     sqInt memEnd;
     sqInt memLimit;
     usqInt minimumMemory;
-    long oldBaseAddr;
+    sqInt oldBaseAddr;
     sqInt oop;
     sqInt swapBytes;
     sqInt sz;
@@ -19185,9 +19181,9 @@
 	/* begin getLongFromFile:swap: */
 	w1 = 0;
 	sqImageFileRead((&w1), sizeof(long), 1, f);
-	dataSize = ((long) ((swapBytes
-	? byteSwapped(w1)
-	: w1)));
+	dataSize = (swapBytes
+		? byteSwapped(w1)
+		: w1);
 	/* begin getLongFromFile:swap: */
 	w2 = 0;
 	sqImageFileRead((&w2), sizeof(long), 1, f);
@@ -19198,24 +19194,24 @@
 	/* begin getLongFromFile:swap: */
 	w11 = 0;
 	sqImageFileRead((&w11), sizeof(long), 1, f);
-	anObject = ((long) ((swapBytes
-	? byteSwapped(w11)
-	: w11)));
+	anObject = (swapBytes
+		? byteSwapped(w11)
+		: w11);
 	GIV(specialObjectsOop) = anObject;
 	/* begin lastHash: */
 	/* begin getLongFromFile:swap: */
 	w12 = 0;
 	sqImageFileRead((&w12), sizeof(long), 1, f);
-	aValue = ((long) ((swapBytes
-	? byteSwapped(w12)
-	: w12)));
+	aValue = (swapBytes
+		? byteSwapped(w12)
+		: w12);
 	lastHash = aValue;
 	/* begin getLongFromFile:swap: */
 	w3 = 0;
 	sqImageFileRead((&w3), sizeof(long), 1, f);
-	GIV(savedWindowSize) = ((long) ((swapBytes
-	? byteSwapped(w3)
-	: w3)));
+	GIV(savedWindowSize) = (swapBytes
+		? byteSwapped(w3)
+		: w3);
 	/* begin getLongFromFile:swap: */
 	w4 = 0;
 	sqImageFileRead((&w4), sizeof(long), 1, f);
@@ -22985,7 +22981,7 @@
     sqInt sz;
 
 	isSmall = (isNegative
-		? magnitude <= ((MaxSmallInteger) + 1)
+		? magnitude < (MaxSmallInteger)
 		: magnitude < ((MaxSmallInteger) + 1));
 	if (isSmall) {
 		smallVal = ((sqInt) magnitude);
@@ -22997,22 +22993,22 @@
 	largeClass = (isNegative
 		? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargeNegativeInteger << (shiftForWord())))
 		: longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << (shiftForWord()))));
-	highWord = magnitude >> 32;
-	if (highWord == 0) {
+	if (((highWord = magnitude >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
 	for (i = 0; i < sz; i += 1) {
 		intValue = (magnitude >> (i * 8)) & 0xFF;
@@ -24480,7 +24476,7 @@
 primitiveBitShift(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt integerArgument;
-    sqLong integerReceiver;
+    usqInt integerReceiver;
     sqInt shifted;
     char *sp;
 
@@ -24498,7 +24494,7 @@
 	if (!GIV(primFailCode)) {
 		if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-			/* Left shift -- must fail if we lose bits beyond 32 */
+			/* Left shift -- must fail bits would be lost */
 
 			if (!(integerArgument <= 0x1F)) {
 				/* begin primitiveFail */
@@ -24508,7 +24504,7 @@
 				return;
 			}
 			shifted = integerReceiver << integerArgument;
-			if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+			if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 				/* begin primitiveFail */
 				if (!GIV(primFailCode)) {
 					GIV(primFailCode) = 1;
@@ -24527,11 +24523,9 @@
 				}
 				return;
 			}
-			shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+			shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 		}
-		shifted = ((shifted ^ (shifted << 1)) >= 0
-			? ((shifted << 1) | 1)
-			: positive32BitIntegerFor(shifted));
+		shifted = positive32BitIntegerFor(shifted);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 		GIV(stackPointer) = sp;
@@ -48467,23 +48461,20 @@
     sqInt newLargeInteger;
     sqInt sz;
 
-
-	/* shift is coerced to usqInt otherwise */
-
-	highWord = integerValue >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((sqInt) integerValue) >> 32)) == 0) {
 		return positive32BitIntegerFor(integerValue);
 	}
 	sz = 5;
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
+		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+			}
+		}
 	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
+
 	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + ((4 - sz) & 3), 8 / BytesPerOop);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 7, (((unsigned sqLong)integerValue) >> 56) & 0xFF);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 6, (((unsigned sqLong)integerValue) >> 48) & 0xFF);
@@ -51404,6 +51395,7 @@
     sqInt newLargeInteger;
     sqInt sz;
 
+	
 	if (integerValue < 0) {
 		largeClass = ClassLargeNegativeIntegerCompactIndex;
 		magnitude = 0 - integerValue;
@@ -51417,22 +51409,22 @@
 	 || (0 != (integerValue << 1)))) {
 		return signed32BitIntegerFor(integerValue);
 	}
-	highWord = ((unsigned sqLong)magnitude) >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((unsigned sqLong)magnitude) >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(largeClass, 8 + ((4 - sz) & 3), (sz + 3) / BytesPerOop);
 	if (sz > 4) {
 		byteAtput((newLargeInteger + BaseHeaderSize) + 7, (((unsigned sqLong)magnitude) >> 56) & 0xFF);

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2014-11-21 23:07:35 UTC (rev 3144)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
    from
-	CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2343,7 +2343,7 @@
 /*540*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.948";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.950";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -9113,7 +9113,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -9124,7 +9124,7 @@
 							goto l96;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -9147,9 +9147,7 @@
 						}
 						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -12103,7 +12101,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -12114,7 +12112,7 @@
 							goto l223;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -12137,9 +12135,7 @@
 						}
 						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -23965,12 +23961,12 @@
     sqInt classTablePage;
     size_t dataSize;
     sqInt edenBytes;
-    long firstSegSize;
+    sqInt firstSegSize;
     sqInt hdrCogCodeSize;
     sqInt hdrEdenBytes;
     sqInt hdrMaxExtSemTabSize;
     sqInt hdrNumStackPages;
-    long headerFlags;
+    sqInt headerFlags;
     sqInt headerSize;
     squeakFileOffsetType headerStart;
     usqInt heapSize;
@@ -23989,7 +23985,7 @@
     usqInt minimumMemory;
     usqInt numSlots;
     sqInt objOop;
-    long oldBaseAddr;
+    sqInt oldBaseAddr;
     sqInt oldStart;
     sqInt oop;
     sqInt p;
@@ -24032,9 +24028,9 @@
 	/* begin getLongFromFile:swap: */
 	w1 = 0;
 	sqImageFileRead((&w1), sizeof(long), 1, f);
-	dataSize = ((long) ((swapBytes
-	? ((((((usqInt) w1 >> 24)) & Byte0Mask) + ((((usqInt) w1 >> 8)) & Byte1Mask)) + ((((usqInt) w1 << 8)) & Byte2Mask)) + ((((usqInt) w1 << 24)) & Byte3Mask)
-	: w1)));
+	dataSize = (swapBytes
+		? ((((((usqInt) w1 >> 24)) & Byte0Mask) + ((((usqInt) w1 >> 8)) & Byte1Mask)) + ((((usqInt) w1 << 8)) & Byte2Mask)) + ((((usqInt) w1 << 24)) & Byte3Mask)
+		: w1);
 	/* begin getLongFromFile:swap: */
 	w2 = 0;
 	sqImageFileRead((&w2), sizeof(long), 1, f);
@@ -24045,24 +24041,24 @@
 	/* begin getLongFromFile:swap: */
 	w3 = 0;
 	sqImageFileRead((&w3), sizeof(long), 1, f);
-	anObject = ((long) ((swapBytes
-	? ((((((usqInt) w3 >> 24)) & Byte0Mask) + ((((usqInt) w3 >> 8)) & Byte1Mask)) + ((((usqInt) w3 << 8)) & Byte2Mask)) + ((((usqInt) w3 << 24)) & Byte3Mask)
-	: w3)));
+	anObject = (swapBytes
+		? ((((((usqInt) w3 >> 24)) & Byte0Mask) + ((((usqInt) w3 >> 8)) & Byte1Mask)) + ((((usqInt) w3 << 8)) & Byte2Mask)) + ((((usqInt) w3 << 24)) & Byte3Mask)
+		: w3);
 	GIV(specialObjectsOop) = anObject;
 	/* begin lastHash: */
 	/* begin getLongFromFile:swap: */
 	w4 = 0;
 	sqImageFileRead((&w4), sizeof(long), 1, f);
-	seed = ((long) ((swapBytes
-	? ((((((usqInt) w4 >> 24)) & Byte0Mask) + ((((usqInt) w4 >> 8)) & Byte1Mask)) + ((((usqInt) w4 << 8)) & Byte2Mask)) + ((((usqInt) w4 << 24)) & Byte3Mask)
-	: w4)));
+	seed = (swapBytes
+		? ((((((usqInt) w4 >> 24)) & Byte0Mask) + ((((usqInt) w4 >> 8)) & Byte1Mask)) + ((((usqInt) w4 << 8)) & Byte2Mask)) + ((((usqInt) w4 << 24)) & Byte3Mask)
+		: w4);
 	GIV(lastHash) = seed;
 	/* begin getLongFromFile:swap: */
 	w5 = 0;
 	sqImageFileRead((&w5), sizeof(long), 1, f);
-	GIV(savedWindowSize) = ((long) ((swapBytes
-	? ((((((usqInt) w5 >> 24)) & Byte0Mask) + ((((usqInt) w5 >> 8)) & Byte1Mask)) + ((((usqInt) w5 << 8)) & Byte2Mask)) + ((((usqInt) w5 << 24)) & Byte3Mask)
-	: w5)));
+	GIV(savedWindowSize) = (swapBytes
+		? ((((((usqInt) w5 >> 24)) & Byte0Mask) + ((((usqInt) w5 >> 8)) & Byte1Mask)) + ((((usqInt) w5 << 8)) & Byte2Mask)) + ((((usqInt) w5 << 24)) & Byte3Mask)
+		: w5);
 	/* begin getLongFromFile:swap: */
 	w6 = 0;
 	sqImageFileRead((&w6), sizeof(long), 1, f);
@@ -28293,7 +28289,7 @@
     sqInt sz;
 
 	isSmall = (isNegative
-		? magnitude <= ((MaxSmallInteger) + 1)
+		? magnitude < (MaxSmallInteger)
 		: magnitude < ((MaxSmallInteger) + 1));
 	if (isSmall) {
 		smallVal = ((sqInt) magnitude);
@@ -28309,22 +28305,22 @@
 		: (/* begin knownClassAtIndex: */
 			assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))),
 			longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (ClassLargePositiveIntegerCompactIndex << (shiftForWord())))));
-	highWord = magnitude >> 32;
-	if (highWord == 0) {
+	if (((highWord = magnitude >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
 	for (i = 0; i < sz; i += 1) {
 		intValue = (magnitude >> (i * 8)) & 0xFF;
@@ -29898,7 +29894,7 @@
 	if (!GIV(primFailCode)) {
 		if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-			/* Left shift -- must fail if we lose bits beyond 32 */
+			/* Left shift -- must fail bits would be lost */
 
 			if (!(integerArgument <= 0x1F)) {
 				/* begin primitiveFail */
@@ -29908,7 +29904,7 @@
 				return;
 			}
 			shifted = integerReceiver << integerArgument;
-			if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+			if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 				/* begin primitiveFail */
 				if (!GIV(primFailCode)) {
 					GIV(primFailCode) = 1;
@@ -29929,9 +29925,7 @@
 			}
 			shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 		}
-		shifted = ((shifted ^ (shifted << 1)) >= 0
-			? ((shifted << 1) | 1)
-			: positive32BitIntegerFor(shifted));
+		shifted = positive32BitIntegerFor(shifted);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 		GIV(stackPointer) = sp;
@@ -69046,23 +69040,20 @@
     sqInt objFormat;
     sqInt sz;
 
-
-	/* shift is coerced to usqInt otherwise */
-
-	highWord = integerValue >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((sqInt) integerValue) >> 32)) == 0) {
 		return positive32BitIntegerFor(integerValue);
 	}
 	sz = 5;
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
+		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+			}
+		}
 	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
+
 	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
 	objFormat = 16 + ((8 - sz) & (BytesPerWord - 1));
 	assert(((8 / BytesPerOop) >= 0)
@@ -72874,6 +72865,7 @@
     sqInt objFormat;
     sqInt sz;
 
+	
 	if (integerValue < 0) {
 		largeClass = ClassLargeNegativeIntegerCompactIndex;
 		magnitude = 0 - integerValue;
@@ -72887,22 +72879,22 @@
 	 || (0 != (integerValue << 1)))) {
 		return signed32BitIntegerFor(integerValue);
 	}
-	highWord = ((unsigned sqLong)magnitude) >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((unsigned sqLong)magnitude) >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
 	objFormat = 16 + ((8 - sz) & (BytesPerWord - 1));
 	numSlots = (sz + 3) / BytesPerOop;

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2014-11-21 23:07:35 UTC (rev 3144)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
 
 

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2014-11-21 23:07:35 UTC (rev 3144)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
    from
-	CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2346,7 +2346,7 @@
 /*540*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.948";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.950";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -9122,7 +9122,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -9133,7 +9133,7 @@
 							goto l96;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -9156,9 +9156,7 @@
 						}
 						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -12112,7 +12110,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -12123,7 +12121,7 @@
 							goto l223;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -12146,9 +12144,7 @@
 						}
 						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -23974,12 +23970,12 @@
     sqInt classTablePage;
     size_t dataSize;
     sqInt edenBytes;
-    long firstSegSize;
+    sqInt firstSegSize;
     sqInt hdrCogCodeSize;
     sqInt hdrEdenBytes;
     sqInt hdrMaxExtSemTabSize;
     sqInt hdrNumStackPages;
-    long headerFlags;
+    sqInt headerFlags;
     sqInt headerSize;
     squeakFileOffsetType headerStart;
     usqInt heapSize;
@@ -23998,7 +23994,7 @@
     usqInt minimumMemory;
     usqInt numSlots;
     sqInt objOop;
-    long oldBaseAddr;
+    sqInt oldBaseAddr;
     sqInt oldStart;
     sqInt oop;
     sqInt p;
@@ -24041,9 +24037,9 @@
 	/* begin getLongFromFile:swap: */
 	w1 = 0;
 	sqImageFileRead((&w1), sizeof(long), 1, f);
-	dataSize = ((long) ((swapBytes
-	? ((((((usqInt) w1 >> 24)) & Byte0Mask) + ((((usqInt) w1 >> 8)) & Byte1Mask)) + ((((usqInt) w1 << 8)) & Byte2Mask)) + ((((usqInt) w1 << 24)) & Byte3Mask)
-	: w1)));
+	dataSize = (swapBytes
+		? ((((((usqInt) w1 >> 24)) & Byte0Mask) + ((((usqInt) w1 >> 8)) & Byte1Mask)) + ((((usqInt) w1 << 8)) & Byte2Mask)) + ((((usqInt) w1 << 24)) & Byte3Mask)
+		: w1);
 	/* begin getLongFromFile:swap: */
 	w2 = 0;
 	sqImageFileRead((&w2), sizeof(long), 1, f);
@@ -24054,24 +24050,24 @@
 	/* begin getLongFromFile:swap: */
 	w3 = 0;
 	sqImageFileRead((&w3), sizeof(long), 1, f);
-	anObject = ((long) ((swapBytes
-	? ((((((usqInt) w3 >> 24)) & Byte0Mask) + ((((usqInt) w3 >> 8)) & Byte1Mask)) + ((((usqInt) w3 << 8)) & Byte2Mask)) + ((((usqInt) w3 << 24)) & Byte3Mask)
-	: w3)));
+	anObject = (swapBytes
+		? ((((((usqInt) w3 >> 24)) & Byte0Mask) + ((((usqInt) w3 >> 8)) & Byte1Mask)) + ((((usqInt) w3 << 8)) & Byte2Mask)) + ((((usqInt) w3 << 24)) & Byte3Mask)
+		: w3);
 	GIV(specialObjectsOop) = anObject;
 	/* begin lastHash: */
 	/* begin getLongFromFile:swap: */
 	w4 = 0;
 	sqImageFileRead((&w4), sizeof(long), 1, f);
-	seed = ((long) ((swapBytes
-	? ((((((usqInt) w4 >> 24)) & Byte0Mask) + ((((usqInt) w4 >> 8)) & Byte1Mask)) + ((((usqInt) w4 << 8)) & Byte2Mask)) + ((((usqInt) w4 << 24)) & Byte3Mask)
-	: w4)));
+	seed = (swapBytes
+		? ((((((usqInt) w4 >> 24)) & Byte0Mask) + ((((usqInt) w4 >> 8)) & Byte1Mask)) + ((((usqInt) w4 << 8)) & Byte2Mask)) + ((((usqInt) w4 << 24)) & Byte3Mask)
+		: w4);
 	GIV(lastHash) = seed;
 	/* begin getLongFromFile:swap: */
 	w5 = 0;
 	sqImageFileRead((&w5), sizeof(long), 1, f);
-	GIV(savedWindowSize) = ((long) ((swapBytes
-	? ((((((usqInt) w5 >> 24)) & Byte0Mask) + ((((usqInt) w5 >> 8)) & Byte1Mask)) + ((((usqInt) w5 << 8)) & Byte2Mask)) + ((((usqInt) w5 << 24)) & Byte3Mask)
-	: w5)));
+	GIV(savedWindowSize) = (swapBytes
+		? ((((((usqInt) w5 >> 24)) & Byte0Mask) + ((((usqInt) w5 >> 8)) & Byte1Mask)) + ((((usqInt) w5 << 8)) & Byte2Mask)) + ((((usqInt) w5 << 24)) & Byte3Mask)
+		: w5);
 	/* begin getLongFromFile:swap: */
 	w6 = 0;
 	sqImageFileRead((&w6), sizeof(long), 1, f);
@@ -28302,7 +28298,7 @@
     sqInt sz;
 
 	isSmall = (isNegative
-		? magnitude <= ((MaxSmallInteger) + 1)
+		? magnitude < (MaxSmallInteger)
 		: magnitude < ((MaxSmallInteger) + 1));
 	if (isSmall) {
 		smallVal = ((sqInt) magnitude);
@@ -28318,22 +28314,22 @@
 		: (/* begin knownClassAtIndex: */
 			assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))),
 			longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (ClassLargePositiveIntegerCompactIndex << (shiftForWord())))));
-	highWord = magnitude >> 32;
-	if (highWord == 0) {
+	if (((highWord = magnitude >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
 	for (i = 0; i < sz; i += 1) {
 		intValue = (magnitude >> (i * 8)) & 0xFF;
@@ -29907,7 +29903,7 @@
 	if (!GIV(primFailCode)) {
 		if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-			/* Left shift -- must fail if we lose bits beyond 32 */
+			/* Left shift -- must fail bits would be lost */
 
 			if (!(integerArgument <= 0x1F)) {
 				/* begin primitiveFail */
@@ -29917,7 +29913,7 @@
 				return;
 			}
 			shifted = integerReceiver << integerArgument;
-			if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+			if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 				/* begin primitiveFail */
 				if (!GIV(primFailCode)) {
 					GIV(primFailCode) = 1;
@@ -29938,9 +29934,7 @@
 			}
 			shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 		}
-		shifted = ((shifted ^ (shifted << 1)) >= 0
-			? ((shifted << 1) | 1)
-			: positive32BitIntegerFor(shifted));
+		shifted = positive32BitIntegerFor(shifted);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 		GIV(stackPointer) = sp;
@@ -69055,23 +69049,20 @@
     sqInt objFormat;
     sqInt sz;
 
-
-	/* shift is coerced to usqInt otherwise */
-
-	highWord = integerValue >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((sqInt) integerValue) >> 32)) == 0) {
 		return positive32BitIntegerFor(integerValue);
 	}
 	sz = 5;
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
+		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+			}
+		}
 	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
+
 	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
 	objFormat = 16 + ((8 - sz) & (BytesPerWord - 1));
 	assert(((8 / BytesPerOop) >= 0)
@@ -72883,6 +72874,7 @@
     sqInt objFormat;
     sqInt sz;
 
+	
 	if (integerValue < 0) {
 		largeClass = ClassLargeNegativeIntegerCompactIndex;
 		magnitude = 0 - integerValue;
@@ -72896,22 +72888,22 @@
 	 || (0 != (integerValue << 1)))) {
 		return signed32BitIntegerFor(integerValue);
 	}
-	highWord = ((unsigned sqLong)magnitude) >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((unsigned sqLong)magnitude) >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
 	objFormat = 16 + ((8 - sz) & (BytesPerWord - 1));
 	numSlots = (sz + 3) / BytesPerOop;

Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c	2014-11-21 23:07:35 UTC (rev 3144)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
    from
-	StackInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	StackInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2093,7 +2093,7 @@
  0 };
 char * breakSelector;
 sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.948";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.950";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -8489,7 +8489,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -8500,7 +8500,7 @@
 							goto l94;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -8523,9 +8523,7 @@
 						}
 						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -11457,7 +11455,7 @@
 				if (!GIV(primFailCode)) {
 					if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-						/* Left shift -- must fail if we lose bits beyond 32 */
+						/* Left shift -- must fail bits would be lost */
 
 						if (!(integerArgument <= 0x1F)) {
 							/* begin primitiveFail */
@@ -11468,7 +11466,7 @@
 							goto l221;
 						}
 						shifted = integerReceiver << integerArgument;
-						if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+						if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 							/* begin primitiveFail */
 							if (!GIV(primFailCode)) {
 								GIV(primFailCode) = 1;
@@ -11491,9 +11489,7 @@
 						}
 						shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 					}
-					shifted = ((shifted ^ (shifted << 1)) >= 0
-						? ((shifted << 1) | 1)
-						: positive32BitIntegerFor(shifted));
+					shifted = positive32BitIntegerFor(shifted);
 					/* begin pop:thenPush: */
 					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 					GIV(stackPointer) = sp;
@@ -14111,7 +14107,7 @@
     sqInt sz;
 
 	isSmall = (isNegative
-		? magnitude <= ((MaxSmallInteger) + 1)
+		? magnitude < (MaxSmallInteger)
 		: magnitude < ((MaxSmallInteger) + 1));
 	if (isSmall) {
 		smallVal = ((sqInt) magnitude);
@@ -14127,22 +14123,22 @@
 		: (/* begin knownClassAtIndex: */
 			assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))),
 			longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (ClassLargePositiveIntegerCompactIndex << (shiftForWord())))));
-	highWord = magnitude >> 32;
-	if (highWord == 0) {
+	if (((highWord = magnitude >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
 	for (i = 0; i < sz; i += 1) {
 		intValue = (magnitude >> (i * 8)) & 0xFF;
@@ -15718,7 +15714,7 @@
 	if (!GIV(primFailCode)) {
 		if (((integerArgument = (integerArgument >> 1))) >= 0) {
 
-			/* Left shift -- must fail if we lose bits beyond 32 */
+			/* Left shift -- must fail bits would be lost */
 
 			if (!(integerArgument <= 0x1F)) {
 				/* begin primitiveFail */
@@ -15728,7 +15724,7 @@
 				return;
 			}
 			shifted = integerReceiver << integerArgument;
-			if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
+			if (!(integerReceiver == (((usqInt) shifted) >> integerArgument))) {
 				/* begin primitiveFail */
 				if (!GIV(primFailCode)) {
 					GIV(primFailCode) = 1;
@@ -15749,9 +15745,7 @@
 			}
 			shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
 		}
-		shifted = ((shifted ^ (shifted << 1)) >= 0
-			? ((shifted << 1) | 1)
-			: positive32BitIntegerFor(shifted));
+		shifted = positive32BitIntegerFor(shifted);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
 		GIV(stackPointer) = sp;
@@ -57329,23 +57323,20 @@
     sqInt objFormat;
     sqInt sz;
 
-
-	/* shift is coerced to usqInt otherwise */
-
-	highWord = integerValue >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((sqInt) integerValue) >> 32)) == 0) {
 		return positive32BitIntegerFor(integerValue);
 	}
 	sz = 5;
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
+		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+			}
+		}
 	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
-	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-		sz += 1;
-	}
+
 	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
 	objFormat = 16 + ((8 - sz) & (BytesPerWord - 1));
 	assert(((8 / BytesPerOop) >= 0)
@@ -62361,6 +62352,7 @@
     sqInt objFormat;
     sqInt sz;
 
+	
 	if (integerValue < 0) {
 		largeClass = ClassLargeNegativeIntegerCompactIndex;
 		magnitude = 0 - integerValue;
@@ -62374,22 +62366,22 @@
 	 || (0 != (integerValue << 1)))) {
 		return signed32BitIntegerFor(integerValue);
 	}
-	highWord = ((unsigned sqLong)magnitude) >> 32;
-	if (highWord == 0) {
+	if (((highWord = ((unsigned sqLong)magnitude) >> 32)) == 0) {
 		sz = 4;
 	}
 	else {
 		sz = 5;
 		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 			sz += 1;
+			if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+				sz += 1;
+				if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
+					sz += 1;
+				}
+			}
 		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
-		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
-			sz += 1;
-		}
 	}
+
 	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
 	objFormat = 16 + ((8 - sz) & (BytesPerWord - 1));
 	numSlots = (sz + 3) / BytesPerOop;

Modified: branches/Cog/nsspurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/interp.c	2014-11-21 05:05:31 UTC (rev 3143)
+++ branches/Cog/nsspurstacksrc/vm/interp.c	2014-11-21 23:07:35 UTC (rev 3144)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid: 9323b2ad-f5cf-4aca-8f31-67eb5616ccca
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.950 uuid: d4d2d679-fd90-48f5-a47a-ebae021776e7
    from

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list