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

Unified Diff: tests/SkNxTest.cpp

Issue 1707673002: fast sk4f <-> sk4i SSE methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ffff Created 4 years, 10 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 e329e17bfad8e259c42a3abf26365f8104f30239..57e659ea5bfa600d4b214f7924bb840007532680 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -237,6 +237,22 @@ DEF_TEST(SkNx_shuffle, r) {
REPORTER_ASSERT(r, f4[3] == 20);
}
+DEF_TEST(SkNx_int_float, r) {
+ Sk4f f(-2.3f, 1.0f, 0.45f, 0.6f);
+
+ Sk4i i = SkNx_cast<int>(f);
+ REPORTER_ASSERT(r, i[0] == -2);
+ REPORTER_ASSERT(r, i[1] == 1);
+ REPORTER_ASSERT(r, i[2] == 0);
+ REPORTER_ASSERT(r, i[3] == 0);
+
+ f = SkNx_cast<float>(i);
+ REPORTER_ASSERT(r, f[0] == -2.0f);
+ REPORTER_ASSERT(r, f[1] == 1.0f);
+ REPORTER_ASSERT(r, f[2] == 0.0f);
+ REPORTER_ASSERT(r, f[3] == 0.0f);
+}
+
#include "SkRandom.h"
DEF_TEST(SkNx_u16_float, r) {
« 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