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

Unified Diff: src/core/SkNx.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 | « no previous file | src/opts/SkNx_neon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNx.h
diff --git a/src/core/SkNx.h b/src/core/SkNx.h
index 684a31dcef1a80deb10bd5ec6f5910a1c9dd5dee..2bbd495ce50bca907407b87cc6bd315876e03a96 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -74,6 +74,8 @@ public:
return SkNx(SkNx<N/2, T>::Max(a.fLo, b.fLo), SkNx<N/2, T>::Max(a.fHi, b.fHi));
}
+ SkNx abs() const { return SkNx(fLo.abs(), fHi.abs()); }
+
SkNx sqrt() const { return SkNx(fLo.sqrt(), fHi.sqrt()); }
// Generally, increasing precision, increasing cost.
SkNx rsqrt0() const { return SkNx(fLo.rsqrt0(), fHi.rsqrt0()); }
@@ -134,6 +136,8 @@ public:
static SkNx Min(const SkNx& a, const SkNx& b) { return SkNx(SkTMin(a.fVal, b.fVal)); }
static SkNx Max(const SkNx& a, const SkNx& b) { return SkNx(SkTMax(a.fVal, b.fVal)); }
+ SkNx abs() const { return SkTAbs(fVal); }
+
SkNx sqrt () const { return SkNx(Sqrt(fVal)); }
SkNx rsqrt0() const { return this->sqrt().invert(); }
SkNx rsqrt1() const { return this->rsqrt0(); }
« no previous file with comments | « no previous file | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698