Closed Bug 1797194 Opened 2 years ago Closed 2 years ago

Fix WasmLosslessInvoke logic

Categories

(Core :: JavaScript: WebAssembly, defect, P3)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: yury, Assigned: yury)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In the imported Wasm spec tests we are using wasmGlobalsEqual a lot. The F32/F64 values at the moment are wrongfully asserted as equal. See https://searchfox.org/mozilla-central/source/js/src/builtin/TestingFunctions.cpp#1270

Yikes, that's a bad mistake. Can you do a try run to gather some test failures triggered by fixing this?

Flags: needinfo?(ydelendik)

Here is a list of failing tests if I replace one aVal with bVal:
wasm/spec/memory64/address64.wast.js
wasm/spec/memory64/float_memory64.wast.js
wasm/spec/spec/address.wast.js
wasm/spec/spec/conversions.wast.js
wasm/spec/spec/f32_bitwise.wast.js
wasm/spec/spec/f64_bitwise.wast.js
wasm/spec/spec/float_exprs.wast.js
wasm/spec/spec/float_memory.wast.js
wasm/spec/spec/float_misc.wast.js
wasm/spec/spec/local_tee.wast.js
wasm/spec/spec/select.wast.js
wasm/spec/spec/simd_f32x4.wast.js
wasm/spec/spec/simd_f64x2.wast.js
wasm/spec/spec/simd_lane.wast.js

Most of fails are: -0 vs 0, nan vs -nan, or payload are not equal in nan.

Flags: needinfo?(ydelendik)

Problem is actually with WasmLosslessInvoke. And to be exact with StoreRegisterResult that is doing canonicalizeFloat/canonicalizeDouble in the compiled stubs (see also GenerateInterpEntry). We need to change WasmLosslessInvoke logic to not rely on StoreRegisterResult logic to canonicalize the register results.

Summary: Fix WasmGlobalsEqual logic → Fix WasmLosslessInvoke logic
Depends on: 1799014

I'm thinking about removal of wasmLosslessInvoke and replacing it with just a simple proxy module with mutable globals and function that wraps the callee.

The wasm/spec/spec/simd_f32x4.wast.js and wasm/spec/spec/simd_f64x2.wast.js (0 vs -0) cases are addressed by the bug 1799014.

Depends on: 1799919
Assignee: nobody → ydelendik
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: