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(); ) |