From f684a78d9ea988883c9b2c7bcc4ea4d5e68bd998 Mon Sep 17 00:00:00 2001 From: mtklein Date: Thu, 30 Jul 2015 09:29:37 -0700 Subject: Runtime CPU detection for rsqrt(). This enables the NEON sk_float_rsqrt() code for configurations that have NEON at run-time but not compile-time. These devices will see about a 2x (1.26 -> 2.33) slowdown in sk_float_rsqrt(), but it should be more precise than our portable fallback. (When inlined, the portable fallback and the NEON code are almost identical in speed. The only difference is precision. Going through a function pointer is causing all this slowdown. This is a good example of a place where Skia really benefits from compile-time NEON.) BUG=skia:4117,skia:4114 No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1264893002 --- src/core/SkOpts.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core/SkOpts.h') diff --git a/src/core/SkOpts.h b/src/core/SkOpts.h index 71abae5d7a..f02ec97553 100644 --- a/src/core/SkOpts.h +++ b/src/core/SkOpts.h @@ -16,7 +16,10 @@ namespace SkOpts { // Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS. void Init(); - // (Function pointers go here). + // Declare function pointers here... + + // Returns a fast approximation of 1.0f/sqrtf(x). + extern float (*rsqrt)(float); } #endif//SkOpts_DEFINED -- cgit v1.2.3