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

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

Issue 272503006: Improved x86 SSE build and run-time checks. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | src/opts/opts_check_x86.cpp » ('j') | src/opts/opts_check_x86.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 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 9
10 #ifndef SkPreConfig_DEFINED 10 #ifndef SkPreConfig_DEFINED
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 * SK_CPU_SSE_LEVEL 116 * SK_CPU_SSE_LEVEL
117 * 117 *
118 * If defined, SK_CPU_SSE_LEVEL should be set to the highest supported level. 118 * If defined, SK_CPU_SSE_LEVEL should be set to the highest supported level.
119 * On non-intel CPU this should be undefined. 119 * On non-intel CPU this should be undefined.
120 */ 120 */
121 121
122 #define SK_CPU_SSE_LEVEL_SSE1 10 122 #define SK_CPU_SSE_LEVEL_SSE1 10
123 #define SK_CPU_SSE_LEVEL_SSE2 20 123 #define SK_CPU_SSE_LEVEL_SSE2 20
124 #define SK_CPU_SSE_LEVEL_SSE3 30 124 #define SK_CPU_SSE_LEVEL_SSE3 30
125 #define SK_CPU_SSE_LEVEL_SSSE3 31 125 #define SK_CPU_SSE_LEVEL_SSSE3 31
126 #define SK_CPU_SSE_LEVEL_SSE41 41
127 #define SK_CPU_SSE_LEVEL_SSE42 42
126 128
127 // Are we in GCC? 129 // Are we in GCC?
128 #ifndef SK_CPU_SSE_LEVEL 130 #ifndef SK_CPU_SSE_LEVEL
129 // 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
130 // available SSE level. 132 // available SSE level.
131 #if defined(__SSSE3__) 133 #if defined(__SSE4_2__) || defined(__SSE4__)
mtklein 2014/05/07 17:34:41 Are there compilers where __SSE4_2__ isn't defined
henrik.smiding 2014/05/08 11:02:46 As far as I can remember gcc used to set __SSE4__
henrik.smiding 2014/05/08 11:02:46 Done.
134 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE42
135 #elif defined(__SSE4_1__)
136 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE41
137 #elif defined(__SSSE3__)
132 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSSE3 138 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSSE3
133 #elif defined(__SSE3__) 139 #elif defined(__SSE3__)
134 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE3 140 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE3
135 #elif defined(__SSE2__) 141 #elif defined(__SSE2__)
136 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2 142 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2
137 #endif 143 #endif
138 #endif 144 #endif
139 145
140 // Are we in VisualStudio? 146 // Are we in VisualStudio?
141 #ifndef SK_CPU_SSE_LEVEL 147 #ifndef SK_CPU_SSE_LEVEL
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 * 253 *
248 * NOTE: Clang/ARM (r161757) does not support the 'optimize' attribute. 254 * NOTE: Clang/ARM (r161757) does not support the 'optimize' attribute.
249 */ 255 */
250 #if SK_HAS_ATTRIBUTE(optimize) 256 #if SK_HAS_ATTRIBUTE(optimize)
251 # define SK_ATTRIBUTE_OPTIMIZE_O1 __attribute__((optimize("O1"))) 257 # define SK_ATTRIBUTE_OPTIMIZE_O1 __attribute__((optimize("O1")))
252 #else 258 #else
253 # define SK_ATTRIBUTE_OPTIMIZE_O1 /* nothing */ 259 # define SK_ATTRIBUTE_OPTIMIZE_O1 /* nothing */
254 #endif 260 #endif
255 261
256 #endif 262 #endif
OLDNEW
« no previous file with comments | « no previous file | src/opts/opts_check_x86.cpp » ('j') | src/opts/opts_check_x86.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698