[Vm-dev] VM Maker: VMMaker.oscog-eem.1872.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu May 26 19:26:04 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1872.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1872
Author: eem
Time: 26 May 2016, 12:24:21.998252 pm
UUID: 6db6d610-b1a5-4f4d-978d-22c917bdb3e4
Ancestors: VMMaker.oscog-eem.1871
damn; fgix a slip in the last commit
=============== Diff against VMMaker.oscog-eem.1871 ===============
Item was changed:
----- Method: FloatArrayPlugin>>primitiveLength (in category 'arithmetic primitives') -----
primitiveLength
"Primitive. Compute the length of the argument (sqrt of sum of component squares)."
<export: true>
| rcvr rcvrPtr length len |
<var: #rcvrPtr type: #'float *'>
<var: #len type: #double>
rcvr := interpreterProxy stackValue: 0.
(interpreterProxy isWords: rcvr) ifFalse:
[interpreterProxy primitiveFailFor: PrimErrBadReceiver].
length := interpreterProxy stSizeOf: rcvr.
+ rcvrPtr := self cCoerce: (interpreterProxy firstIndexableField: rcvr) to: #'float *'.
- rcvrPtr := self cCoerce: (interpreterProxy firstIndexableField: rcvr) to: 'float *'.
len := 0.0.
0 to: length-1 do:[:i|
len := len + ((self cCoerce: (rcvrPtr at: i) to: #double) * (self cCoerce: (rcvrPtr at: i) to: #double)).
].
len > 0.0 ifFalse:
[interpreterProxy primitiveFailFor: PrimErrBadReceiver].
interpreterProxy pop: 1 thenPush: (interpreterProxy floatObjectOf: (self sqrt: len))!
Item was changed:
----- Method: FloatArrayPlugin>>primitiveNormalize (in category 'arithmetic primitives') -----
primitiveNormalize
"Primitive. Normalize the argument (A FloatArray) in place."
<export: true>
| rcvr rcvrPtr length len |
<var: #rcvrPtr type: #'float *'>
<var: #len type: #double>
rcvr := interpreterProxy stackValue: 0.
(interpreterProxy isWords: rcvr) ifFalse:
[interpreterProxy primitiveFailFor: PrimErrBadReceiver].
length := interpreterProxy stSizeOf: rcvr.
+ rcvrPtr := self cCoerce: (interpreterProxy firstIndexableField: rcvr) to: #'float *'.
- rcvrPtr := self cCoerce: (interpreterProxy firstIndexableField: rcvr) to: 'float *'.
len := 0.0.
0 to: length-1 do:[:i|
len := len + ((self cCoerce: (rcvrPtr at: i) to: #double) * (self cCoerce: (rcvrPtr at: i) to: #double)).
].
len > 0.0 ifFalse:
[interpreterProxy primitiveFailFor: PrimErrBadReceiver].
len := self sqrt: len.
0 to: length-1 do:[:i|
rcvrPtr at: i put: ((self cCoerce: (rcvrPtr at: i) to: #double) / len).
].
"Leave receiver on the stack."!
More information about the Vm-dev
mailing list