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

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: Check for undefined SSE flag 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') | 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 /* 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__)
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
mtklein 2014/05/08 16:55:08 Am I thinking right that this means this block isn
henrik.smiding 2014/05/09 08:30:29 It's probably working as intended when building 32
142 // These checks must be done in descending order to ensure we set the highes t 148 // These checks must be done in descending order to ensure we set the highes t
143 // available SSE level. 149 // available SSE level.
144 #if defined (_M_IX86_FP) 150 #if defined (_M_IX86_FP)
145 #if _M_IX86_FP >= 2 151 #if _M_IX86_FP >= 2
146 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2 152 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2
147 #elif _M_IX86_FP == 1 153 #elif _M_IX86_FP == 1
148 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE1 154 #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE1
149 #endif 155 #endif
150 #endif 156 #endif
151 #endif 157 #endif
(...skipping 95 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698