diff options
author | 2014-08-01 05:32:32 -0700 | |
---|---|---|
committer | 2014-08-01 05:32:32 -0700 | |
commit | 21769c52491b4e1c91cf7461af535aff2a1a18f7 (patch) | |
tree | a8f7ab836ce5aa2608237820aebf86445bbfa2e8 | |
parent | 490d49c5dcc4b2242c9b25f082b23ec5e842c4e7 (diff) |
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
-rw-r--r-- | gyp/common_conditions.gypi | 4 | ||||
-rw-r--r-- | include/core/SkFloatingPoint.h | 4 | ||||
-rw-r--r-- | include/core/SkPreConfig.h | 4 | ||||
-rw-r--r-- | src/core/SkUtilsArm.h | 4 |
4 files changed, 10 insertions, 6 deletions
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index abb47502b6..4fa1ba0cbd 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -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"', { diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h index 6e372d9519..5489bac215 100644 --- a/include/core/SkFloatingPoint.h +++ b/include/core/SkFloatingPoint.h @@ -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); diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index c7331113dc..7d368918a4 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -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) diff --git a/src/core/SkUtilsArm.h b/src/core/SkUtilsArm.h index 09ddaf3946..f15648136c 100644 --- a/src/core/SkUtilsArm.h +++ b/src/core/SkUtilsArm.h @@ -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 |