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

Unified Diff: bench/MathBench.cpp

Issue 60083014: Add sk_float_rsqrt with SSE + NEON fast paths. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: test Created 7 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 | « no previous file | include/core/SkFloatingPoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/MathBench.cpp
diff --git a/bench/MathBench.cpp b/bench/MathBench.cpp
index abe04e13d705cd97bb90bfe80a176fc34b0bbe79..6327c3c580c1c55c5062d22ca2ba5c6a3b03b4fd 100644
--- a/bench/MathBench.cpp
+++ b/bench/MathBench.cpp
@@ -92,6 +92,22 @@ private:
typedef MathBench INHERITED;
};
+class SkRSqrtMathBench : public MathBench {
+public:
+ SkRSqrtMathBench() : INHERITED("sk_float_rsqrt") {}
+protected:
+ virtual void performTest(float* SK_RESTRICT dst,
+ const float* SK_RESTRICT src,
+ int count) {
+ for (int i = 0; i < count; ++i) {
+ dst[i] = sk_float_rsqrt(src[i]);
+ }
+ }
+private:
+ typedef MathBench INHERITED;
+};
+
+
class SlowISqrtMathBench : public MathBench {
public:
SlowISqrtMathBench() : INHERITED("slowIsqrt") {}
@@ -550,6 +566,7 @@ DEF_BENCH(return new DivModBench<int64_t>("int64_t"))
///////////////////////////////////////////////////////////////////////////////
DEF_BENCH( return new NoOpMathBench(); )
+DEF_BENCH( return new SkRSqrtMathBench(); )
DEF_BENCH( return new SlowISqrtMathBench(); )
DEF_BENCH( return new FastISqrtMathBench(); )
DEF_BENCH( return new QMul64Bench(); )
« no previous file with comments | « no previous file | include/core/SkFloatingPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698