Closed Bug 1671907 Opened 4 years ago Closed 4 years ago

maybeInlineSimd128Int fails to handle most constants

Categories

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

x86_64
All
defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: lth, Assigned: lth)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

maybeInlineSimd128Int compares its input with two int32x4 constants. Since the type tag is taken into account during the equality checking and int8x16 and int16x8 and int64x2 are not the same type tag, most constants that could be synthesized even with the limited code we have are not synthesized.

This is the kind of bug you'll mostly only find by having test cases that check the generated code, which is why we should have test cases checking the generated code.

When synthesizing constants we should be interested in type classes
(int vs float) and bit patterns in those classes, not specific tags --
a zero is a zero regardless of whether it is i8x16 or i32x4.

Thus the operator == on SimdConstant that takes type tags into account
is the wrong primitive to find out is a constant is synthesizable,
indeed, it is the wrong primitive in almost every case. So get rid of
it, replace it with more suitable primitives, and use those
everywhere.

Add test cases that test that we are emitting the right instructions
for constants that are easy to synthesize.

Depends on D93720

Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2716ecaf485c
Properly recognize wasm constants that can be synthesized. r=jseward
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bbefba0527c2
Properly recognize wasm constants that can be synthesized. r=jseward
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: