[Vm-dev] [commit][3021] CogVM source as per VMMaker.oscog-eem.787

commits at squeakvm.org commits at squeakvm.org
Sun Jun 29 02:57:52 UTC 2014


Revision: 3021
Author:   eliot
Date:     2014-06-28 19:57:50 -0700 (Sat, 28 Jun 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.787

Fix mixup of old & young spaces in primitiveVMParameter, and
comment some new parameters.

Fix return types for positive[64/32]BitValueOf:.
positive32BitValueOf: must answer a usqInt,
positive64BitValueOf: must answer a usqLong.

Use positiveMachineIntegerValueOf: to decode arg in primitiveNewWithArg
and ensure positiveMachineIntegerValueOf: is inlined there-in.

Spur:
Fix sign and overflow issues in instantiating larger objects
and determining the size of large instances.

Fix some freeChunk accesses that used fetchPointer:ofObject:.

Cog ARM:
Fix prim return for compileInterpreterPrimitive: on RISCs.  On return from
interpreter prim, ret pc is in instructionPointer and must return to whence
it came, which is the stack on CISC and the LinkReg on RISC.  Hence restoring
the receiver reg requires different offsets in the two cases.

Rework the rotatable quick constant logic a little and clean up users.
Fix concretizeMoveRXbrR to do byte not word loads.
Fix concretizeConditionalJumpLong: to actually be conditional. Oops.

Correct mistaken callersaved reg stuff for ARM
Fix concretizedRetN to not over-bump the SP

The method abort trampolines shouldn't pop anything, especially
now we have the pushLinkreg: arg to manage the LinkReg more easily.

Slang:
Rip out the UseRightShiftForDivide optimization.  It gets unsigned division
wrong, and C compilers can and will optimize this correctly themselves.

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
    branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c
    branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c
    branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/nscogsrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
    branches/Cog/nscogsrc/plugins/RePlugin/RePlugin.c
    branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c
    branches/Cog/nscogsrc/vm/cogit.c
    branches/Cog/nscogsrc/vm/cogit.h
    branches/Cog/nscogsrc/vm/cogmethod.h
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nscogsrc/vm/interp.h
    branches/Cog/nscogsrc/vm/vmCallback.h
    branches/Cog/nsspursrc/vm/cogit.c
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogmethod.h
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspursrc/vm/interp.h
    branches/Cog/nsspursrc/vm/vmCallback.h
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/nsspurstacksrc/vm/interp.h
    branches/Cog/nsspurstacksrc/vm/vmCallback.h
    branches/Cog/platforms/Cross/vm/sqVirtualMachine.c
    branches/Cog/platforms/Cross/vm/sqVirtualMachine.h
    branches/Cog/sistasrc/vm/cogit.c
    branches/Cog/sistasrc/vm/cogit.h
    branches/Cog/sistasrc/vm/cogmethod.h
    branches/Cog/sistasrc/vm/cointerp.c
    branches/Cog/sistasrc/vm/cointerp.h
    branches/Cog/sistasrc/vm/gcc3x-cointerp.c
    branches/Cog/sistasrc/vm/interp.h
    branches/Cog/sistasrc/vm/vmCallback.h
    branches/Cog/spursistasrc/vm/cogit.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogmethod.h
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/interp.h
    branches/Cog/spursistasrc/vm/vmCallback.h
    branches/Cog/spursrc/vm/cogit.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogmethod.h
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/interp.h
    branches/Cog/spursrc/vm/vmCallback.h
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/spurstacksrc/vm/interp.h
    branches/Cog/spurstacksrc/vm/vmCallback.h
    branches/Cog/src/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c
    branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c
    branches/Cog/src/plugins/BochsIA32Plugin/BochsIA32Plugin.c
    branches/Cog/src/plugins/FFTPlugin/FFTPlugin.c
    branches/Cog/src/plugins/FilePlugin/FilePlugin.c
    branches/Cog/src/plugins/IA32ABI/IA32ABI.c
    branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/src/plugins/Klatt/Klatt.c
    branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/src/plugins/MacMenubarPlugin/MacMenubarPlugin.c
    branches/Cog/src/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
    branches/Cog/src/plugins/QuicktimePlugin/QuicktimePlugin.c
    branches/Cog/src/plugins/RePlugin/RePlugin.c
    branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c
    branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c
    branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c
    branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c
    branches/Cog/src/plugins/ZipPlugin/ZipPlugin.c
    branches/Cog/src/vm/cogit.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogmethod.h
    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/src/vm/interp.h
    branches/Cog/src/vm/vmCallback.h
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c
    branches/Cog/stacksrc/vm/interp.h
    branches/Cog/stacksrc/vm/vmCallback.h

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

Modified: branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701
+	VMPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	BalloonEnginePlugin VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701
+	BalloonEnginePlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
  */
-static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701 " __DATE__ ;
+static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
 
 
 
@@ -773,7 +773,7 @@
 static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
 static sqInt (*popRemappableOop)(void);
 static sqInt (*positive32BitIntegerFor)(sqInt integerValue);
-static sqInt (*positive32BitValueOf)(sqInt oop);
+static usqInt (*positive32BitValueOf)(sqInt oop);
 static sqInt (*primitiveFail)(void);
 static sqInt (*primitiveFailFor)(sqInt reasonCode);
 static sqInt (*push)(sqInt object);
@@ -819,7 +819,7 @@
 extern sqInt popthenPush(sqInt nItems, sqInt oop);
 extern sqInt popRemappableOop(void);
 extern sqInt positive32BitIntegerFor(sqInt integerValue);
-extern sqInt positive32BitValueOf(sqInt oop);
+extern usqInt positive32BitValueOf(sqInt oop);
 extern sqInt primitiveFail(void);
 extern sqInt primitiveFailFor(sqInt reasonCode);
 extern sqInt push(sqInt object);
@@ -839,9 +839,9 @@
 static void * loadBBFn;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"B2DPlugin VMMaker.oscog-eem.706 (i)"
+	"B2DPlugin VMMaker.oscog-eem.787 (i)"
 #else
-	"B2DPlugin VMMaker.oscog-eem.706 (e)"
+	"B2DPlugin VMMaker.oscog-eem.787 (e)"
 #endif
 ;
 static int* objBuffer;
@@ -1096,7 +1096,7 @@
 	yEntry = objBuffer[line + GLWideEntry];
 	yExit = objBuffer[line + GLWideExit];
 	baseWidth = objBuffer[line + GLWideExtent];
-	lineOffset = ((sqInt) baseWidth >> 1);
+	lineOffset = baseWidth / 2;
 	lineWidth = objBuffer[line + GLWideWidth];
 	xDir = objBuffer[line + GLXDirection];
 
@@ -2165,18 +2165,18 @@
 	/* Compute intermediate points */
 
 	endY = workBuffer[(workBuffer[GWBufferTop]) + ((((workBuffer[GWSize]) - (workBuffer[GWBufferTop])) - index) + 5)];
-	leftViaX += ((sqInt) (viaX - startX) >> 1);
-	leftViaY += ((sqInt) (viaY - startY) >> 1);
-	sharedX = (rightViaX += ((sqInt) (endX - viaX) >> 1));
+	leftViaX += (viaX - startX) / 2;
+	leftViaY += (viaY - startY) / 2;
+	sharedX = (rightViaX += (endX - viaX) / 2);
 
 	/* Compute new shared point */
 
-	sharedY = (rightViaY += ((sqInt) (endY - viaY) >> 1));
-	sharedX += ((sqInt) (leftViaX - rightViaX) >> 1);
+	sharedY = (rightViaY += (endY - viaY) / 2);
+	sharedX += (leftViaX - rightViaX) / 2;
 
 	/* Store the first part back */
 
-	sharedY += ((sqInt) (leftViaY - rightViaY) >> 1);
+	sharedY += (leftViaY - rightViaY) / 2;
 	workBuffer[(workBuffer[GWBufferTop]) + ((((workBuffer[GWSize]) - (workBuffer[GWBufferTop])) - index) + 2)] = leftViaX;
 	workBuffer[(workBuffer[GWBufferTop]) + ((((workBuffer[GWSize]) - (workBuffer[GWBufferTop])) - index) + 3)] = leftViaY;
 	workBuffer[(workBuffer[GWBufferTop]) + ((((workBuffer[GWSize]) - (workBuffer[GWBufferTop])) - index) + 4)] = sharedX;
@@ -2317,8 +2317,8 @@
     sqInt rightX;
     sqInt temp;
 
-	leftX = ((sqInt) ((bezierUpdateDataOf(bezier))[GBUpdateX]) >> 8);
-	rightX = ((sqInt) ((wideBezierUpdateDataOf(bezier))[GBUpdateX]) >> 8);
+	leftX = ((bezierUpdateDataOf(bezier))[GBUpdateX]) / 256;
+	rightX = ((wideBezierUpdateDataOf(bezier))[GBUpdateX]) / 256;
 	if (leftX > rightX) {
 		temp = leftX;
 		leftX = rightX;
@@ -2695,10 +2695,10 @@
 		absDy = 0 - deltaY;
 	}
 	if (absDx > absDy) {
-		return absDx + (((sqInt) absDy >> 1));
+		return absDx + (absDy / 2);
 	}
 	else {
-		return absDy + (((sqInt) absDx >> 1));
+		return absDy + (absDx / 2);
 	}
 }
 
