Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/correctness/simd_op_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ class SimdOpCheckTest {
// Include a scalar version
Halide::Func f_scalar("scalar_" + name);
f_scalar(x, y) = e;
// Make sure scalar result is computed independently to prevent it
// from being fused into error() by optimization which complicates floating point errors.
f_scalar.compute_root();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth a comment as to why this is necessary for correctness.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


if (has_inline_reduction.result) {
// If there's an inline reduction, we want to vectorize it
Expand Down
10 changes: 5 additions & 5 deletions test/correctness/simd_op_check_wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,11 @@ class SimdOpCheckWASM : public SimdOpCheckTest {
// check("v128.load32_zero", 2 * w, in_u32(0));
// check("v128.load64_zero", 2 * w, in_u64(0));

// Load vector with identical lanes generates *.splat.
check("i8x16.splat", 16 * w, in_u8(0));
check("i16x8.splat", 8 * w, in_u16(0));
check("i32x4.splat", 4 * w, in_u32(0));
check("i64x2.splat", 2 * w, in_u64(0));
// Load vector with identical lanes generates load*_splat.
check("v128.load8_splat", 16 * w, in_u8(0));
check("v128.load16_splat", 8 * w, in_u16(0));
check("v128.load32_splat", 4 * w, in_u32(0));
check("v128.load64_splat", 2 * w, in_u64(0));

// Load Lane
// TODO: does Halide have any idiom that obviously generates these?
Expand Down
Loading