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

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

Issue 143423004: ARM Skia NEON patches - 35 - First AArch64 support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Some more gyp file tuning Created 6 years, 8 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/opts.gyp ('k') | include/core/SkPreConfig.h » ('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 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 #ifndef SkOnce_DEFINED 8 #ifndef SkOnce_DEFINED
9 #define SkOnce_DEFINED 9 #define SkOnce_DEFINED
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 inline static void compiler_barrier() { 78 inline static void compiler_barrier() {
79 _ReadWriteBarrier(); 79 _ReadWriteBarrier();
80 } 80 }
81 #else 81 #else
82 inline static void compiler_barrier() { 82 inline static void compiler_barrier() {
83 asm volatile("" : : : "memory"); 83 asm volatile("" : : : "memory");
84 } 84 }
85 #endif 85 #endif
86 86
87 inline static void full_barrier_on_arm() { 87 inline static void full_barrier_on_arm() {
88 #ifdef SK_CPU_ARM 88 #if (defined(SK_CPU_ARM) && SK_ARM_ARCH >= 7) || defined(SK_CPU_ARM64)
89 # if SK_ARM_ARCH >= 7 89 asm volatile("dmb ish" : : : "memory");
90 asm volatile("dmb" : : : "memory"); 90 #elif defined(SK_CPU_ARM)
91 # else
92 asm volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); 91 asm volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
93 # endif
94 #endif 92 #endif
95 } 93 }
96 94
97 // On every platform, we issue a compiler barrier to prevent it from reordering 95 // On every platform, we issue a compiler barrier to prevent it from reordering
98 // code. That's enough for platforms like x86 where release and acquire 96 // code. That's enough for platforms like x86 where release and acquire
99 // barriers are no-ops. On other platforms we may need to be more careful; 97 // barriers are no-ops. On other platforms we may need to be more careful;
100 // ARM, in particular, needs real code for both acquire and release. We use a 98 // ARM, in particular, needs real code for both acquire and release. We use a
101 // full barrier, which acts as both, because that the finest precision ARM 99 // full barrier, which acts as both, because that the finest precision ARM
102 // provides. 100 // provides.
103 101
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 168 }
171 169
172 template <typename Func, typename Arg> 170 template <typename Func, typename Arg>
173 inline void SkOnce(SkOnceFlag* once, Func f, Arg arg, void(*atExit)()) { 171 inline void SkOnce(SkOnceFlag* once, Func f, Arg arg, void(*atExit)()) {
174 return SkOnce(&once->done, &once->lock, f, arg, atExit); 172 return SkOnce(&once->done, &once->lock, f, arg, atExit);
175 } 173 }
176 174
177 #undef SK_ANNOTATE_BENIGN_RACE 175 #undef SK_ANNOTATE_BENIGN_RACE
178 176
179 #endif // SkOnce_DEFINED 177 #endif // SkOnce_DEFINED
OLDNEW
« no previous file with comments | « gyp/opts.gyp ('k') | include/core/SkPreConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698