@@ -2915,8 +2915,8 @@
 			}
 			dt = newDelta1;
 		}
-		xp = ((sqInt) ds >> 16);
-		yp = ((sqInt) dt >> 16);
+		xp = ds / 65536;
+		yp = dt / 65536;
 		if (!tileFlag) {
 			/* begin clampValue:max: */
 			if (xp < 0) {
@@ -3039,8 +3039,8 @@
 			}
 			dt = newDelta3;
 		}
-		xp = ((sqInt) ds >> 16);
-		yp = ((sqInt) dt >> 16);
+		xp = ds / 65536;
+		yp = dt / 65536;
 		if (!tileFlag) {
 			/* begin clampValue:max: */
 			if (xp < 0) {
@@ -3163,8 +3163,8 @@
 			}
 			dt = newDelta5;
 		}
-		xp = ((sqInt) ds >> 16);
-		yp = ((sqInt) dt >> 16);
+		xp = ds / 65536;
+		yp = dt / 65536;
 		if (!tileFlag) {
 			/* begin clampValue:max: */
 			if (xp < 0) {
@@ -3395,8 +3395,8 @@
 			}
 			dt = newDelta1;
 		}
-		xp = ((sqInt) ds >> 16);
-		yp = ((sqInt) dt >> 16);
+		xp = ds / 65536;
+		yp = dt / 65536;
 		if (!tileFlag) {
 			/* begin clampValue:max: */
 			if (xp < 0) {
@@ -3655,7 +3655,7 @@
 	rampSize = objBuffer[fill + GFRampLength];
 	ds = deltaS;
 	x = leftX;
-	rampIndex = ((sqInt) ds >> 16);
+	rampIndex = ds / 65536;
 	/* begin aaFirstPixelFrom:to: */
 	firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & (~((workBuffer[GWAALevel]) - 1));
 	if (firstPixel1 > rightX) {
@@ -3682,13 +3682,13 @@
 
 		rampValue = ((usqInt) (rampValue & colorMask)) >> colorShift;
 		while ((x < firstPixel)
-		 && ((((sqInt) ds >> 16)) == rampIndex)) {
+		 && ((ds / 65536) == rampIndex)) {
 			idx = ((usqInt) x) >> baseShift;
 			spanBuffer[idx] = ((spanBuffer[idx]) + rampValue);
 			x += 1;
 			ds += dsX;
 		}
-		rampIndex = ((sqInt) ds >> 16);
+		rampIndex = ds / 65536;
 	}
 	colorMask = (((usqInt) (workBuffer[GWAAColorMask])) >> (workBuffer[GWAAShift])) | 4042322160UL;
 	colorShift = workBuffer[GWAAShift];
@@ -3701,13 +3701,13 @@
 
 		rampValue = ((usqInt) (rampValue & colorMask)) >> colorShift;
 		while ((x < lastPixel)
-		 && ((((sqInt) ds >> 16)) == rampIndex)) {
+		 && ((ds / 65536) == rampIndex)) {
 			idx = ((usqInt) x) >> baseShift;
 			spanBuffer[idx] = ((spanBuffer[idx]) + rampValue);
 			x += aaLevel;
 			ds += dsX << colorShift;
 		}
-		rampIndex = ((sqInt) ds >> 16);
+		rampIndex = ds / 65536;
 	}
 	colorMask = workBuffer[GWAAColorMask];
 	colorShift = workBuffer[GWAAColorShift];
@@ -3720,13 +3720,13 @@
 
 		rampValue = ((usqInt) (rampValue & colorMask)) >> colorShift;
 		while ((x < rightX)
-		 && ((((sqInt) ds >> 16)) == rampIndex)) {
+		 && ((ds / 65536) == rampIndex)) {
 			idx = ((usqInt) x) >> baseShift;
 			spanBuffer[idx] = ((spanBuffer[idx]) + rampValue);
 			x += 1;
 			ds += dsX;
 		}
-		rampIndex = ((sqInt) ds >> 16);
+		rampIndex = ds / 65536;
 	}
 	return x;
 }
@@ -3761,7 +3761,7 @@
 	/* Part one: Fill everything outside the left boundary */
 
 	x1 = rightX;
-	while (((((rampIndex = ((sqInt) ds >> 16))) < 0)
+	while (((((rampIndex = ds / 65536)) < 0)
 	 || (rampIndex >= rampSize))
 	 && (x < x1)) {
 		x += 1;
@@ -3801,7 +3801,7 @@
 
 		/* Fast version w/o anti-aliasing */
 
-		while (((((rampIndex = ((sqInt) ds >> 16))) < rampSize)
+		while (((((rampIndex = ds / 65536)) < rampSize)
 		 && (rampIndex >= 0))
 		 && (x < x1)) {
 			spanBuffer[x] = (ramp[rampIndex]);
@@ -3991,7 +3991,7 @@
 	dt = (((int*) deltaST))[1];
 	aaLevel = workBuffer[GWAALevel];
 	baseShift = workBuffer[GWAAShift];
-	rampIndex = accurateLengthOfwith(((sqInt) ds >> 16), ((sqInt) dt >> 16));
+	rampIndex = accurateLengthOfwith(ds / 65536, dt / 65536);
 	length2 = (rampIndex - 1) * (rampIndex - 1);
 	x = leftX;
 	x1 = objBuffer[fill + GFOriginX];
@@ -4023,14 +4023,14 @@
 			/* Try to copy the current value more than just once */
 
 			while ((x < firstPixel)
-			 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) >= length2)) {
+			 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) >= length2)) {
 				index = ((usqInt) x) >> baseShift;
 				spanBuffer[index] = ((spanBuffer[index]) + rampValue);
 				x += 1;
 				ds += dsX;
 				dt += dtX;
 			}
-			nextLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+			nextLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 			while (nextLength < length2) {
 				rampIndex -= 1;
 				rampValue = (((int *) ramp))[rampIndex];
@@ -4049,14 +4049,14 @@
 			/* Try to copy the current value more than just once */
 
 			while ((x < lastPixel)
-			 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) >= length2)) {
+			 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) >= length2)) {
 				index = ((usqInt) x) >> baseShift;
 				spanBuffer[index] = ((spanBuffer[index]) + rampValue);
 				x += aaLevel;
 				ds += dsX << colorShift;
 				dt += dtX << colorShift;
 			}
-			nextLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+			nextLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 			while (nextLength < length2) {
 				rampIndex -= 1;
 				rampValue = (((int *) ramp))[rampIndex];
@@ -4075,14 +4075,14 @@
 			/* Try to copy the current value more than just once */
 
 			while ((x < x1)
-			 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) >= length2)) {
+			 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) >= length2)) {
 				index = ((usqInt) x) >> baseShift;
 				spanBuffer[index] = ((spanBuffer[index]) + rampValue);
 				x += 1;
 				ds += dsX;
 				dt += dtX;
 			}
