You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose for WebAssembly that the integer arithmetic support be extended in future versions. I've noticed that over the years, a fair amount of issues here labeled integer have been created, but there doesn't appear to be any active proposal for resolving these:
i32.clmul, i64.clmul, i32.clmulh, and i64.clmulh for obtaining the low and high bits of a carry-less multiplication (corresponding to @llvm.clmul) (New insn: Carry-less multiply (CLMUL) #1388)
i32.rbit and i64.rbit for reversing the bits in an integer corresponding to the rbit ARM instruction (Bit reversing instructions #1382)
It is very unfortunate when you incur a significant performance cost when targeting WASM because these instructions are not available. For example, you can use the C++29 std::bit_compress function (which I've personally gotten into the standard by the way) to portable spell a PEXT operation, but this would get expanded to so many WASM instructions that you probably couldn't reconstruct pext in the JIT compiler on the other end because the expansion is way too complex.
Anyway, how do I get the ball rolling on this? I've joined the W3C Community Group. I am under the impression that if I don't champion this myself, it's not going to happen anytime soon.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I would like to propose for WebAssembly that the integer arithmetic support be extended in future versions. I've noticed that over the years, a fair amount of issues here labeled
integerhave been created, but there doesn't appear to be any active proposal for resolving these:Some possible candidates:
i32.mulhandi64.mulhfor obtaining the high bits of a 64-bit multiplication (64-bit Widening Multiplication #1495)i32.clmul,i64.clmul,i32.clmulh, andi64.clmulhfor obtaining the low and high bits of a carry-less multiplication (corresponding to@llvm.clmul) (New insn: Carry-less multiply (CLMUL) #1388)i32.pext,i64.pext,i32.pdep, andi64.pdepfor parallel bit extract / parallel bit deposit, corresponding to@llvm.pextand@llvm.pdep(Accelerated bitfield instructions: PDEP, PEXT and BEXTR? #1389)i32.rbitandi64.rbitfor reversing the bits in an integer corresponding to therbitARM instruction (Bit reversing instructions #1382)It is very unfortunate when you incur a significant performance cost when targeting WASM because these instructions are not available. For example, you can use the C++29
std::bit_compressfunction (which I've personally gotten into the standard by the way) to portable spell a PEXT operation, but this would get expanded to so many WASM instructions that you probably couldn't reconstructpextin the JIT compiler on the other end because the expansion is way too complex.Anyway, how do I get the ball rolling on this? I've joined the W3C Community Group. I am under the impression that if I don't champion this myself, it's not going to happen anytime soon.
Update: It has come to my attention that at least widening addition, subtraction, and multiplication are covered by https://github.com/WebAssembly/wide-arithmetic (phase 3)
All reactions