bytecodealliance / bytecodealliance/wasmtime

Use x64 SSE instructions for 128-bit shifts (and other operations?)

Open
#2,689 0 comments 0 reactions 0 assignees View on GitHub
cranelift:area:x64
Dominant language
Rust
Stars
18.6k
Forks
1.8k
Avg merge
1d 16h
Merged PRs (30d)
135

Description

As noted by @abrown in #2682, our 128-bit shift sequences on x86-64 could make use of `PSLLDQ` and `PSRLDQ` to do the 128-bit operation in one go, rather than an open-coded combination of 64-bit shifts with conditional moves, etc. It's likely that this would be faster even with moves to the XMM register file. It's possible that there are better SSE alternatives for some of our other operations as well.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the x86-64 lowering for 128-bit shifts and inspect the generated instruction sequences; compare the existing open-coded shifts with PSLLDQ and PSRLDQ, then check whether benchmarks or tests show a benefit without changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.