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

Unified Diff: tests/Sk4xTest.cpp

Issue 698873003: Sk4x_sse.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ~0 Created 6 years, 1 month 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/core/Sk4x_sse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Sk4xTest.cpp
diff --git a/tests/Sk4xTest.cpp b/tests/Sk4xTest.cpp
index 130693be24b91c8ca49847bd0d5a1fe2a3504905..d6e7e51b59fdd2554179866691c7987bd24c9d0e 100644
--- a/tests/Sk4xTest.cpp
+++ b/tests/Sk4xTest.cpp
@@ -15,9 +15,18 @@ DEF_TEST(Sk4x_Construction, r) {
ASSERT_EQ(baz, foo);
}
+struct AlignedFloats {
+ Sk4f forces16ByteAlignment; // On 64-bit machines, the stack starts 128-bit aligned,
+ float fs[5]; // but not necessarily so on 32-bit. Adding an Sk4f forces it.
+};
+
DEF_TEST(Sk4x_LoadStore, r) {
+ AlignedFloats aligned;
// fs will be 16-byte aligned, fs+1 not.
- float fs[] = { 5,6,7,8,9 };
+ float* fs = aligned.fs;
+ for (int i = 0; i < 5; i++) { // set to 5,6,7,8,9
+ fs[i] = float(i+5);
+ }
Sk4f foo = Sk4f::Load(fs);
Sk4f bar = Sk4f::LoadAligned(fs);
« no previous file with comments | « src/core/Sk4x_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698