[llvm] [WebAssembly] Lower narrow i128 multiplies more efficiently (PR #202461)
Luis Castro Martín via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 05:09:01 PDT 2026
luiscastro193 wrote:
Nice fix! Would it be reasonable to also handle the case where only one operand has known-zero upper bits (i.e. 128×64)? That is the state-advance multiply of PCG64-family PRNGs:
```cpp
__uint128_t advance(__uint128_t state, uint64_t mul) {
return state * mul; // still lowered to __multi3 with this patch
}
```
It expands to the same sequence as the 64×64 case plus one extra `i64.mul` folded into the high word. Without it, the only workaround is manually splitting the multiply in source code, which is exactly what this patch nicely avoids for the narrow-narrow case.
https://github.com/llvm/llvm-project/pull/202461
More information about the llvm-commits
mailing list