[Vm-dev] Float math in VMMaker-dtl.123

David T. Lewis lewis at mail.msen.com
Wed Jul 1 23:25:09 UTC 2009


On Wed, Jul 01, 2009 at 07:02:59PM +0200, Nicolas Cellier wrote:
> 
> 2009/7/1 David T. Lewis <lewis at mail.msen.com>:
> >
> > On Wed, Jul 01, 2009 at 08:32:18AM -0700, Andreas Raab wrote:
> >>
> >> Ouch. Yeah, I'd say that's right...
> >
> > This is from http://bugs.squeak.org/view.php?id=7260. I reopened the
> > issue on Mantis.
> >
> > I'll apply the fix to VMMaker as soon as I can (but feel free to do the
> > update if I don't get to it first; Bert you have developer access as well
> > as Andreas of course).
> >
> > Dave
> >
> 
> Ouch again, my fault.
> How can the tests pass... Hmm not enough test?
> 
> Nicolas

Patch attached, also added to Mantis 7260.

I updated SqueakSource with the two corrected methods (VMMaker-dtl.124).

I did the update rather hastily; please double check and make sure I got it right.

Dave

-------------- next part --------------
'From Squeak3.8.2a of ''26 Oct 2007'' [latest update: #6748] on 1 July 2009 at 7:08:49 pm'!
"Change Set:		M7260-bytecodePrimGreaterEqual-update-dtl
Date:			1 July 2009
Author:			David T. Lewis

One too many double negatives in the last patch. Reported by Bert and confirmed by Andreas and Nicolas, see http://lists.squeakfoundation.org/pipermail/vm-dev/2009-July/002780.html"!


!Interpreter methodsFor: 'common selector sends' stamp: 'dtl 7/1/2009 18:38'!
bytecodePrimGreaterOrEqual
	| rcvr arg aBool |
	rcvr := self internalStackValue: 1.
	arg := self internalStackValue: 0.
	(self areIntegers: rcvr and: arg) ifTrue:
		[self cCode: '' inSmalltalk: [^self booleanCheat: (self integerValueOf: rcvr) >= (self integerValueOf: arg)].
		^self booleanCheat: rcvr >= arg].

	successFlag := true.
	aBool := self primitiveFloatGreaterOrEqual: rcvr toArg: arg.
	successFlag ifTrue: [^self booleanCheat: aBool].

	messageSelector := self specialSelector: 5.
	argumentCount := 1.
	self normalSend! !

!Interpreter methodsFor: 'common selector sends' stamp: 'dtl 7/1/2009 18:39'!
bytecodePrimLessOrEqual
	| rcvr arg aBool |
	rcvr := self internalStackValue: 1.
	arg := self internalStackValue: 0.
	(self areIntegers: rcvr and: arg) ifTrue:
		[self cCode: '' inSmalltalk: [^self booleanCheat: (self integerValueOf: rcvr) <= (self integerValueOf: arg)].
		^ self booleanCheat: rcvr <= arg].

	successFlag := true.
	aBool := self primitiveFloatLessOrEqual: rcvr toArg: arg.
	successFlag ifTrue: [^self booleanCheat: aBool].

	messageSelector := self specialSelector: 4.
	argumentCount := 1.
	self normalSend! !



More information about the Vm-dev mailing list