Closed Bug 1762413 Opened 3 years ago Closed 3 years ago

Translate emscripten's sequence for _mm_maddubs_epi16 into MozWHPMADDUBSW

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: yury, Assigned: yury)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Here is the sequence: https://github.com/emscripten-core/emscripten/blob/9feae9e946a42e60e9d8b6cd446a7cb8f0563f8d/system/include/compat/tmmintrin.h#L82-L90

There are saturated add+four shifts+two muls+and+const, but it is doable to match it during MIR's foldsTo. There is a very low risk that compilers will replace this with different operations during optimization.

This will allow us to provide fast PMADDUBSW on Intel and remove non-standard wormhole, and it will be supported with non-Intel platforms. See bug 1762409

Component: Translation → Javascript: WebAssembly
Product: Firefox → Core
Blocks: wasm-simd
Assignee: nobody → ydelendik
Attachment #9270280 - Attachment description: WIP: Bug 1762413 - Optimize emscripten's sequence for _mm_maddubs_epi16 → Bug 1762413 - Optimize emscripten's sequence for _mm_maddubs_epi16
Status: NEW → ASSIGNED

Try push https://treeherder.mozilla.org/jobs?repo=try&revision=36aabb0d60b6cb27021028431687ce596b1e82be

Just to notice:

  • the sequence folding will be available for regular content (not only extensions)
  • is not available on ARM64, but functionality will not be lost there, it will be somewhat 9x slower
  • the bergamot team is advised to add testing so it verifies the exact PMADDUBSW-sequence is generated when wasm is built.
Severity: -- → N/A
Priority: -- → P2
Attachment #9270280 - Attachment description: Bug 1762413 - Optimize emscripten's sequence for _mm_maddubs_epi16 → Bug 1762413 - Optimize emscripten's sequence for _mm_maddubs_epi16. r?lth
Pushed by ydelendik@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8aa921dbad44 Optimize emscripten's sequence for _mm_maddubs_epi16. r=lth
See Also: → 1763171
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: