Open
Description
While implementing WASMmul_u8x16
and mul_i8x16
I added the following two tests (which test parity between WASM and Fallback:
test_wasm_simd_parity! {
fn mul_u8x16() {
|s| -> [u8; 16] {
let a = u8x16::from_slice(s, &[0,0,1,1,2,4,8,16,32,64,128,255,255,255,255,255]);
let b = u8x16::from_slice(s, &[0,0,0, 1,1,2,4,8,16,32,64,128,255,255,255,0]);
(a * b).into()
}
}
}
test_wasm_simd_parity! {
fn mul_i8x16() {
|s| -> [i8; 16] {
let a = i8x16::from_slice(s, &[0,0,127,-0,2,4,8,16,32,64,127,127,127,127,127,127]);
let b = i8x16::from_slice(s, &[0,0,-128,0,2,4,-8,-16,-32,-64,127,0,1,-1,0,1]);
(a * b).into()
}
}
}
These failed with a panic message: attempt to multiply with overflow
from fallback.
How should the Fallback implementation handle those test cases? I've implemented the WASM operations as truncated multiplication. I believe the neon implementation also uses truncating multiplication as Neon's mul_u8x16
operation uses the vmulq_u8
intrinsic.
Metadata
Metadata
Assignees
Labels
No labels