Revert "mark which SkVM tests should JIT or not"
This reverts commit 52435503e992cbeb388d90c51f74515ab1e11c96.
Reason for revert: lots of bots can't JIT, duh...
Original change's description:
> mark which SkVM tests should JIT or not
>
> Most of these tests converted over to test_interpreter_only()
> are failing to JIT because of unimplemented instructions. No
> bug there, just TODOs.
>
> But SkVM_hoist _should_ be JITting. A while back I landed a CL
> that messed with value lifetimes that prevents it from JITting.
> Will be using this as a regression test to fix that bug.
>
> Change-Id: Id2034f6548a45ed9aeb9ae3cbb24d389cad7dc60
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248980
> Commit-Queue: Mike Klein <mtklein@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Auto-Submit: Mike Klein <mtklein@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
TBR=mtklein@google.com,herb@google.com,ethannicholas@google.com
Change-Id: Ieea4b06f0d32249e3da56c6810d3c45c2abf2689
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248989
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/tests/SkVMTest.cpp b/tests/SkVMTest.cpp
index 24bca86..87385d4 100644
--- a/tests/SkVMTest.cpp
+++ b/tests/SkVMTest.cpp
@@ -30,26 +30,13 @@
o->writeText("\n");
}
-// TODO: I'd like this to go away and have every test in here run both JIT and interpreter.
template <typename Fn>
-static void test_interpreter_only(skiatest::Reporter* r, skvm::Program&& program, Fn&& test) {
-#if defined(SKVM_JIT)
- REPORTER_ASSERT(r, !program.hasJIT());
-#endif
- test((const skvm::Program&) program);
-}
-
-template <typename Fn>
-static void test_jit_and_interpreter(skiatest::Reporter* r, skvm::Program&& program, Fn&& test) {
-#if defined(SKVM_JIT)
- REPORTER_ASSERT(r, program.hasJIT());
+static void test_jit_and_interpreter(skvm::Program&& program, Fn&& test) {
test((const skvm::Program&) program);
program.dropJIT();
-#endif
- test_interpreter_only(r, std::move(program), std::move(test));
+ test((const skvm::Program&) program);
}
-
DEF_TEST(SkVM, r) {
SkDynamicMemoryWStream buf;
@@ -108,7 +95,7 @@
dump(b, &buf);
- test_jit_and_interpreter(r, std::move(program), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(std::move(program), [&](const skvm::Program& program) {
int arg[] = {0,1,2,3,4,5,6,7,8,9};
program.eval(SK_ARRAY_COUNT(arg), arg);
@@ -144,7 +131,7 @@
uint32_t src[9];
uint32_t dst[SK_ARRAY_COUNT(src)];
- test_jit_and_interpreter(r, std::move(program), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(std::move(program), [&](const skvm::Program& program) {
for (int i = 0; i < (int)SK_ARRAY_COUNT(src); i++) {
src[i] = 0xbb007733;
dst[i] = 0xffaaccee;
@@ -176,7 +163,7 @@
test_8888(SrcoverBuilder_I32{}.done("srcover_i32"));
test_8888(SrcoverBuilder_I32_SWAR{}.done("srcover_i32_SWAR"));
- test_jit_and_interpreter(r, SrcoverBuilder_F32{Fmt::RGBA_8888, Fmt::G8}.done(),
+ test_jit_and_interpreter(SrcoverBuilder_F32{Fmt::RGBA_8888, Fmt::G8}.done(),
[&](const skvm::Program& program) {
uint32_t src[9];
uint8_t dst[SK_ARRAY_COUNT(src)];
@@ -199,7 +186,7 @@
}
});
- test_jit_and_interpreter(r, SrcoverBuilder_F32{Fmt::A8, Fmt::A8}.done(),
+ test_jit_and_interpreter(SrcoverBuilder_F32{Fmt::A8, Fmt::A8}.done(),
[&](const skvm::Program& program) {
uint8_t src[256],
dst[256];
@@ -227,7 +214,7 @@
b.splat(4.0f));
}
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
for (int N = 0; N < 64; N++) {
program.eval(N);
}
@@ -248,7 +235,7 @@
b.add(b.splat(1),
b.load32(arg)));
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int buf[64];
for (int N = 0; N <= (int)SK_ARRAY_COUNT(buf); N++) {
for (int i = 0; i < (int)SK_ARRAY_COUNT(buf); i++) {
@@ -281,7 +268,7 @@
b.store8 (buf8 , b.gather8 (img, b.bit_and(x, b.splat(31))));
}
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
const int img[] = {12,34,56,78, 90,98,76,54};
constexpr int N = 20;
@@ -339,7 +326,7 @@
b.store32(ptr, x);
}
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int x = 0x42;
program.eval(1, &x);
REPORTER_ASSERT(r, x == 0x7fff'ffff);
@@ -358,7 +345,7 @@
b.store32(arg, b.bit_cast(w));
}
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
float buf[] = { 1,2,3,4,5,6,7,8,9 };
program.eval(SK_ARRAY_COUNT(buf), buf);
for (float v : buf) {
@@ -387,7 +374,7 @@
b.store32(b.varying<int>(), m);
}
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int in[] = { 0,1,2,3,4,5,6,7,8,9 };
int out[SK_ARRAY_COUNT(in)];
@@ -424,7 +411,7 @@
b.store32(b.varying<int>(), m);
}
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
float in[] = { 0,1,2,3,4,5,6,7,8,9 };
int out[SK_ARRAY_COUNT(in)];
@@ -455,7 +442,7 @@
b.store32(buf, u);
}
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
uint16_t buf[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13 };
program.eval(SK_ARRAY_COUNT(buf)/2, buf);
@@ -488,7 +475,7 @@
b.store32(buf, m);
}
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int16_t buf[] = { 0,1, 2,3, 4,5, 6,7, 8,9 };
program.eval(SK_ARRAY_COUNT(buf)/2, buf);
@@ -521,7 +508,7 @@
b.store32(arg, b.to_i32(v));
}
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int x = 2;
program.eval(1, &x);
// x = 2
@@ -545,7 +532,7 @@
b.store32(arg, b.bit_cast(w));
}
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
float x = 2.0f;
// y = 2*2 + 2 = 6
// z = 6*2 + 6 = 18
@@ -568,9 +555,7 @@
b.store32(arg, x);
}
- // TODO: this really should JIT... a bug slipped in making it fail to.
- // See https://skia-review.googlesource.com/c/skia/+/242591.
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int x = 4;
program.eval(1, &x);
// x += 0 + 1 + 2 + 3 + ... + 30 + 31
@@ -591,7 +576,7 @@
b.store32(buf, x);
}
- test_jit_and_interpreter(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
int buf[] = { 0,1,2,3,4,5,6,7,8 };
program.eval(SK_ARRAY_COUNT(buf), buf);
for (int i = 0; i < (int)SK_ARRAY_COUNT(buf); i++) {
@@ -630,7 +615,7 @@
SkDebugf("%.*s\n", blob->size(), blob->data());
}
- test_interpreter_only(r, b.done(), [&](const skvm::Program& program) {
+ test_jit_and_interpreter(b.done(), [&](const skvm::Program& program) {
const int N = 31;
int16_t buf[N];
for (int i = 0; i < N; i++) {