-			nextLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+			nextLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 			while (nextLength < length2) {
 				rampIndex -= 1;
 				rampValue = (((int *) ramp))[rampIndex];
@@ -4113,7 +4113,7 @@
 
 	ds = (((int*) deltaST))[0];
 	dt = (((int*) deltaST))[1];
-	rampIndex = accurateLengthOfwith(((sqInt) ds >> 16), ((sqInt) dt >> 16));
+	rampIndex = accurateLengthOfwith(ds / 65536, dt / 65536);
 	rampValue = (((int *) ramp))[rampIndex];
 	length2 = (rampIndex - 1) * (rampIndex - 1);
 	x = leftX;
@@ -4126,13 +4126,13 @@
 		/* Try to copy the current value more than just once */
 
 		while ((x < x1)
-		 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) >= length2)) {
+		 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) >= length2)) {
 			spanBuffer[x] = rampValue;
 			x += 1;
 			ds += dsX;
 			dt += dtX;
 		}
-		nextLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+		nextLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 		while (nextLength < length2) {
 			rampIndex -= 1;
 			rampValue = (((int *) ramp))[rampIndex];
@@ -4210,7 +4210,7 @@
 	/* This is the upper bound */
 
 	length2 = (rampSize - 1) * (rampSize - 1);
-	while (((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) >= length2)
+	while (((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) >= length2)
 	 && (x < x1)) {
 		x += 1;
 		ds += dsX;
@@ -4252,7 +4252,7 @@
 			/* begin fillRadialDecreasing:ramp:deltaST:dsX:dtX:from:to: */
 			ds1 = (((int*) deltaST))[0];
 			dt1 = (((int*) deltaST))[1];
-			rampIndex = accurateLengthOfwith(((sqInt) ds1 >> 16), ((sqInt) dt1 >> 16));
+			rampIndex = accurateLengthOfwith(ds1 / 65536, dt1 / 65536);
 			rampValue = (((int *) ramp))[rampIndex];
 			length21 = (rampIndex - 1) * (rampIndex - 1);
 			x2 = x;
@@ -4265,13 +4265,13 @@
 				/* Try to copy the current value more than just once */
 
 				while ((x2 < x12)
-				 && ((((((sqInt) ds1 >> 16)) * (((sqInt) ds1 >> 16))) + ((((sqInt) dt1 >> 16)) * (((sqInt) dt1 >> 16)))) >= length21)) {
+				 && ((((ds1 / 65536) * (ds1 / 65536)) + ((dt1 / 65536) * (dt1 / 65536))) >= length21)) {
 					spanBuffer[x2] = rampValue;
 					x2 += 1;
 					ds1 += dsX;
 					dt1 += dtX;
 				}
-				nextLength = ((((sqInt) ds1 >> 16)) * (((sqInt) ds1 >> 16))) + ((((sqInt) dt1 >> 16)) * (((sqInt) dt1 >> 16)));
+				nextLength = ((ds1 / 65536) * (ds1 / 65536)) + ((dt1 / 65536) * (dt1 / 65536));
 				while (nextLength < length21) {
 					rampIndex -= 1;
 					rampValue = (((int *) ramp))[rampIndex];
@@ -4294,7 +4294,7 @@
 			/* begin fillRadialIncreasing:ramp:deltaST:dsX:dtX:from:to: */
 			ds2 = (((int*) deltaST))[0];
 			dt2 = (((int*) deltaST))[1];
-			rampIndex1 = accurateLengthOfwith(((sqInt) ds2 >> 16), ((sqInt) dt2 >> 16));
+			rampIndex1 = accurateLengthOfwith(ds2 / 65536, dt2 / 65536);
 			rampValue1 = (((int *) ramp))[rampIndex1];
 			rampSize1 = objBuffer[fill + GFRampLength];
 
@@ -4302,7 +4302,7 @@
 
 			length22 = (rampSize1 - 1) * (rampSize1 - 1);
 			nextLength1 = (rampIndex1 + 1) * (rampIndex1 + 1);
-			lastLength = ((((sqInt) ds2 >> 16)) * (((sqInt) ds2 >> 16))) + ((((sqInt) dt2 >> 16)) * (((sqInt) dt2 >> 16)));
+			lastLength = ((ds2 / 65536) * (ds2 / 65536)) + ((dt2 / 65536) * (dt2 / 65536));
 			x3 = x;
 			x14 = x1;
 			while ((x3 < x14)
@@ -4311,13 +4311,13 @@
 				/* Try to copy the current value more than once */
 
 				while ((x3 < x14)
-				 && ((((((sqInt) ds2 >> 16)) * (((sqInt) ds2 >> 16))) + ((((sqInt) dt2 >> 16)) * (((sqInt) dt2 >> 16)))) <= nextLength1)) {
+				 && ((((ds2 / 65536) * (ds2 / 65536)) + ((dt2 / 65536) * (dt2 / 65536))) <= nextLength1)) {
 					spanBuffer[x3] = rampValue1;
 					x3 += 1;
 					ds2 += dsX;
 					dt2 += dtX;
 				}
-				lastLength = ((((sqInt) ds2 >> 16)) * (((sqInt) ds2 >> 16))) + ((((sqInt) dt2 >> 16)) * (((sqInt) dt2 >> 16)));
+				lastLength = ((ds2 / 65536) * (ds2 / 65536)) + ((dt2 / 65536) * (dt2 / 65536));
 				while (lastLength > nextLength1) {
 					rampIndex1 += 1;
 					rampValue1 = (((int *) ramp))[rampIndex1];
@@ -4386,14 +4386,14 @@
 	dt = (((int*) deltaST))[1];
 	aaLevel = workBuffer[GWAALevel];
 	baseShift = workBuffer[GWAAShift];
-	rampIndex = accurateLengthOfwith(((sqInt) ds >> 16), ((sqInt) dt >> 16));
+	rampIndex = accurateLengthOfwith(ds / 65536, dt / 65536);
 	rampSize = objBuffer[fill + GFRampLength];
 
 	/* This is the upper bound */
 
 	length2 = (rampSize - 1) * (rampSize - 1);
 	nextLength = (rampIndex + 1) * (rampIndex + 1);
-	lastLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+	lastLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 	x = leftX;
 	/* begin aaFirstPixelFrom:to: */
 	firstPixel1 = ((leftX + (workBuffer[GWAALevel])) - 1) & (~((workBuffer[GWAALevel]) - 1));
@@ -4422,14 +4422,14 @@
 			/* Try to copy the current value more than once */
 
 			while ((x < firstPixel)
-			 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) <= nextLength)) {
+			 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) <= nextLength)) {
 				index = ((usqInt) x) >> baseShift;
 				spanBuffer[index] = ((spanBuffer[index]) + rampValue);
 				x += 1;
 				ds += dsX;
 				dt += dtX;
 			}
-			lastLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+			lastLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 			while (lastLength > nextLength) {
 				rampIndex += 1;
 				rampValue = (((int *) ramp))[rampIndex];
@@ -4450,14 +4450,14 @@
 			/* Try to copy the current value more than once */
 
 			while ((x < lastPixel)
-			 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) <= nextLength)) {
+			 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) <= nextLength)) {
 				index = ((usqInt) x) >> baseShift;
 				spanBuffer[index] = ((spanBuffer[index]) + rampValue);
 				x += aaLevel;
 				ds += dsX << colorShift;
 				dt += dtX << colorShift;
 			}
-			lastLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+			lastLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 			while (lastLength > nextLength) {
 				rampIndex += 1;
 				rampValue = (((int *) ramp))[rampIndex];
@@ -4478,14 +4478,14 @@
 			/* Try to copy the current value more than once */
 
 			while ((x < rightX)
-			 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) <= nextLength)) {
+			 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) <= nextLength)) {
 				index = ((usqInt) x) >> baseShift;
 				spanBuffer[index] = ((spanBuffer[index]) + rampValue);
 				x += 1;
 				ds += dsX;
 				dt += dtX;
 			}
