[Vm-dev] VM Maker: VMMaker.oscog-EstebanLorenzano.1869.mcz
Eliot Miranda
eliot.miranda at gmail.com
Thu May 26 19:05:03 UTC 2016
Hi Esteban,
yes, sorry about that. I didn't notice until just now. I've fixed it
properly, so will skip your commit. Forgive me.
On Thu, May 26, 2016 at 4:51 AM, <commits at source.squeak.org> wrote:
>
> Esteban Lorenzano uploaded a new version of VMMaker to project VM Maker:
> http://source.squeak.org/VMMaker/VMMaker.oscog-EstebanLorenzano.1869.mcz
>
> ==================== Summary ====================
>
> Name: VMMaker.oscog-EstebanLorenzano.1869
> Author: EstebanLorenzano
> Time: 26 May 2016, 1:49:23.32419 pm
> UUID: 6ccd2249-0a2c-4279-90b4-861c39f29859
> Ancestors: VMMaker.oscog-eem.1868
>
> last change breaks cCode: '' (strings).
> this commit fixes some, but not all... I don't know what to do with this
> (from UnixOSProcessPlugin):
>
> self cCode: 'sigchldHandlerAction.sa_sigaction = reapChildProcess'
>
> (that dot there...)
>
>
> =============== Diff against VMMaker.oscog-eem.1868 ===============
>
> Item was changed:
> ----- Method: FloatArrayPlugin>>primitiveLength (in category 'arithmetic
> primitives') -----
> primitiveLength
>
> "Primitive. Compute the length of the argument (sqrt of sum of
> component squares)."
>
> | rcvr rcvrPtr length result |
> <export: true>
> <var: #rcvrPtr type:'float *'>
> <var: #result type:'double '>
> rcvr := interpreterProxy stackObjectValue: 0.
> interpreterProxy failed ifTrue:[^nil].
> interpreterProxy success: (interpreterProxy isWords: rcvr).
> interpreterProxy failed ifTrue:[^nil].
> length := interpreterProxy stSizeOf: rcvr.
> interpreterProxy success: true.
> rcvrPtr := self cCoerce: (interpreterProxy firstIndexableField:
> rcvr) to: 'float *'.
> result := 0.0.
> 0 to: length-1 do:[:i|
> result := result + ((self cCoerce: (rcvrPtr at: i) to:
> 'double') * (self cCoerce: (rcvrPtr at: i) to: 'double')).
> ].
> + result := self cCode: [self sqrt:result] inSmalltalk: [result
> sqrt].
> - result := self cCode: 'sqrt(result)' inSmalltalk: [result sqrt].
> interpreterProxy pop: 1 thenPush: (interpreterProxy floatObjectOf:
> result)!
>
> Item was changed:
> ----- Method: FloatArrayPlugin>>primitiveNormalize (in category
> 'arithmetic primitives') -----
> primitiveNormalize
>
> "Primitive. Normalize the argument (A FloatArray) in place."
>
> | rcvr rcvrPtr length len |
> <export: true>
> <var: #rcvrPtr type:'float *'>
> <var: #len type:'double '>
> rcvr := interpreterProxy stackObjectValue: 0.
> interpreterProxy failed ifTrue:[^nil].
> interpreterProxy success: (interpreterProxy isWords: rcvr).
> interpreterProxy failed ifTrue:[^nil].
> length := interpreterProxy stSizeOf: rcvr.
> interpreterProxy success: true.
> 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')).
> ].
> interpreterProxy success: (len > 0.0).
> interpreterProxy failed ifTrue:[^nil].
>
> + len := self cCode: [self sqrt:len] inSmalltalk: [len sqrt].
> - len := self cCode: 'sqrt(len)' inSmalltalk: [len sqrt].
> 0 to: length-1 do:[:i|
> rcvrPtr at: i put: ((self cCoerce: (rcvrPtr at: i) to:
> 'double') / len).
> ].
>
> "Leave receiver on the stack."!
>
> Item was changed:
> ----- Method: SoundPlugin>>primitiveSoundGetRecordingSampleRate (in
> category 'primitives') -----
> primitiveSoundGetRecordingSampleRate
> "Return a float representing the actual sampling rate during
> recording. Fail if not currently recording."
>
> | rate |
> <var: #rate type: 'double '>
> self primitive: 'primitiveSoundGetRecordingSampleRate'.
> + rate := self snd_GetRecordingSampleRate. "fail if not recording"
> - rate := self cCode: 'snd_GetRecordingSampleRate()'. "fail if not
> recording"
> ^rate asFloatObj!
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160526/ecc668ce/attachment.htm
More information about the Vm-dev
mailing list