Closed Cyborus04 closed 2 years ago
This is instruction was dropped (#98), because result of i8
multiplication isn't likely to fit into an i8
: https://github.com/WebAssembly/simd/issues/28#issuecomment-377585364
Do you have code where you would need it?
I was making a toy SIMD library in Rust which only operates on 128 bits (like in WebAssembly), where each type for the lanes would implement a trait for their associated instructions. I hit the roadblock of mul
as I didn't see a way to implement this trait for i8
/u8
(except maybe extracting each lane and multiplying them manually, but that kinda defeats the point)
You can try using i16x8.extmul_low_i8x16 + i16x8.extmul_high_i8x16 + i8x16.narrowi16x8{s,u}, that's 3 instructions, which will be better than extracting individual lanes.
Oh, that works. Thank you!
Is there a reason why
i8x16.mul
is not included? I find it a bit odd, sincei16x8.mul
,i32x4.mul
, andi64x2.mul
exist. Is there something I'm missing?