-			lastLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+			lastLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 			while (lastLength > nextLength) {
 				rampIndex += 1;
 				rampValue = (((int *) ramp))[rampIndex];
@@ -4518,7 +4518,7 @@
 
 	ds = (((int*) deltaST))[0];
 	dt = (((int*) deltaST))[1];
-	rampIndex = accurateLengthOfwith(((sqInt) ds >> 16), ((sqInt) dt >> 16));
+	rampIndex = accurateLengthOfwith(ds / 65536, dt / 65536);
 	rampValue = (((int *) ramp))[rampIndex];
 	rampSize = objBuffer[fill + GFRampLength];
 
@@ -4526,7 +4526,7 @@
 
 	length2 = (rampSize - 1) * (rampSize - 1);
 	nextLength = (rampIndex + 1) * (rampIndex + 1);
-	lastLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+	lastLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 	x = leftX;
 	x1 = rightX;
 	while ((x < x1)
@@ -4535,13 +4535,13 @@
 		/* Try to copy the current value more than once */
 
 		while ((x < x1)
-		 && ((((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)))) <= nextLength)) {
+		 && ((((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536))) <= nextLength)) {
 			spanBuffer[x] = rampValue;
 			x += 1;
 			ds += dsX;
 			dt += dtX;
 		}
-		lastLength = ((((sqInt) ds >> 16)) * (((sqInt) ds >> 16))) + ((((sqInt) dt >> 16)) * (((sqInt) dt >> 16)));
+		lastLength = ((ds / 65536) * (ds / 65536)) + ((dt / 65536) * (dt / 65536));
 		while (lastLength > nextLength) {
 			rampIndex += 1;
 			rampValue = (((int *) ramp))[rampIndex];
@@ -7342,8 +7342,8 @@
 	   and not yet the control point (which is OFF the curve) */
 
 	y1 = ((sqInt)((((circleSinTable())[(seg * 2) + 1]) * (((double) h ))) + cy));
-	x1 = (x1 * 2) - (((sqInt) (x0 + x2) >> 1));
-	y1 = (y1 * 2) - (((sqInt) (y0 + y2) >> 1));
+	x1 = (x1 * 2) - ((x0 + x2) / 2);
+	y1 = (y1 * 2) - ((y0 + y2) / 2);
 	(point2Get())[0] = x1;
 	(point2Get())[1] = y1;
 }
@@ -7377,10 +7377,10 @@
     sqInt y2;
     sqInt y3;
 
-	w = ((sqInt) (((point2Get())[0]) - ((point1Get())[0])) >> 1);
-	h = ((sqInt) (((point2Get())[1]) - ((point1Get())[1])) >> 1);
-	cx = ((sqInt) (((point2Get())[0]) + ((point1Get())[0])) >> 1);
-	cy = ((sqInt) (((point2Get())[1]) + ((point1Get())[1])) >> 1);
+	w = (((point2Get())[0]) - ((point1Get())[0])) / 2;
+	h = (((point2Get())[1]) - ((point1Get())[1])) / 2;
+	cx = (((point2Get())[0]) + ((point1Get())[0])) / 2;
+	cy = (((point2Get())[1]) + ((point1Get())[1])) / 2;
 	for (i = 0; i <= 15; i += 1) {
 		loadOvalSegmentwhcxcy(i, w, h, cx, cy);
 		/* begin transformPoints: */
@@ -8161,7 +8161,7 @@
 	}
 	else {
 		wide = 1;
-		offset = ((sqInt) lineWidth >> 1);
+		offset = lineWidth / 2;
 	}
 	index = nSegments * 6;
 	while (index > 0) {
@@ -8251,7 +8251,7 @@
 		objBuffer[line2 + GEObjectLength] = GLWideSize;
 		line = line2;
 	l2:	/* end allocateWideLine */;
-		offset = ((sqInt) lineWidth >> 1);
+		offset = lineWidth / 2;
 	}
 	if (engineStopped) {
 		return 0;
@@ -8521,7 +8521,7 @@
 static sqInt
 offsetFromWidth(sqInt lineWidth)
 {
-	return ((sqInt) lineWidth >> 1);
+	return lineWidth / 2;
 }
 
 static int *
@@ -11540,7 +11540,7 @@
 
 	/* ij is the midpoint of i and j. */
 
-	ij = ((sqInt) (i + j) >> 1);
+	ij = (i + j) / 2;
 
 	/* Sort di,dij,dj.  Make dij be their median. */
 
@@ -12089,13 +12089,13 @@
 	squaredStepSize = ((usqInt) (((((usqInt) (((unsigned) (word1 * word1))) >> 16)) + ((word1 * word2) * 2)) + (((usqInt) (word2 * word2) << 16))) >> 8);
 	fwDx = fwX1 * scaledStepSize;
 	fwDDx = (fwX2 * squaredStepSize) * 2;
-	fwDx += ((sqInt) fwDDx >> 1);
+	fwDx += fwDDx / 2;
 	fwDy = fwY1 * scaledStepSize;
 	fwDDy = (fwY2 * squaredStepSize) * 2;
 
 	/* Store the values */
 
-	fwDy += ((sqInt) fwDDy >> 1);
+	fwDy += fwDDy / 2;
 	objBuffer[bezier + GENumLines] = deltaY;
 	/* begin bezierUpdateDataOf: */
 	updateData = (objBuffer + bezier) + GBUpdateData;
@@ -12123,8 +12123,8 @@
 		minY = yValue * 256;
 		while ((minY > lastY)
 		 && (fwDy1 >= 0)) {
-			lastX += ((sqInt) (fwDx1 + 32768) >> 16);
-			lastY += ((sqInt) (fwDy1 + 32768) >> 16);
+			lastX += (fwDx1 + 32768) / 65536;
+			lastY += (fwDy1 + 32768) / 65536;
 			fwDx1 += (((int*) updateData1))[GBUpdateDDX];
 			fwDy1 += (((int*) updateData1))[GBUpdateDDY];
 		}
@@ -12132,7 +12132,7 @@
 		(((int*) updateData1))[GBUpdateY] = lastY;
 		(((int*) updateData1))[GBUpdateDX] = fwDx1;
 		(((int*) updateData1))[GBUpdateDY] = fwDy1;
-		xValue = ((sqInt) lastX >> 8);
+		xValue = lastX / 256;
 		objBuffer[bezier + GEXValue] = xValue;
 		objBuffer[bezier + GENumLines] = (deltaY - (yValue - startY));
 	}
@@ -12272,7 +12272,7 @@
 
 	/* Compute the incremental values of the bezier */
 
-	lineOffset = ((sqInt) lineWidth >> 1);
+	lineOffset = lineWidth / 2;
 	endX = objBuffer[bezier + GBEndX];
 	startY = objBuffer[bezier + GEYValue];
 	stepToFirstBezierInat(bezier, startY);
@@ -12374,7 +12374,7 @@
 
 	/* Compute the incremental values of the line */
 
-	lineOffset = ((sqInt) lineWidth >> 1);
+	lineOffset = lineWidth / 2;
 	startX = objBuffer[line + GEXValue];
 	startY = objBuffer[line + GEYValue];
 	stepToFirstLineInat(line, startY);
@@ -12417,7 +12417,7 @@
 			objBuffer[line + GLWideEntry] = yEntry1;
 			objBuffer[line + GLWideExit] = yExit1;
 			lineWidth1 = objBuffer[line + GLWideExtent];
-			lineOffset1 = ((sqInt) lineWidth1 >> 1);
+			lineOffset1 = lineWidth1 / 2;
 			if (yEntry1 >= lineOffset1) {
 				objBuffer[line + GEObjectType] = (((objBuffer[line + GEObjectType]) & GEPrimitiveTypeMask) & (~GEEdgeFillsInvalid));
 			}
@@ -12481,8 +12481,8 @@
 	minY = (workBuffer[GWCurrentY]) * 256;
 	while ((minY > lastY)
 	 && (fwDy >= 0)) {
-		lastX += ((sqInt) (fwDx + 32768) >> 16);
-		lastY += ((sqInt) (fwDy + 32768) >> 16);
+		lastX += (fwDx + 32768) / 65536;
+		lastY += (fwDy + 32768) / 65536;
 		fwDx += (((int*) updateData))[GBUpdateDDX];
 		fwDy += (((int*) updateData))[GBUpdateDDY];
 	}
@@ -12490,7 +12490,7 @@
 	(((int*) updateData))[GBUpdateY] = lastY;
 	(((int*) updateData))[GBUpdateDX] = fwDx;
 	(((int*) updateData))[GBUpdateDY] = fwDy;
-	xValue = ((sqInt) lastX >> 8);
+	xValue = lastX / 256;
 	objBuffer[(aetBuffer[workBuffer[GWAETStart]]) + GEXValue] = xValue;
 	return null;
 }
