Closed Bug 1228612 Opened 9 years ago Closed 8 years ago

SIMD Float64x2 comparisons currently return Int32x4, when they should return Bool64x2.

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1160971
Tracking Status
firefox45 --- affected

People

(Reporter: jujjyl, Unassigned)

References

Details

This is unofficial since not part of the SIMD.js spec, but marking down nevertheless to raise the discrepancy. Marking as enhancement to reflect that. (and low priority, since this is a moving target looking at SIMD.js v2)

The current thinking in the SIMD.js spec is that comparison operations return Bool types, e.g. Float32x4.equal() returns a Bool32x4.

For some time, SIMD.js had Float64x2 type, but then decided to remove it from v1, to be introduced later.

Firefox already implemented the Float64x2 type from the spec when it still existed. The comparison operations on that type return Int32x4 in the JS engine implementation (old spec wording). The unofficial polyfill for these types return a Bool64x2 instead, which is in line with the current thinking.

Float64x2 type is important for Emscripten for being able to support porting over SSE2 codebases (polyfilled until SIMD.js v2). In Firefox we don't use the polyfill, but Emscripten performs monkeypatching to convert the Int32x4 to a Bool64x2, see https://github.com/kripken/emscripten/blob/master/src/ecmascript_simd.js#L1348 . 

The JS engine impl should be changed to return Bool64x2. (I think currently we don't have a Bool64x2 type even, so that should probably be added first?)
Good news, Jakob is working on implementing the boolean vector types in bug 1160971. The missing piece would be the Bool64x2 type though. But I guess they shouldn't be too hard to implement, with all the work made for other types?
This is already implemented in the patches currently being reviewed for Bug 1160971.
Depends on: 1160971
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Doc update with bug 1160971, too.
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.