Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: include/core/SkPreConfig.h

Issue 2002423002: [GN] Add support for disabling opts via SK_BUILD_NO_OPTS define. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/common_conditions.gypi ('k') | public.bzl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 // IWYU pragma: private, include "SkTypes.h" 8 // IWYU pragma: private, include "SkTypes.h"
9 9
10 #ifndef SkPreConfig_DEFINED 10 #ifndef SkPreConfig_DEFINED
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 #define SK_CPU_SSE_LEVEL_SSE1 10 112 #define SK_CPU_SSE_LEVEL_SSE1 10
113 #define SK_CPU_SSE_LEVEL_SSE2 20 113 #define SK_CPU_SSE_LEVEL_SSE2 20
114 #define SK_CPU_SSE_LEVEL_SSE3 30 114 #define SK_CPU_SSE_LEVEL_SSE3 30
115 #define SK_CPU_SSE_LEVEL_SSSE3 31 115 #define SK_CPU_SSE_LEVEL_SSSE3 31
116 #define SK_CPU_SSE_LEVEL_SSE41 41 116 #define SK_CPU_SSE_LEVEL_SSE41 41
117 #define SK_CPU_SSE_LEVEL_SSE42 42 117 #define SK_CPU_SSE_LEVEL_SSE42 42
118 #define SK_CPU_SSE_LEVEL_AVX 51 118 #define SK_CPU_SSE_LEVEL_AVX 51
119 #define SK_CPU_SSE_LEVEL_AVX2 52 119 #define SK_CPU_SSE_LEVEL_AVX2 52
120 120
121 #ifdef SK_BUILD_FOR_IOS 121 // When targetting iOS and using gyp to generate the build files, it is not
122 #define SK_CPU_SSE_LEVEL 0 // We're tired of fighting with opts/ and iOS si mulator. 122 // possible to select files to build depending on the architecture (i.e. it
123 // is not possible to use hand optimized assembly implementation). In that
124 // configuration SK_BUILD_NO_OPTS is defined. Remove optimisation then.
125 #ifdef SK_BUILD_NO_OPTS
126 #define SK_CPU_SSE_LEVEL 0
123 #endif 127 #endif
124 128
125 // Are we in GCC? 129 // Are we in GCC?
126 #ifndef SK_CPU_SSE_LEVEL 130 #ifndef SK_CPU_SSE_LEVEL
127 // These checks must be done in descending order to ensure we set the highes t 131 // These checks must be done in descending order to ensure we set the highes t
128 // available SSE level. 132 // available SSE level.
129 #if defined(__AVX2__) 133 #if defined(__AVX2__)
130 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX2 134 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX2
131 #elif defined(__AVX__) 135 #elif defined(__AVX__)
132 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX 136 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 || defined(__ARM_ARCH_5TEJ__) || defined(_ARM_ARCH_5) 187 || defined(__ARM_ARCH_5TEJ__) || defined(_ARM_ARCH_5)
184 #define SK_ARM_ARCH 5 188 #define SK_ARM_ARCH 5
185 #elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(_AR M_ARCH_4) 189 #elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(_AR M_ARCH_4)
186 #define SK_ARM_ARCH 4 190 #define SK_ARM_ARCH 4
187 #else 191 #else
188 #define SK_ARM_ARCH 3 192 #define SK_ARM_ARCH 3
189 #endif 193 #endif
190 #endif 194 #endif
191 #endif 195 #endif
192 196
193 // Disable ARM64 optimizations for iOS due to complications regarding gyp and iO S. 197 #if defined(__aarch64__) && !defined(SK_BUILD_NO_OPTS)
194 #if defined(__aarch64__) && !defined(SK_BUILD_FOR_IOS)
195 #define SK_CPU_ARM64 198 #define SK_CPU_ARM64
196 #endif 199 #endif
197 200
198 // All 64-bit ARM chips have NEON. Many 32-bit ARM chips do too. 201 // All 64-bit ARM chips have NEON. Many 32-bit ARM chips do too.
199 // TODO: Why don't we want NEON on iOS? 202 #if !defined(SK_ARM_HAS_NEON) && !defined(SK_BUILD_NO_OPTS) && (defined(__ARM_NE ON__) || defined(__ARM_NEON))
200 #if !defined(SK_ARM_HAS_NEON) && !defined(SK_BUILD_FOR_IOS) && (defined(__ARM_NE ON__) || defined(__ARM_NEON))
201 #define SK_ARM_HAS_NEON 203 #define SK_ARM_HAS_NEON
202 #endif 204 #endif
203 205
204 ////////////////////////////////////////////////////////////////////// 206 //////////////////////////////////////////////////////////////////////
205 207
206 #if !defined(SKIA_IMPLEMENTATION) 208 #if !defined(SKIA_IMPLEMENTATION)
207 #define SKIA_IMPLEMENTATION 0 209 #define SKIA_IMPLEMENTATION 0
208 #endif 210 #endif
209 211
210 #if defined(SKIA_DLL) 212 #if defined(SKIA_DLL)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 * 261 *
260 * NOTE: Clang/ARM (r161757) does not support the 'optimize' attribute. 262 * NOTE: Clang/ARM (r161757) does not support the 'optimize' attribute.
261 */ 263 */
262 #if SK_HAS_ATTRIBUTE(optimize) 264 #if SK_HAS_ATTRIBUTE(optimize)
263 # define SK_ATTRIBUTE_OPTIMIZE_O1 __attribute__((optimize("O1"))) 265 # define SK_ATTRIBUTE_OPTIMIZE_O1 __attribute__((optimize("O1")))
264 #else 266 #else
265 # define SK_ATTRIBUTE_OPTIMIZE_O1 /* nothing */ 267 # define SK_ATTRIBUTE_OPTIMIZE_O1 /* nothing */
266 #endif 268 #endif
267 269
268 #endif 270 #endif
OLDNEW
« no previous file with comments | « gyp/common_conditions.gypi ('k') | public.bzl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698