Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: tests/SkNxTest.cpp

Issue 1059743002: Use switch operator[](int) to kth<int>() so we can use vget_lane. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkNxTest.cpp
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index 1edf5b44b9375c8cc2c72a2cd227336ab3c5c46f..0a77ce66b93e130d669f45f8427dbb71887b77f5 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -15,12 +15,13 @@ static void test_Nf(skiatest::Reporter* r) {
auto close = [=](T a, T b) { return fabs(a-b) <= eps; };
T vals[4];
v.store(vals);
- REPORTER_ASSERT(r, close(vals[0], a) && close(vals[1], b));
- REPORTER_ASSERT(r, close( v[0], a) && close( v[1], b));
-
+ bool ok = close(vals[0], a) && close(vals[1], b)
+ && close(v.template kth<0>(), a) && close(v.template kth<1>(), b);
+ REPORTER_ASSERT(r, ok);
if (N == 4) {
- REPORTER_ASSERT(r, close(vals[2], c) && close(vals[3], d));
- REPORTER_ASSERT(r, close( v[2], c) && close( v[3], d));
+ ok = close(vals[2], c) && close(vals[3], d)
+ && close(v.template kth<2>(), c) && close(v.template kth<3>(), d);
+ REPORTER_ASSERT(r, ok);
}
};
auto assert_eq = [&](const SkNf<N,T>& v, T a, T b, T c, T d) {
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698