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

Unified Diff: src/opts/SkNx_sse.h

Issue 1590843003: add SkNx::abs(), for now only implemented for Sk4f (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkTAbs Created 4 years, 11 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_neon.h ('k') | tests/SkNxTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkNx_sse.h
diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h
index b3f509140626816367b4f34821299e44aeeb1eea..c6163b6a8034d5035d910f66fda05094a17973a2 100644
--- a/src/opts/SkNx_sse.h
+++ b/src/opts/SkNx_sse.h
@@ -176,6 +176,8 @@ public:
static SkNx Min(const SkNx& l, const SkNx& r) { return _mm_min_ps(l.fVec, r.fVec); }
static SkNx Max(const SkNx& l, const SkNx& r) { return _mm_max_ps(l.fVec, r.fVec); }
+ SkNx abs() const { return _mm_andnot_ps(_mm_set1_ps(-0.0f), fVec); }
+
SkNx sqrt() const { return _mm_sqrt_ps (fVec); }
SkNx rsqrt0() const { return _mm_rsqrt_ps(fVec); }
SkNx rsqrt1() const { return this->rsqrt0(); }
« no previous file with comments | « src/opts/SkNx_neon.h ('k') | tests/SkNxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698