OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 The Android Open Source Project | 3 * Copyright 2012 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkUtilsArm_DEFINED | 9 #ifndef SkUtilsArm_DEFINED |
10 #define SkUtilsArm_DEFINED | 10 #define SkUtilsArm_DEFINED |
11 | 11 |
12 #include "SkUtils.h" | 12 #include "SkUtils.h" |
13 | 13 |
14 // Define SK_ARM_NEON_MODE to one of the following values | 14 // Define SK_ARM_NEON_MODE to one of the following values |
15 // corresponding respectively to: | 15 // corresponding respectively to: |
16 // - No ARM Neon support at all (not targetting ARMv7-A, or don't have NEON) | 16 // - No ARM Neon support at all (not targetting ARMv7-A, or don't have NEON) |
17 // - Full ARM Neon support (i.e. assume the CPU always supports it) | 17 // - Full ARM Neon support (i.e. assume the CPU always supports it) |
18 // - Optional ARM Neon support (i.e. probe CPU at runtime) | 18 // - Optional ARM Neon support (i.e. probe CPU at runtime) |
19 // | 19 // |
20 #define SK_ARM_NEON_MODE_NONE 0 | 20 #define SK_ARM_NEON_MODE_NONE 0 |
21 #define SK_ARM_NEON_MODE_ALWAYS 1 | 21 #define SK_ARM_NEON_MODE_ALWAYS 1 |
22 #define SK_ARM_NEON_MODE_DYNAMIC 2 | 22 #define SK_ARM_NEON_MODE_DYNAMIC 2 |
23 | 23 |
24 #if defined(SK_CPU_ARM) && defined(__ARM_HAVE_OPTIONAL_NEON_SUPPORT) | 24 #if defined(SK_CPU_ARM) && defined(__ARM_HAVE_OPTIONAL_NEON_SUPPORT) |
25 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_DYNAMIC | 25 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_DYNAMIC |
26 /* b/14056351 - temporarily disable NEON support for arm64 */ | |
27 #elif defined(SK_CPU_ARM64) && defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) | |
28 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_NONE | |
29 #elif defined(SK_CPU_ARM) && defined(__ARM_HAVE_NEON) || defined(SK_CPU_ARM64) | 26 #elif defined(SK_CPU_ARM) && defined(__ARM_HAVE_NEON) || defined(SK_CPU_ARM64) |
30 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_ALWAYS | 27 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_ALWAYS |
31 #else | 28 #else |
32 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_NONE | 29 # define SK_ARM_NEON_MODE SK_ARM_NEON_MODE_NONE |
33 #endif | 30 #endif |
34 | 31 |
35 // Convenience test macros, always defined as 0 or 1 | 32 // Convenience test macros, always defined as 0 or 1 |
36 #define SK_ARM_NEON_IS_NONE (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_NONE) | 33 #define SK_ARM_NEON_IS_NONE (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_NONE) |
37 #define SK_ARM_NEON_IS_ALWAYS (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_ALWAYS) | 34 #define SK_ARM_NEON_IS_ALWAYS (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_ALWAYS) |
38 #define SK_ARM_NEON_IS_DYNAMIC (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_DYNAMIC) | 35 #define SK_ARM_NEON_IS_DYNAMIC (SK_ARM_NEON_MODE == SK_ARM_NEON_MODE_DYNAMIC) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // | 78 // |
82 #if SK_ARM_NEON_IS_NONE | 79 #if SK_ARM_NEON_IS_NONE |
83 # define SK_ARM_NEON_WRAP(x) (x) | 80 # define SK_ARM_NEON_WRAP(x) (x) |
84 #elif SK_ARM_NEON_IS_ALWAYS | 81 #elif SK_ARM_NEON_IS_ALWAYS |
85 # define SK_ARM_NEON_WRAP(x) (x ## _neon) | 82 # define SK_ARM_NEON_WRAP(x) (x ## _neon) |
86 #elif SK_ARM_NEON_IS_DYNAMIC | 83 #elif SK_ARM_NEON_IS_DYNAMIC |
87 # define SK_ARM_NEON_WRAP(x) (sk_cpu_arm_has_neon() ? x ## _neon : x) | 84 # define SK_ARM_NEON_WRAP(x) (sk_cpu_arm_has_neon() ? x ## _neon : x) |
88 #endif | 85 #endif |
89 | 86 |
90 #endif // SkUtilsArm_DEFINED | 87 #endif // SkUtilsArm_DEFINED |
OLD | NEW |