@@ -12522,8 +12522,8 @@
 	minY = yValue * 256;
 	while ((minY > lastY)
 	 && (fwDy >= 0)) {
-		lastX += ((sqInt) (fwDx + 32768) >> 16);
-		lastY += ((sqInt) (fwDy + 32768) >> 16);
+		lastX += (fwDx + 32768) / 65536;
+		lastY += (fwDy + 32768) / 65536;
 		fwDx += (((int*) updateData))[GBUpdateDDX];
 		fwDy += (((int*) updateData))[GBUpdateDDY];
 	}
@@ -12531,7 +12531,7 @@
 	(((int*) updateData))[GBUpdateY] = lastY;
 	(((int*) updateData))[GBUpdateDX] = fwDx;
 	(((int*) updateData))[GBUpdateDY] = fwDy;
-	return ((sqInt) lastX >> 8);
+	return lastX / 256;
 }
 
 
@@ -12564,8 +12564,8 @@
 	minY = yValue * 256;
 	while ((minY > lastY)
 	 && (fwDy >= 0)) {
-		lastX += ((sqInt) (fwDx + 32768) >> 16);
-		lastY += ((sqInt) (fwDy + 32768) >> 16);
+		lastX += (fwDx + 32768) / 65536;
+		lastY += (fwDy + 32768) / 65536;
 		fwDx += (((int*) updateData))[GBUpdateDDX];
 		fwDy += (((int*) updateData))[GBUpdateDDY];
 	}
@@ -12573,7 +12573,7 @@
 	(((int*) updateData))[GBUpdateY] = lastY;
 	(((int*) updateData))[GBUpdateDX] = fwDx;
 	(((int*) updateData))[GBUpdateDY] = fwDy;
-	xValue = ((sqInt) lastX >> 8);
+	xValue = lastX / 256;
 	objBuffer[bezier + GEXValue] = xValue;
 }
 
@@ -12655,7 +12655,7 @@
 	/* Don't inline this */
 
 	lineWidth = objBuffer[bezier + GBWideExtent];
-	lineOffset = ((sqInt) lineWidth >> 1);
+	lineOffset = lineWidth / 2;
 	yEntry = (objBuffer[bezier + GBWideEntry]) + 1;
 	yExit = (objBuffer[bezier + GBWideExit]) + 1;
 	objBuffer[bezier + GBWideEntry] = yEntry;
@@ -12683,8 +12683,8 @@
 		minY = yValue * 256;
 		while ((minY > lastY)
 		 && (fwDy >= 0)) {
-			lastX += ((sqInt) (fwDx + 32768) >> 16);
-			lastY += ((sqInt) (fwDy + 32768) >> 16);
+			lastX += (fwDx + 32768) / 65536;
+			lastY += (fwDy + 32768) / 65536;
 			fwDx += (((int*) updateData))[GBUpdateDDX];
 			fwDy += (((int*) updateData))[GBUpdateDDY];
 		}
@@ -12692,7 +12692,7 @@
 		(((int*) updateData))[GBUpdateY] = lastY;
 		(((int*) updateData))[GBUpdateDX] = fwDx;
 		(((int*) updateData))[GBUpdateDY] = fwDy;
-		((sqInt) lastX >> 8);
+		lastX / 256;
 	}
 	else {
 
@@ -12716,8 +12716,8 @@
 	minY1 = yValue * 256;
 	while ((minY1 > lastY1)
 	 && (fwDy1 >= 0)) {
-		lastX1 += ((sqInt) (fwDx1 + 32768) >> 16);
-		lastY1 += ((sqInt) (fwDy1 + 32768) >> 16);
+		lastX1 += (fwDx1 + 32768) / 65536;
+		lastY1 += (fwDy1 + 32768) / 65536;
 		fwDx1 += (((int*) updateData1))[GBUpdateDDX];
 		fwDy1 += (((int*) updateData1))[GBUpdateDDY];
 	}
@@ -12725,7 +12725,7 @@
 	(((int*) updateData1))[GBUpdateY] = lastY1;
 	(((int*) updateData1))[GBUpdateDX] = fwDx1;
 	(((int*) updateData1))[GBUpdateDY] = fwDy1;
-	((sqInt) lastX1 >> 8);
+	lastX1 / 256;
 	computeFinalWideBezierValueswidth(bezier, lineWidth);
 }
 
@@ -12750,7 +12750,7 @@
 	objBuffer[(aetBuffer[workBuffer[GWAETStart]]) + GLWideEntry] = yEntry;
 	objBuffer[(aetBuffer[workBuffer[GWAETStart]]) + GLWideExit] = yExit;
 	lineWidth = objBuffer[(aetBuffer[workBuffer[GWAETStart]]) + GLWideExtent];
-	lineOffset = ((sqInt) lineWidth >> 1);
+	lineOffset = lineWidth / 2;
 	if (yEntry >= lineOffset) {
 		objBuffer[(aetBuffer[workBuffer[GWAETStart]]) + GEObjectType] = (((objBuffer[(aetBuffer[workBuffer[GWAETStart]]) + GEObjectType]) & GEPrimitiveTypeMask) & (~GEEdgeFillsInvalid));
 	}
@@ -12804,7 +12804,7 @@
 	objBuffer[line + GLWideEntry] = yEntry;
 	objBuffer[line + GLWideExit] = yExit;
 	lineWidth = objBuffer[line + GLWideExtent];
-	lineOffset = ((sqInt) lineWidth >> 1);
+	lineOffset = lineWidth / 2;
 	if (yEntry >= lineOffset) {
 		objBuffer[line + GEObjectType] = (((objBuffer[line + GEObjectType]) & GEPrimitiveTypeMask) & (~GEEdgeFillsInvalid));
 	}
@@ -13706,10 +13706,10 @@
 	}
 	deltaX = ((double) (((point2Get())[0]) - ((point1Get())[0])) );
 	deltaY = ((double) (((point2Get())[1]) - ((point1Get())[1])) );
-	dstWidth = ((sqInt) ((((sqInt)(sqrt((deltaX * deltaX) + (deltaY * deltaY))))) + 128) >> 8);
+	dstWidth = ((((sqInt)(sqrt((deltaX * deltaX) + (deltaY * deltaY))))) + 128) / 256;
 	deltaX = ((double) (((point3Get())[0]) - ((point1Get())[0])) );
 	deltaY = ((double) (((point3Get())[1]) - ((point1Get())[1])) );
-	dstWidth2 = ((sqInt) ((((sqInt)(sqrt((deltaX * deltaX) + (deltaY * deltaY))))) + 128) >> 8);
+	dstWidth2 = ((((sqInt)(sqrt((deltaX * deltaX) + (deltaY * deltaY))))) + 128) / 256;
 	if (dstWidth2 < dstWidth) {
 		dstWidth = dstWidth2;
 	}

Modified: branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.655 uuid: d6c00552-e909-49e0-a838-d6c3225dedda
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	BitBltSimulation VMMaker.oscog-eem.655 uuid: d6c00552-e909-49e0-a838-d6c3225dedda
+	BitBltSimulation VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
  */
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.655 uuid: d6c00552-e909-49e0-a838-d6c3225dedda " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
 
 
 
@@ -344,9 +344,9 @@
 };
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"BitBltPlugin VMMaker.oscog-eem.655 (i)"
+	"BitBltPlugin VMMaker.oscog-eem.787 (i)"
 #else
-	"BitBltPlugin VMMaker.oscog-eem.655 (e)"
+	"BitBltPlugin VMMaker.oscog-eem.787 (e)"
 #endif
 ;
 static sqInt noHalftone;
