Hi all, hi Eliot,<br>
<br>
while revisiting these changes to update our release notes, I have been stumbling upon this patch a second time. Is this a noticeable breaking change that will hinder all (though assumingly few) users of a pre-Spur VM from using FloatArrays any longer or will they only experience a slowdown?<br>
<br>
(BTW, it would be great if you could avoid raising warnings/errors and dialogs from the update stream whenever avoidable. Keep in mind that MCMcmUpdater doUpdate: has an interactive flag that can be set to false indeed - e.g., in smalltalkCI or on my TelegramBot raspi and probably in many other places ... :-))<br>
<br>
Best,<br>
Christoph<br>
<br>
<font color="#808080">---<br>
</font><i><font color="#808080">Sent from </font></i><i><u><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><font color="#808080">Squeak Inbox Talk</font></a></u></i><br>
<br>
On 2020-07-21T19:48:51+00:00, commits@source.squeak.org wrote:<br>
<br>
> Eliot Miranda uploaded a new version of Collections to project The Trunk:<br>
> http://source.squeak.org/trunk/Collections-eem.904.mcz<br>
> <br>
> ==================== Summary ====================<br>
> <br>
> Name: Collections-eem.904<br>
> Author: eem<br>
> Time: 21 July 2020, 12:48:47.966166 pm<br>
> UUID: 5aa53764-ee46-4fee-b681-0bc142550102<br>
> Ancestors: Collections-ul.903<br>
> <br>
> Supercede the slow Float[64]ArrayPlugin>>at:[put:] primitives with much faster ones in the Spur VM.<br>
> <br>
> =============== Diff against Collections-ul.903 ===============<br>
> <br>
> Item was changed:<br>
> + (PackageInfo named: 'Collections') preamble: '"Use of the Spur FloatArray>>at:[put:] prims requires at least VMMaker.oscog.2778"<br>
> - (PackageInfo named: 'Collections') preamble: '"FloatArray is going to become the abstract class above Float32Array and Float64Array.<br>
> - In order to avoid spurious instance migration or recompilation errors, this preamble is required."<br>
> <br>
> + Smalltalk vmVMMakerVersion < 2778 ifTrue:<br>
> +     [Warning signal: ''This virtual machine is too old to support correct versions of the FloatArray>>at:[put:] primitives 238 and 239. FloatArray subclasses will not behave correctly and FloatArray[64]Test tests will fail. Please upgrade your VM. You may continue and upgrade later or abort and upgrade now.'']'!<br>
> - FloatArray rename: #Float32Array.'!<br>
> <br>
> Item was removed:<br>
> - ----- Method: Float32Array>>at: (in category 'accessing') -----<br>
> - at: index<br>
> -     <primitive: 'primitiveAt' module: 'FloatArrayPlugin'><br>
> -     ^Float fromIEEE32Bit: (self basicAt: index)!<br>
> <br>
> Item was removed:<br>
> - ----- Method: Float32Array>>at:put: (in category 'accessing') -----<br>
> - at: index put: value<br>
> -     <primitive: 'primitiveAtPut' module: 'FloatArrayPlugin'><br>
> -     value isFloat <br>
> -         ifTrue:[self basicAt: index put: value asIEEE32BitWord]<br>
> -         ifFalse:[self at: index put: value asFloat].<br>
> -     ^value!<br>
> <br>
> Item was removed:<br>
> - ----- Method: Float32Array>>defaultElement (in category 'accessing') -----<br>
> - defaultElement<br>
> -     "Return the default element of the receiver"<br>
> -     ^0.0!<br>
> <br>
> Item was removed:<br>
> - ----- Method: Float64Array>>at: (in category 'accessing') -----<br>
> - at: index<br>
> -     <primitive: 'primitiveAt' module: 'Float64ArrayPlugin'><br>
> -     | f64 u64 |<br>
> -     u64 := self basicAt: index.<br>
> -     (f64 := Float basicNew)<br>
> -         basicAt: 1 put: (u64 >> 32);<br>
> -         basicAt: 2 put: (u64 bitAnd: 16rFFFFFFFF).<br>
> -     ^f64 * 1.0!<br>
> <br>
> Item was removed:<br>
> - ----- Method: Float64Array>>at:put: (in category 'accessing') -----<br>
> - at: index put: value<br>
> -     <primitive: 'primitiveAtPut' module: 'Float64ArrayPlugin'><br>
> -     value isFloat <br>
> -         ifTrue:[self basicAt: index put: (value basicAt: 1) << 32 + (value basicAt: 2)]<br>
> -         ifFalse:[self at: index put: value asFloat].<br>
> -     ^value!<br>
> <br>
> Item was added:<br>
> + ----- Method: FloatArray>>at: (in category 'accessing') -----<br>
> + at: index<br>
> +     "Answer the Float at index in the receiver. This method converts from either a 32-bit IEEE representation,<br>
> +      or a 64-bit IEEE representation to a Squeak Float object. Primitive. Optional."<br>
> +     <primitive: 238 error: ec><br>
> +     ^self bytesPerElement = 4<br>
> +         ifTrue: [Float fromIEEE32Bit: (self basicAt: index)]<br>
> +         ifFalse: [Float fromIEEE64Bit: (self basicAt: index)]!<br>
> <br>
> Item was added:<br>
> + ----- Method: FloatArray>>at:put: (in category 'accessing') -----<br>
> + at: index put: value<br>
> +     "Store the Float value at index in the receiver. This method converts from a Squeak Float object,<br>
> +      or an Integer, into either a 32-bit IEEE representation, or a 64-bit IEEE representation. Primitive. Optional."<br>
> +     <primitive: 239 error: ec><br>
> +     value isFloat <br>
> +         ifTrue:[self basicAt: index put: (self bytesPerElement = 4<br>
> +                 ifTrue: [value asIEEE32BitWord]<br>
> +                 ifFalse: [value asIEEE64BitWord])]<br>
> +         ifFalse: [self at: index put: value asFloat].<br>
> +     ^value!<br>
> <br>