The Trunk: Collections-eem.904.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-eem.904.mcz

commits-2
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.904.mcz

==================== Summary ====================

Name: Collections-eem.904
Author: eem
Time: 21 July 2020, 12:48:47.966166 pm
UUID: 5aa53764-ee46-4fee-b681-0bc142550102
Ancestors: Collections-ul.903

Supercede the slow Float[64]ArrayPlugin>>at:[put:] primitives with much faster ones in the Spur VM.

=============== Diff against Collections-ul.903 ===============

Item was changed:
+ (PackageInfo named: 'Collections') preamble: '"Use of the Spur FloatArray>>at:[put:] prims requires at least VMMaker.oscog.2778"
- (PackageInfo named: 'Collections') preamble: '"FloatArray is going to become the abstract class above Float32Array and Float64Array.
- In order to avoid spurious instance migration or recompilation errors, this preamble is required."
 
+ Smalltalk vmVMMakerVersion < 2778 ifTrue:
+ [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.'']'!
- FloatArray rename: #Float32Array.'!

Item was removed:
- ----- Method: Float32Array>>at: (in category 'accessing') -----
- at: index
- <primitive: 'primitiveAt' module: 'FloatArrayPlugin'>
- ^Float fromIEEE32Bit: (self basicAt: index)!

Item was removed:
- ----- Method: Float32Array>>at:put: (in category 'accessing') -----
- at: index put: value
- <primitive: 'primitiveAtPut' module: 'FloatArrayPlugin'>
- value isFloat
- ifTrue:[self basicAt: index put: value asIEEE32BitWord]
- ifFalse:[self at: index put: value asFloat].
- ^value!

Item was removed:
- ----- Method: Float32Array>>defaultElement (in category 'accessing') -----
- defaultElement
- "Return the default element of the receiver"
- ^0.0!

Item was removed:
- ----- Method: Float64Array>>at: (in category 'accessing') -----
- at: index
- <primitive: 'primitiveAt' module: 'Float64ArrayPlugin'>
- | f64 u64 |
- u64 := self basicAt: index.
- (f64 := Float basicNew)
- basicAt: 1 put: (u64 >> 32);
- basicAt: 2 put: (u64 bitAnd: 16rFFFFFFFF).
- ^f64 * 1.0!

Item was removed:
- ----- Method: Float64Array>>at:put: (in category 'accessing') -----
- at: index put: value
- <primitive: 'primitiveAtPut' module: 'Float64ArrayPlugin'>
- value isFloat
- ifTrue:[self basicAt: index put: (value basicAt: 1) << 32 + (value basicAt: 2)]
- ifFalse:[self at: index put: value asFloat].
- ^value!

Item was added:
+ ----- Method: FloatArray>>at: (in category 'accessing') -----
+ at: index
+ "Answer the Float at index in the receiver.  This method converts from either a 32-bit IEEE representation,
+ or a 64-bit IEEE representation to a Squeak Float object.  Primitive. Optional."
+ <primitive: 238 error: ec>
+ ^self bytesPerElement = 4
+ ifTrue: [Float fromIEEE32Bit: (self basicAt: index)]
+ ifFalse: [Float fromIEEE64Bit: (self basicAt: index)]!

Item was added:
+ ----- Method: FloatArray>>at:put: (in category 'accessing') -----
+ at: index put: value
+ "Store the Float value at index in the receiver.  This method converts from a Squeak Float object,
+ or an Integer, into either a 32-bit IEEE representation, or a 64-bit IEEE representation. Primitive. Optional."
+ <primitive: 239 error: ec>
+ value isFloat
+ ifTrue:[self basicAt: index put: (self bytesPerElement = 4
+ ifTrue: [value asIEEE32BitWord]
+ ifFalse: [value asIEEE64BitWord])]
+ ifFalse: [self at: index put: value asFloat].
+ ^value!