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

Side by Side Diff: include/private/SkTLogic.h

Issue 1489873002: check that SSE2 is available before using __vectorcall (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years 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 | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 * This header provides some of the helpers (std::integral_constant) and 8 * This header provides some of the helpers (std::integral_constant) and
9 * type transformations (std::conditional) which will become available with 9 * type transformations (std::conditional) which will become available with
10 * C++11 in the type_traits header. 10 * C++11 in the type_traits header.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // The cv and ref-qualified versions are strange types we're currently avoiding, so not supported. 116 // The cv and ref-qualified versions are strange types we're currently avoiding, so not supported.
117 // On all platforms, variadic functions only exist in the c calling convention. 117 // On all platforms, variadic functions only exist in the c calling convention.
118 template <typename> struct is_function : false_type { }; 118 template <typename> struct is_function : false_type { };
119 #if !defined(SK_BUILD_FOR_WIN) 119 #if !defined(SK_BUILD_FOR_WIN)
120 template <typename R, typename... Args> struct is_function<R(Args...)> : true_ty pe {}; 120 template <typename R, typename... Args> struct is_function<R(Args...)> : true_ty pe {};
121 #else 121 #else
122 #if defined(_M_IX86) 122 #if defined(_M_IX86)
123 template <typename R, typename... Args> struct is_function<R __cdecl (Args...)> : true_type {}; 123 template <typename R, typename... Args> struct is_function<R __cdecl (Args...)> : true_type {};
124 template <typename R, typename... Args> struct is_function<R __stdcall (Args...) > : true_type {}; 124 template <typename R, typename... Args> struct is_function<R __stdcall (Args...) > : true_type {};
125 template <typename R, typename... Args> struct is_function<R __fastcall (Args... )> : true_type {}; 125 template <typename R, typename... Args> struct is_function<R __fastcall (Args... )> : true_type {};
126 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
126 template <typename R, typename... Args> struct is_function<R __vectorcall (Args. ..)> : true_type {}; 127 template <typename R, typename... Args> struct is_function<R __vectorcall (Args. ..)> : true_type {};
128 #endif
127 #else 129 #else
128 template <typename R, typename... Args> struct is_function<R __cdecl (Args...)> : true_type {}; 130 template <typename R, typename... Args> struct is_function<R __cdecl (Args...)> : true_type {};
129 template <typename R, typename... Args> struct is_function<R __vectorcall (Args. ..)> : true_type {}; 131 template <typename R, typename... Args> struct is_function<R __vectorcall (Args. ..)> : true_type {};
130 #endif 132 #endif
131 #endif 133 #endif
132 template <typename R, typename... Args> struct is_function<R(Args..., ...)> : tr ue_type {}; 134 template <typename R, typename... Args> struct is_function<R(Args..., ...)> : tr ue_type {};
133 135
134 template <typename T> struct add_const { using type = const T; }; 136 template <typename T> struct add_const { using type = const T; };
135 template <typename T> using add_const_t = typename add_const<T>::type; 137 template <typename T> using add_const_t = typename add_const<T>::type;
136 138
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 template <typename D, typename S> using same_volatile_t = typename same_volatile <D, S>::type; 219 template <typename D, typename S> using same_volatile_t = typename same_volatile <D, S>::type;
218 template <typename D, typename S> using same_cv = copy_cv<skstd::remove_cv_t<D>, S>; 220 template <typename D, typename S> using same_cv = copy_cv<skstd::remove_cv_t<D>, S>;
219 template <typename D, typename S> using same_cv_t = typename same_cv<D, S>::type ; 221 template <typename D, typename S> using same_cv_t = typename same_cv<D, S>::type ;
220 222
221 } // namespace sknonstd 223 } // namespace sknonstd
222 224
223 // Just a pithier wrapper for enable_if_t. 225 // Just a pithier wrapper for enable_if_t.
224 #define SK_WHEN(condition, T) skstd::enable_if_t<!!(condition), T> 226 #define SK_WHEN(condition, T) skstd::enable_if_t<!!(condition), T>
225 227
226 #endif 228 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698