Closed Bug 1438160 Opened 6 years ago Closed 3 years ago

MacroAssembler.h APIs for wasm truncate to i64 and wasm truncate to i32 are different for no good reason

Categories

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

enhancement

Tracking

()

RESOLVED INVALID

People

(Reporter: lth, Assigned: lth)

References

Details

This was an oversight when the API cleanup happened:

wasmTruncate{Double,Float32}ToU?Int64 takes an 'oolRejoin' Label* parameter which it may use, and which it always binds at the end of the sequence.  The similar APIs that truncate to U?Int32 do not take an oolRejoin parameter and so do not bind it; the client must bind this label themselves.  In the case of unsigned conversions the clients don't do that; this is correct but for really obscure reasons, and it is not documented.

We should bring these APIs into sync, and document better how they work.  I've added a comment about the 64-bit case to my patch for bug 1436953 and I'll add another about the 32-bit case, but let's fix this.

Let's wait for ARM64 and MIPS baseline compilers to land first.
Summary: macroAssembler.h APIs for wasm truncate to i64 and wasm truncate to i32 are different for no good reason → MacroAssembler.h APIs for wasm truncate to i64 and wasm truncate to i32 are different for no good reason
Assignee: lhansen → nobody
Status: ASSIGNED → NEW
Component: JavaScript Engine: JIT → Javascript: WebAssembly
Assignee: nobody → lhansen
Status: NEW → ASSIGNED

(In reply to Lars T Hansen [:lth] from comment #0)

wasmTruncate{Double,Float32}ToU?Int64 takes an 'oolRejoin' Label* parameter
which it may use, and which it always binds at the end of the sequence.

This is not correct on two counts. On x86, for double->u64, the label may be bound in the middle of the sequence. And the label is not "always" bound; on arm64 and mips64 it is bound only for saturating operations.

The
similar APIs that truncate to U?Int32 do not take an oolRejoin parameter and
so do not bind it; the client must bind this label themselves. In the case
of unsigned conversions the clients don't do that;

This is also not correct.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.