Update NEON compiler defines to use SK_ prefix

BUG=skia:2785
R=mtklein@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/433513004
This commit is contained in:
djsollen 2014-08-01 05:32:32 -07:00 committed by Commit bot
parent 490d49c5dc
commit 21769c5249
4 changed files with 10 additions and 6 deletions

View File

@ -273,7 +273,7 @@
'conditions': [
[ 'arm_neon == 1', {
'defines': [
'__ARM_HAVE_NEON',
'SK_ARM_HAS_NEON',
],
'cflags': [
'-mfpu=neon',
@ -281,7 +281,7 @@
}],
[ 'arm_neon_optional == 1', {
'defines': [
'__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
'SK_ARM_HAS_OPTIONAL_NEON',
],
}],
[ 'skia_os != "chromeos"', {

View File

@ -120,7 +120,7 @@ extern const uint32_t gIEEENegativeInfinity;
#if defined(__SSE__)
#include <xmmintrin.h>
#elif defined(__ARM_NEON__)
#elif defined(SK_ARM_HAS_NEON)
#include <arm_neon.h>
#endif
@ -136,7 +136,7 @@ static inline float sk_float_rsqrt(const float x) {
float result;
_mm_store_ss(&result, _mm_rsqrt_ss(_mm_set_ss(x)));
return result;
#elif defined(__ARM_NEON__)
#elif defined(SK_ARM_HAS_NEON)
// Get initial estimate.
const float32x2_t xx = vdup_n_f32(x); // Clever readers will note we're doing everything 2x.
float32x2_t estimate = vrsqrte_f32(xx);

View File

@ -197,6 +197,10 @@
#define SK_CPU_ARM64
#endif
#if !defined(SK_ARM_HAS_NEON) && defined(__ARM_NEON__)
#define SK_ARM_HAS_NEON
#endif
//////////////////////////////////////////////////////////////////////
#if !defined(SKIA_IMPLEMENTATION)

View File

@ -21,9 +21,9 @@
#define SK_ARM_NEON_MODE_ALWAYS 1
#define SK_ARM_NEON_MODE_DYNAMIC 2
#if defined(SK_CPU_ARM32) && defined(__ARM_HAVE_OPTIONAL_NEON_SUPPORT)
#if defined(SK_CPU_ARM32) && defined(SK_ARM_HAS_OPTIONAL_NEON)
# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_DYNAMIC
#elif defined(SK_CPU_ARM32) && defined(__ARM_HAVE_NEON) || defined(SK_CPU_ARM64)
#elif defined(SK_CPU_ARM32) && defined(SK_ARM_HAS_NEON) || defined(SK_CPU_ARM64)
# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_ALWAYS
#else
# define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_NONE