Wasm/SIMD _mm_blendv_epi8 yields incorrect result
Categories
(Core :: JavaScript: WebAssembly, defect, P1)
Tracking
()
People
(Reporter: llyzs.vic, Assigned: yury)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
24.58 KB,
application/x-zip-compressed
|
Details | |
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
pascalc
:
approval-mozilla-esr128+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Steps to reproduce:
Open the attached web page which will load the WebAssembly and run the test.
The test use _mm_blendv_epi8 and a mask (0xFF 0xFF 0xFF 0x00) to blend two sources (0xFF 0x00 0x00 0xFF and 0x00 0xFF 0x00 0x00) which should yield the expected result 0x00 0xFF 0x00 0xFF.
The bug is likely related to _mm_blendv_epi8 because replacing it with _mm_add_epi8 will give the expected result (0xFF 0xFF 0x00 0xFF).
The bug also seems only reproducible when the C++ program is compiled at least at optimization level 2.
Actual results:
Test failed because the calculated result is incorrect (0xFF 0x00 0x00 0x00).
Expected results:
The test should have passed.
Comment 1•12 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::JavaScript: WebAssembly' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•12 days ago
•
|
||
Can confirm the test failing in Firefox and passing in Chrome.
Can repro on a build from Jan2023, so not a new regression.
Updated•12 days ago
|
Comment 4•12 days ago
|
||
Yury, can you take a look?
Updated•12 days ago
|
Assignee | ||
Comment 5•11 days ago
|
||
Assignee | ||
Comment 6•11 days ago
|
||
It is specific to X86 only -- we implemented PBLEND optimizations wrong. I'll add tests. We probably want to uplift it as much as we can
Assignee | ||
Comment 7•11 days ago
•
|
||
Comment on attachment 9471500 [details]
Bug 1953381 - Fix x86 PBLEND optimizations for v128.bitselect. r?jseward
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Wrong results in some programs that are using wasm v128.bitselect instruction
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Trivial fix, modifies only affected operation
- String changes made/needed:
- Is Android affected?: Unknown
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Wrong results in some programs that are using wasm v128.bitselect instruction
- User impact if declined:
- Fix Landed on Version:
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Trivial fix, modifies only affected operation
Comment 9•10 days ago
|
||
bugherder |
Comment 10•10 days ago
|
||
Comment on attachment 9471500 [details]
Bug 1953381 - Fix x86 PBLEND optimizations for v128.bitselect. r?jseward
=> 137 Beta 6
Comment 11•10 days ago
|
||
uplift |
Updated•10 days ago
|
Updated•7 days ago
|
Updated•4 days ago
|
Updated•4 days ago
|
Comment 12•4 days ago
|
||
uplift |
Updated•4 days ago
|
Description
•