Bug 248995 - [WebAssembly SIMD] Emulate 8-bit shift instructions and i8x16.popcnt on Intel
Summary: [WebAssembly SIMD] Emulate 8-bit shift instructions and i8x16.popcnt on Intel
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Degazio
URL:
Keywords: InRadar
Depends on:
Blocks: 246345
  Show dependency treegraph
 
Reported: 2022-12-08 16:59 PST by David Degazio
Modified: 2022-12-19 12:46 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Degazio 2022-12-08 16:59:10 PST
While most other SIMD bitwise operations are tracked in https://bugs.webkit.org/show_bug.cgi?id=248639, I'm splitting off the following instructions:

 - i8x16.shl, i8x16.shr_s, i8x16.shr_u
 - i8x16.popcnt

into this bug so they don't hold up the other patch. None of these instructions are supported natively on Intel, at least without AVX-512, and they also
aren't easy to emulate. So they require some additional effort to implement necessary supporting instructions and figure out the best isel.
Comment 1 David Degazio 2022-12-08 17:03:14 PST
rdar://103159176
Comment 2 David Degazio 2022-12-12 10:36:08 PST
Looks like despite logical right-shift being supported for 64-bit elements, arithmetic right-shift is only supported with AVX-512 (which we really can't assume will be present). So we also need to emulate i64x2.shr_s.
Comment 3 David Degazio 2022-12-16 13:44:25 PST
Pull request: https://github.com/WebKit/WebKit/pull/7777
Comment 4 EWS 2022-12-19 12:45:57 PST
Committed 258089@main (7d8a35c36444): <https://commits.webkit.org/258089@main>

Reviewed commits have been landed. Closing PR #7777 and removing active labels.