Skip to content

Commit b2f25dd

Browse files
committed
Do not include the scalar version and error checking code in the code that will be used to find the intrinsic.
1 parent 1a9ac3c commit b2f25dd

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

test/correctness/simd_op_check.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -350,22 +350,22 @@ class SimdOpCheckTest {
350350
.vectorize(xi);
351351
}
352352

353-
// We'll check over H rows, but we won't let the pipeline know H
354-
// statically, as that can trigger some simplifications that change
355-
// instruction selection.
356-
Param<int> rows;
357-
rows.set(H);
358-
arg_types.push_back(rows);
359-
360-
// The output to the pipeline is the maximum absolute difference as a double.
361-
RDom r_check(0, W, 0, rows);
362-
Halide::Func error("error_" + name);
363-
error() = Halide::cast<double>(maximum(absd(f(r_check.x, r_check.y), f_scalar(r_check.x, r_check.y))));
364-
365-
compile_and_check(error, op, name, vector_width, arg_types, error_msg);
353+
compile_and_check(f, op, name, vector_width, arg_types, error_msg);
366354

367355
bool can_run_the_code = can_run_code();
368356
if (can_run_the_code) {
357+
// We'll check over H rows, but we won't let the pipeline know H
358+
// statically, as that can trigger some simplifications that change
359+
// instruction selection.
360+
Param<int> rows;
361+
rows.set(H);
362+
arg_types.push_back(rows);
363+
364+
// The output to the pipeline is the maximum absolute difference as a double.
365+
RDom r_check(0, W, 0, rows);
366+
Halide::Func error("error_" + name);
367+
error() = Halide::cast<double>(maximum(absd(f(r_check.x, r_check.y), f_scalar(r_check.x, r_check.y))));
368+
369369
Target run_target = get_run_target();
370370

371371
// Make some unallocated input buffers

test/correctness/simd_op_check_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ class SimdOpCheckX86 : public SimdOpCheckTest {
414414
// Some llvm's don't use kandw, but instead predicate the computation of bool_2
415415
// using the result of bool_1
416416
// check(use_avx512 ? "kandw" : "vandps", 8, bool_1 & bool_2);
417-
check(use_avx512 ? "korw" : "vorps", 8, bool_1 | bool_2);
418-
check(use_avx512 ? "kxorw" : "vxorps", 8, bool_1 ^ bool_2);
417+
check(use_avx512 ? "korb" : "vorps", 8, bool_1 | bool_2);
418+
check(use_avx512 ? "kxorb" : "vxorps", 8, bool_1 ^ bool_2);
419419

420420
check("vaddps*ymm", 8, f32_1 + f32_2);
421421
check("vaddpd*ymm", 4, f64_1 + f64_2);

0 commit comments

Comments
 (0)