@@ -659,7 +659,7 @@
 	mask1 = 0xFFFF << (16 - srcShift);
 	while (((deltaY -= 1)) != 0) {
 		srcIndex = (sourceBits + (srcY * sourcePitch)) + (sx * 4);
-		dstIndex = (destBits + (dstY * destPitch)) + ((((sqInt) dx >> 1)) * 4);
+		dstIndex = (destBits + (dstY * destPitch)) + ((dx / 2) * 4);
 		ditherBase = (dstY & 3) * 4;
 
 		/* For pre-increment */
@@ -950,7 +950,7 @@
 	while (((deltaY -= 1)) != 0) {
 		adjust = adjust ^ 522133279;
 		srcIndex = (sourceBits + (srcY * sourcePitch)) + (sx * 4);
-		dstIndex = (destBits + (dstY * destPitch)) + ((((sqInt) dx >> 2)) * 4);
+		dstIndex = (destBits + (dstY * destPitch)) + ((dx / 4) * 4);
 
 		/* So we can pre-decrement */
 
@@ -2669,7 +2669,7 @@
 
 		/* more horizontal */
 
-		P = ((sqInt) py >> 1);
+		P = py / 2;
 		for (i = 1; i <= py; i += 1) {
 			destX += dx1;
 			if (((P -= px)) < 0) {
@@ -2714,7 +2714,7 @@
 
 		/* more vertical */
 
-		P = ((sqInt) px >> 1);
+		P = px / 2;
 		for (i = 1; i <= px; i += 1) {
 			destY += dy1;
 			if (((P -= py)) < 0) {
@@ -5025,7 +5025,7 @@
 	if (destPPW <= 2) {
 		return result;
 	}
-	for (i = 2; i <= (((sqInt) destPPW >> 1)); i += 1) {
+	for (i = 2; i <= (destPPW / 2); i += 1) {
 		lowMask = lowMask << destDepth;
 		highMask = ((usqInt) highMask) >> destDepth;
 		shift -= destDepth * 2;
@@ -5268,7 +5268,7 @@
 
 			/* more horizontal */
 
-			P = ((sqInt) py >> 1);
+			P = py / 2;
 			for (i = 1; i <= py; i += 1) {
 				destX += dx1;
 				if (((P -= px)) < 0) {
@@ -5314,7 +5314,7 @@
 
 			/* more vertical */
 
-			P = ((sqInt) px >> 1);
+			P = px / 2;
 			for (i = 1; i <= px; i += 1) {
 				destY += dy1;
 				if (((P -= py)) < 0) {
@@ -5708,7 +5708,7 @@
 	mask1 = 0xFFFF << (16 - srcShift);
 	while (((deltaY -= 1)) != 0) {
 		srcIndex = (sourceBits + (srcY * sourcePitch)) + (sx * 4);
-		dstIndex = (destBits + (dstY * destPitch)) + ((((sqInt) dx >> 1)) * 4);
+		dstIndex = (destBits + (dstY * destPitch)) + ((dx / 2) * 4);
 		ditherBase = (dstY & 3) * 4;
 
 		/* For pre-increment */
@@ -6070,7 +6070,7 @@
 	while (((deltaY -= 1)) != 0) {
 		adjust = adjust ^ 522133279;
 		srcIndex = (sourceBits + (srcY * sourcePitch)) + (sx * 4);
-		dstIndex = (destBits + (dstY * destPitch)) + ((((sqInt) dx >> 2)) * 4);
+		dstIndex = (destBits + (dstY * destPitch)) + ((dx / 4) * 4);
 
 		/* So we can pre-decrement */
 
@@ -7854,10 +7854,10 @@
 
 		/* Try avoiding divides for most common n (divide by 2 is generated as shift) */
 
-		xdh = ((sqInt) xDeltah >> 1);
-		ydh = ((sqInt) yDeltah >> 1);
-		xdv = ((sqInt) xDeltav >> 1);
-		ydv = ((sqInt) yDeltav >> 1);
+		xdh = xDeltah / 2;
+		ydh = yDeltah / 2;
+		xdv = xDeltav / 2;
+		ydv = yDeltav / 2;
 	}
 	else {
 		xdh = xDeltah / n;
@@ -7936,7 +7936,7 @@
 		} while(!(((j -= 1)) == 0));
 		if ((nPix == 0)
 		 || ((combinationRule == 25)
-		 && (nPix < (((sqInt) (n * n) >> 1))))) {
+		 && (nPix < ((n * n) / 2)))) {
 
 			/* All pixels were 0, or most were transparent */
 

Modified: branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701
+	VMPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	FilePlugin VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701
+	FilePlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
  */
-static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701 " __DATE__ ;
+static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
 
 
 
@@ -116,9 +116,9 @@
 static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
 static sqInt (*popRemappableOop)(void);
 static sqInt (*positive32BitIntegerFor)(sqInt integerValue);
-static sqInt (*positive32BitValueOf)(sqInt oop);
+static usqInt (*positive32BitValueOf)(sqInt oop);
 static sqInt (*positive64BitIntegerFor)(sqLong integerValue);
-static sqLong (*positive64BitValueOf)(sqInt oop);
+static usqLong (*positive64BitValueOf)(sqInt oop);
 static sqInt (*primitiveFail)(void);
 static sqInt (*primitiveFailFor)(sqInt reasonCode);
 static sqInt (*primitiveFailureCode)(void);
@@ -160,9 +160,9 @@
 extern sqInt popthenPush(sqInt nItems, sqInt oop);
 extern sqInt popRemappableOop(void);
 extern sqInt positive32BitIntegerFor(sqInt integerValue);
-extern sqInt positive32BitValueOf(sqInt oop);
+extern usqInt positive32BitValueOf(sqInt oop);
 extern sqInt positive64BitIntegerFor(sqLong integerValue);
-extern sqLong positive64BitValueOf(sqInt oop);
+extern usqLong positive64BitValueOf(sqInt oop);
 extern sqInt primitiveFail(void);
 extern sqInt primitiveFailFor(sqInt reasonCode);
 extern sqInt primitiveFailureCode(void);
@@ -180,9 +180,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FilePlugin VMMaker.oscog-eem.706 (i)"
+	"FilePlugin VMMaker.oscog-eem.787 (i)"
 #else
-	"FilePlugin VMMaker.oscog-eem.706 (e)"
+	"FilePlugin VMMaker.oscog-eem.787 (e)"
 #endif
 ;
 static void * sCCPfn;

Modified: branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c
===================================================================
--- branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	VMPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	NewsqueakIA32ABIPlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	NewsqueakIA32ABIPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
  */
-static char __buildInfo[] = "NewsqueakIA32ABIPlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514 " __DATE__ ;
+static char __buildInfo[] = "NewsqueakIA32ABIPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
 
 
 
@@ -153,9 +153,9 @@
 static sqInt (*pop)(sqInt nItems);
 static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
 static sqInt (*positive32BitIntegerFor)(sqInt integerValue);
-static sqInt (*positive32BitValueOf)(sqInt oop);
+static usqInt (*positive32BitValueOf)(sqInt oop);
 static sqInt (*positive64BitIntegerFor)(sqLong integerValue);
-static sqLong (*positive64BitValueOf)(sqInt oop);
+static usqLong (*positive64BitValueOf)(sqInt oop);
 static sqInt (*primitiveFailFor)(sqInt reasonCode);
 static sqInt (*pushFloat)(double  f);
 static sqInt (*returnAsThroughCallbackContext)(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
@@ -198,9 +198,9 @@
 extern sqInt pop(sqInt nItems);
 extern sqInt popthenPush(sqInt nItems, sqInt oop);
 extern sqInt positive32BitIntegerFor(sqInt integerValue);
-extern sqInt positive32BitValueOf(sqInt oop);
+extern usqInt positive32BitValueOf(sqInt oop);
 extern sqInt positive64BitIntegerFor(sqLong integerValue);
-extern sqLong positive64BitValueOf(sqInt oop);
+extern usqLong positive64BitValueOf(sqInt oop);
 extern sqInt primitiveFailFor(sqInt reasonCode);
 extern sqInt pushFloat(double  f);
 extern sqInt returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
@@ -220,9 +220,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"IA32ABI VMMaker.oscog-eem.580 (i)"
+	"IA32ABI VMMaker.oscog-eem.787 (i)"
 #else
-	"IA32ABI VMMaker.oscog-eem.580 (e)"
+	"IA32ABI VMMaker.oscog-eem.787 (e)"
 #endif
 ;
 

Modified: branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
+	VMPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	JPEGReaderPlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
+	JPEGReaderPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
  */
-static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
+static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
 
 
 
@@ -178,9 +178,9 @@
 static sqInt jsReadLimit;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReaderPlugin VMMaker.oscog-eem.597 (i)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.787 (i)"
 #else
-	"JPEGReaderPlugin VMMaker.oscog-eem.597 (e)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.787 (e)"
 #endif
 ;
 static int *residuals;
@@ -408,19 +408,19 @@
 		}
 		cr = sample2;
 		cr -= SampleOffset;
-		red = (y + (((sqInt) (FIXn1n40200 * cr) >> 16))) + (residuals[RedIndex]);
+		red = (y + ((FIXn1n40200 * cr) / 65536)) + (residuals[RedIndex]);
 		red = ((red < MaxSample) ? red : MaxSample);
 		red = ((red < 0) ? 0 : red);
 		residuals[RedIndex] = (red & ditherMask);
 		red = red & (MaxSample - ditherMask);
 		red = ((red < 1) ? 1 : red);
-		green = ((y - (((sqInt) (FIXn0n34414 * cb) >> 16))) - (((sqInt) (FIXn0n71414 * cr) >> 16))) + (residuals[GreenIndex]);
+		green = ((y - ((FIXn0n34414 * cb) / 65536)) - ((FIXn0n71414 * cr) / 65536)) + (residuals[GreenIndex]);
 		green = ((green < MaxSample) ? green : MaxSample);
 		green = ((green < 0) ? 0 : green);
 		residuals[GreenIndex] = (green & ditherMask);
 		green = green & (MaxSample - ditherMask);
 		green = ((green < 1) ? 1 : green);
-		blue = (y + (((sqInt) (FIXn1n77200 * cb) >> 16))) + (residuals[BlueIndex]);
+		blue = (y + ((FIXn1n77200 * cb) / 65536)) + (residuals[BlueIndex]);
 		blue = ((blue < MaxSample) ? blue : MaxSample);
 		blue = ((blue < 0) ? 0 : blue);
 		residuals[BlueIndex] = (blue & ditherMask);
@@ -758,14 +758,14 @@
 			t1 = (t1 + z2) + z4;
 			t2 = (t2 + z2) + z3;
 			t3 = (t3 + z1) + z4;
-			ws[i] = (((sqInt) (t10 + t3) >> 11));
-			ws[(DCTSize * 7) + i] = (((sqInt) (t10 - t3) >> 11));
-			ws[(DCTSize * 1) + i] = (((sqInt) (t11 + t2) >> 11));
-			ws[(DCTSize * 6) + i] = (((sqInt) (t11 - t2) >> 11));
-			ws[(DCTSize * 2) + i] = (((sqInt) (t12 + t1) >> 11));
-			ws[(DCTSize * 5) + i] = (((sqInt) (t12 - t1) >> 11));
-			ws[(DCTSize * 3) + i] = (((sqInt) (t13 + t0) >> 11));
-			ws[(DCTSize * 4) + i] = (((sqInt) (t13 - t0) >> 11));
+			ws[i] = ((t10 + t3) / Pass1Div);
+			ws[(DCTSize * 7) + i] = ((t10 - t3) / Pass1Div);
+			ws[(DCTSize * 1) + i] = ((t11 + t2) / Pass1Div);
+			ws[(DCTSize * 6) + i] = ((t11 - t2) / Pass1Div);
+			ws[(DCTSize * 2) + i] = ((t12 + t1) / Pass1Div);
+			ws[(DCTSize * 5) + i] = ((t12 - t1) / Pass1Div);
+			ws[(DCTSize * 3) + i] = ((t13 + t0) / Pass1Div);
+			ws[(DCTSize * 4) + i] = ((t13 - t0) / Pass1Div);
 		}
 	}
 	for (i = 0; i <= (DCTSize2 - DCTSize); i += DCTSize) {
@@ -803,35 +803,35 @@
 		t1 = (t1 + z2) + z4;
 		t2 = (t2 + z2) + z3;
 		t3 = (t3 + z1) + z4;
-		v = (((sqInt) (t10 + t3) >> 18)) + SampleOffset;
+		v = ((t10 + t3) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i] = v;
-		v = (((sqInt) (t10 - t3) >> 18)) + SampleOffset;
+		v = ((t10 - t3) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 7] = v;
-		v = (((sqInt) (t11 + t2) >> 18)) + SampleOffset;
+		v = ((t11 + t2) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 1] = v;
-		v = (((sqInt) (t11 - t2) >> 18)) + SampleOffset;
+		v = ((t11 - t2) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 6] = v;
-		v = (((sqInt) (t12 + t1) >> 18)) + SampleOffset;
+		v = ((t12 + t1) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 2] = v;
-		v = (((sqInt) (t12 - t1) >> 18)) + SampleOffset;
+		v = ((t12 - t1) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 5] = v;
-		v = (((sqInt) (t13 + t0) >> 18)) + SampleOffset;
+		v = ((t13 + t0) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 3] = v;
-		v = (((sqInt) (t13 - t0) >> 18)) + SampleOffset;
+		v = ((t13 - t0) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 4] = v;
@@ -1362,19 +1362,19 @@
 		}
 		cr = sample2;
 		cr -= SampleOffset;
-		red = (y + (((sqInt) (FIXn1n40200 * cr) >> 16))) + (residuals[RedIndex]);
+		red = (y + ((FIXn1n40200 * cr) / 65536)) + (residuals[RedIndex]);
 		red = ((red < MaxSample) ? red : MaxSample);
 		red = ((red < 0) ? 0 : red);
 		residuals[RedIndex] = (red & ditherMask);
 		red = red & (MaxSample - ditherMask);
 		red = ((red < 1) ? 1 : red);
-		green = ((y - (((sqInt) (FIXn0n34414 * cb) >> 16))) - (((sqInt) (FIXn0n71414 * cr) >> 16))) + (residuals[GreenIndex]);
+		green = ((y - ((FIXn0n34414 * cb) / 65536)) - ((FIXn0n71414 * cr) / 65536)) + (residuals[GreenIndex]);
 		green = ((green < MaxSample) ? green : MaxSample);
 		green = ((green < 0) ? 0 : green);
 		residuals[GreenIndex] = (green & ditherMask);
 		green = green & (MaxSample - ditherMask);
 		green = ((green < 1) ? 1 : green);
-		blue = (y + (((sqInt) (FIXn1n77200 * cb) >> 16))) + (residuals[BlueIndex]);
+		blue = (y + ((FIXn1n77200 * cb) / 65536)) + (residuals[BlueIndex]);
 		blue = ((blue < MaxSample) ? blue : MaxSample);
 		blue = ((blue < 0) ? 0 : blue);
 		residuals[BlueIndex] = (blue & ditherMask);
@@ -1719,14 +1719,14 @@
 			t1 = (t1 + z2) + z4;
 			t2 = (t2 + z2) + z3;
 			t3 = (t3 + z1) + z4;
-			ws[i] = (((sqInt) (t10 + t3) >> 11));
-			ws[(DCTSize * 7) + i] = (((sqInt) (t10 - t3) >> 11));
-			ws[(DCTSize * 1) + i] = (((sqInt) (t11 + t2) >> 11));
-			ws[(DCTSize * 6) + i] = (((sqInt) (t11 - t2) >> 11));
-			ws[(DCTSize * 2) + i] = (((sqInt) (t12 + t1) >> 11));
-			ws[(DCTSize * 5) + i] = (((sqInt) (t12 - t1) >> 11));
-			ws[(DCTSize * 3) + i] = (((sqInt) (t13 + t0) >> 11));
-			ws[(DCTSize * 4) + i] = (((sqInt) (t13 - t0) >> 11));
+			ws[i] = ((t10 + t3) / Pass1Div);
+			ws[(DCTSize * 7) + i] = ((t10 - t3) / Pass1Div);
+			ws[(DCTSize * 1) + i] = ((t11 + t2) / Pass1Div);
+			ws[(DCTSize * 6) + i] = ((t11 - t2) / Pass1Div);
+			ws[(DCTSize * 2) + i] = ((t12 + t1) / Pass1Div);
+			ws[(DCTSize * 5) + i] = ((t12 - t1) / Pass1Div);
+			ws[(DCTSize * 3) + i] = ((t13 + t0) / Pass1Div);
+			ws[(DCTSize * 4) + i] = ((t13 - t0) / Pass1Div);
 		}
 	}
 	for (i = 0; i <= (DCTSize2 - DCTSize); i += DCTSize) {
@@ -1764,35 +1764,35 @@
 		t1 = (t1 + z2) + z4;
 		t2 = (t2 + z2) + z3;
 		t3 = (t3 + z1) + z4;
-		v = (((sqInt) (t10 + t3) >> 18)) + SampleOffset;
+		v = ((t10 + t3) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i] = v;
-		v = (((sqInt) (t10 - t3) >> 18)) + SampleOffset;
+		v = ((t10 - t3) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 7] = v;
-		v = (((sqInt) (t11 + t2) >> 18)) + SampleOffset;
+		v = ((t11 + t2) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 1] = v;
-		v = (((sqInt) (t11 - t2) >> 18)) + SampleOffset;
+		v = ((t11 - t2) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 6] = v;
-		v = (((sqInt) (t12 + t1) >> 18)) + SampleOffset;
+		v = ((t12 + t1) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 2] = v;
-		v = (((sqInt) (t12 - t1) >> 18)) + SampleOffset;
+		v = ((t12 - t1) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 5] = v;
-		v = (((sqInt) (t13 + t0) >> 18)) + SampleOffset;
+		v = ((t13 + t0) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 3] = v;
-		v = (((sqInt) (t13 - t0) >> 18)) + SampleOffset;
+		v = ((t13 - t0) / Pass2Div) + SampleOffset;
 		v = ((v < MaxSample) ? v : MaxSample);
 		v = ((v < 0) ? 0 : v);
 		anArray[i + 4] = v;

Modified: branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c
===================================================================
--- branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	LargeIntegersPlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	LargeIntegersPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
  */
-static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514 " __DATE__ ;
+static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211 " __DATE__ ;
 
 
 
@@ -172,9 +172,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"LargeIntegers v1.5 VMMaker.oscog-eem.580 (i)"
+	"LargeIntegers v1.5 VMMaker.oscog-eem.787 (i)"
 #else
-	"LargeIntegers v1.5 VMMaker.oscog-eem.580 (e)"
+	"LargeIntegers v1.5 VMMaker.oscog-eem.787 (e)"
 #endif
 ;
 static const int  orOpIndex = 1;
@@ -208,8 +208,8 @@
 	if (start > stop) {
 		return 0;
 	}
-	firstByteIx = (((sqInt) (start - 1) >> 3)) + 1;
-	lastByteIx = (((sqInt) (stop - 1) >> 3)) + 1;
+	firstByteIx = ((start - 1) / 8) + 1;
+	lastByteIx = ((stop - 1) / 8) + 1;
 	rightShift = (start - 1) % 8;
 	leftShift = 7 - ((stop - 1) % 8);
 	if (firstByteIx == lastByteIx) {
@@ -341,14 +341,14 @@
 	if (((highBit = cBytesHighBitlen(firstIndexableField(aBytesOop), oldLen))) == 0) {
 		return integerObjectOf(0);
 	}
-	newLen = ((sqInt) ((highBit + shiftCount) + 7) >> 3);
+	newLen = ((highBit + shiftCount) + 7) / 8;
 	pushRemappableOop(aBytesOop);
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesOop), newLen);
 	aBytesOop = popRemappableOop();
 	/* begin cBytesLshift:from:len:to:len: */
 	pFrom = firstIndexableField(aBytesOop);
 	pTo = firstIndexableField(newBytes);
-	byteShift = ((sqInt) shiftCount >> 3);
+	byteShift = shiftCount / 8;
 	bitShift = shiftCount % 8;
 	if (bitShift == 0) {
 
@@ -584,7 +584,7 @@
 	sqInt lastIx;
 	sqInt limit;
 
-	byteShift = ((sqInt) shiftCount >> 3);
+	byteShift = shiftCount / 8;
 	bitShift = shiftCount % 8;
 	if (bitShift == 0) {
 
@@ -789,7 +789,7 @@
 
 			lo = (a + (pRem[l - 1])) - ((pDiv[i - 1]) * (q & 0xFF));
 			pRem[l - 1] = (lo & 0xFF);
-			a = (((sqInt) lo >> 8)) - hi;
+			a = (lo / 256) - hi;
 			l += 1;
 		}
 		if (a < 0) {
@@ -960,14 +960,14 @@
 	limit = smallLen - 1;
 	for (i = 0; i <= limit; i += 1) {
 		z = (z + (pByteLarge[i])) - (pByteSmall[i]);
-		pByteRes[i] = (z - ((((sqInt) z >> 8)) * 256));
-		z = ((sqInt) z >> 8);
+		pByteRes[i] = (z - ((z / 256) * 256));
+		z = z / 256;
 	}
 	limit = largeLen - 1;
 	for (i = smallLen; i <= limit; i += 1) {
 		z += pByteLarge[i];
-		pByteRes[i] = (z - ((((sqInt) z >> 8)) * 256));
-		z = ((sqInt) z >> 8);
+		pByteRes[i] = (z - ((z / 256) * 256));
+		z = z / 256;
 	}
 }
 
@@ -1023,8 +1023,8 @@
 		accum = 0;
 		for (i = 0; i <= limit3; i += 1) {
 			accum = (accum + (pBytesRes[i])) - (pBytesThird[i]);
-			pBytesRes[i] = (accum - ((((sqInt) accum >> 8)) * 256));
-			accum = ((sqInt) accum >> 8);
+			pBytesRes[i] = (accum - ((accum / 256) * 256));
+			accum = accum / 256;
 		}
 	}
 }
@@ -1567,7 +1567,7 @@
 
 			lo = (a + (pRem[l1 - 1])) - ((pDiv[i - 1]) * (q & 0xFF));
 			pRem[l1 - 1] = (lo & 0xFF);
-			a = (((sqInt) lo >> 8)) - hi;
+			a = (lo / 256) - hi;
 			l1 += 1;
 		}
 		if (a < 0) {
@@ -1707,8 +1707,8 @@
 		accum = 0;
 		for (i = 0; i <= limit3; i += 1) {
 			accum = (accum + (pBytesRes[i])) - (pBytesThird[i]);
-			pBytesRes[i] = (accum - ((((sqInt) accum >> 8)) * 256));
-			accum = ((sqInt) accum >> 8);
+			pBytesRes[i] = (accum - ((accum / 256) * 256));
+			accum = accum / 256;
 		}
 	}
 	return normalizePositive(prod);
@@ -1913,14 +1913,14 @@
 	limit = smallerLen - 1;
 	for (i = 0; i <= limit; i += 1) {
 		z = (z + (pByteLarge[i])) - (pByteSmall[i]);
-		pByteRes[i] = (z - ((((sqInt) z >> 8)) * 256));
-		z = ((sqInt) z >> 8);
+		pByteRes[i] = (z - ((z / 256) * 256));
+		z = z / 256;
 	}
 	limit = largerLen - 1;
 	for (i = smallerLen; i <= limit; i += 1) {
 		z += pByteLarge[i];
-		pByteRes[i] = (z - ((((sqInt) z >> 8)) * 256));
-		z = ((sqInt) z >> 8);
+		pByteRes[i] = (z - ((z / 256) * 256));
+		z = z / 256;
 	}
 	return (neg
 		? normalizeNegative(res)
@@ -3299,8 +3299,8 @@
 		accum = 0;
 		for (i = 0; i <= limit3; i += 1) {
 			accum = (accum + (pBytesRes[i])) - (pBytesThird[i]);
-			pBytesRes[i] = (accum - ((((sqInt) accum >> 8)) * 256));
-			accum = ((sqInt) accum >> 8);
+			pBytesRes[i] = (accum - ((accum / 256) * 256));
+			accum = accum / 256;
 		}
 	}
 	_return_value = normalizePositive(prod);

Modified: branches/Cog/nscogsrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c	2014-06-26 17:29:55 UTC (rev 3020)
+++ branches/Cog/nscogsrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c	2014-06-29 02:57:50 UTC (rev 3021)
@@ -1,16 +1,16 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701
+	VMPluginCodeGenerator VMMaker.oscog-eem.787 uuid: 4b38ebc1-339f-4523-a9fc-047923108211
    from
-	MiscPrimitivePlugin VMMaker.oscog-eem.706 uuid: 6eba60e7-a131-4353-870a-b34e8230b701
-	Bitmap Graphics-nice.289 uuid: e809bcbf-53e1-420b-846a-9e86e0dd1f06

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list