tests/checkasm/sw_ops: Switch to opaques for deciding when to test

This uses the new mechanisms introduced in
cf7e2b6773, as used by the crc test
in 0629ebb5ff.
This commit is contained in:
Martin Storsjö
2026-02-25 15:45:23 +02:00
parent 23bb7c3907
commit 5693b07839
+4 -8
View File
@@ -190,18 +190,14 @@ static void check_ops(const char *report, const unsigned ranges[NB_PLANES],
uintptr_t id = (uintptr_t) backend_new;
id ^= (id << 6) + (id >> 2) + 0x9e3779b97f4a7c15 + comp_new.cpu_flags;
checkasm_save_context();
if (checkasm_check_func((void *) id, "%s", report)) {
func_new = comp_new.func;
func_ref = comp_ref.func;
if (check_key((void*) id, "%s", report)) {
exec.block_size_in = comp_ref.block_size * rw_pixel_bits(read_op) >> 3;
exec.block_size_out = comp_ref.block_size * rw_pixel_bits(write_op) >> 3;
for (int i = 0; i < NB_PLANES; i++) {
exec.in[i] = (void *) src0[i];
exec.out[i] = (void *) dst0[i];
}
call_ref(&exec, comp_ref.priv, 0, 0, PIXELS / comp_ref.block_size, LINES);
checkasm_call(comp_ref.func, &exec, comp_ref.priv, 0, 0, PIXELS / comp_ref.block_size, LINES);
exec.block_size_in = comp_new.block_size * rw_pixel_bits(read_op) >> 3;
exec.block_size_out = comp_new.block_size * rw_pixel_bits(write_op) >> 3;
@@ -209,7 +205,7 @@ static void check_ops(const char *report, const unsigned ranges[NB_PLANES],
exec.in[i] = (void *) src1[i];
exec.out[i] = (void *) dst1[i];
}
call_new(&exec, comp_new.priv, 0, 0, PIXELS / comp_new.block_size, LINES);
checkasm_call_checked(comp_new.func, &exec, comp_new.priv, 0, 0, PIXELS / comp_new.block_size, LINES);
for (int i = 0; i < NB_PLANES; i++) {
const char *name = FMT("%s[%d]", report, i);
@@ -242,7 +238,7 @@ static void check_ops(const char *report, const unsigned ranges[NB_PLANES],
break;
}
bench_new(&exec, comp_new.priv, 0, 0, PIXELS / comp_new.block_size, LINES);
bench(comp_new.func, &exec, comp_new.priv, 0, 0, PIXELS / comp_new.block_size, LINES);
}
if (comp_new.func != comp_ref.func && comp_new.free)