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

Unified Diff: unit_test/unit_test.h

Issue 2004313004: add SIMD_ALIGNED to unit_test.h (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: fix ifndef and move to top where macros go Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unit_test/unit_test.h
diff --git a/unit_test/unit_test.h b/unit_test/unit_test.h
index ae9c9c20b80bf0b92b62e1a85777e2e43d4a81ce..2d62b1e7ff0d120210a4e20b3db07bb556a1c815 100644
--- a/unit_test/unit_test.h
+++ b/unit_test/unit_test.h
@@ -22,6 +22,16 @@
#include "libyuv/basic_types.h"
+#ifndef SIMD_ALIGNED
+#if defined(_MSC_VER) && !defined(__CLR_VER)
+#define SIMD_ALIGNED(var) __declspec(align(16)) var
+#elif defined(__GNUC__) && !defined(__pnacl__)
+#define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
+#else
+#define SIMD_ALIGNED(var) var
+#endif
+#endif
+
static __inline int Abs(int v) {
return v >= 0 ? v : -v;
}
@@ -31,11 +41,11 @@ static __inline int Abs(int v) {
// Scaling uses 16.16 fixed point to step thru the source image, so a
// maximum size of 32767.999 can be expressed. 32768 is valid because
// the step is 1 beyond the image but not used.
-// Destination size is mainly constrained by valid scale step not the
+// Destination size is mainly constrained by valid scale step not the
// absolute size, so it may be possible to relax the destination size
// constraint.
// Source size is unconstrained for most specialized scalers. e.g.
-// An image of 65536 scaled to half size would be valid. The test
+// An image of 65536 scaled to half size would be valid. The test
// could be relaxed for special scale factors.
// If this test is removed, the scaling function should gracefully
// fail with a return code. The test could be changed to know that
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698