7eb0945af2
With this new arrangement, the benefits of inlining sk_memset16/32 have changed. On x86, they're not significantly different, except for small N<=10 where the inlined code is significantly slower. On ARMv7 with NEON, our custom code is still significantly faster for N>10 (up to 2x faster). For small N<=10 inlining is still significantly faster. On ARMv7 without NEON, our custom code is still ridiculously faster (up to 10x) than inlining for N>10, though for small N<=10 inlining is still a little faster. We were not using the NEON memset16 and memset32 procs on ARMv8. At first blush, that seems to be an oversight, but if so it's an extremely lucky one. The ARMv8 code generation for our memset16/32 procs is total garbage, leaving those methods ~8x slower than just inlining the memset, using the compiler's autovectorization. So, no need to inline any more on x86, and still inline for N<=10 on ARMv7. Always inline for ARMv8. BUG=skia:4117 Review URL: https://codereview.chromium.org/1270573002
30 lines
767 B
C++
30 lines
767 B
C++
/*
|
|
* Copyright 2015 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkOpts_DEFINED
|
|
#define SkOpts_DEFINED
|
|
|
|
#include "SkTypes.h"
|
|
|
|
namespace SkOpts {
|
|
// Call to replace pointers to portable functions with pointers to CPU-specific functions.
|
|
// Thread-safe and idempotent.
|
|
// Called by SkGraphics::Init(), and automatically #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS.
|
|
void Init();
|
|
|
|
// Declare function pointers here...
|
|
|
|
// Returns a fast approximation of 1.0f/sqrtf(x).
|
|
extern float (*rsqrt)(float);
|
|
|
|
// See SkUtils.h
|
|
extern void (*memset16)(uint16_t[], uint16_t, int);
|
|
extern void (*memset32)(uint32_t[], uint32_t, int);
|
|
}
|
|
|
|
#endif//SkOpts_DEFINED
|