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

Side by Side Diff: base/atomicops_internals_arm64_gcc.h

Issue 237963017: Fix a bug in Arm64 atomicops. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is an internal atomic implementation, use base/atomicops.h instead. 5 // This file is an internal atomic implementation, use base/atomicops.h instead.
6 6
7 // TODO(rmcilroy): Investigate whether we can use __sync__ intrinsics instead of 7 // TODO(rmcilroy): Investigate whether we can use __sync__ intrinsics instead of
8 // the hand coded assembly without introducing perf regressions. 8 // the hand coded assembly without introducing perf regressions.
9 // TODO(rmcilroy): Investigate whether we can use acquire / release versions of 9 // TODO(rmcilroy): Investigate whether we can use acquire / release versions of
10 // exclusive load / store assembly instructions and do away with 10 // exclusive load / store assembly instructions and do away with
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 : [value]"r" (value) 277 : [value]"r" (value)
278 : "memory" 278 : "memory"
279 ); // NOLINT 279 ); // NOLINT
280 } 280 }
281 281
282 inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { 282 inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
283 return *ptr; 283 return *ptr;
284 } 284 }
285 285
286 inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { 286 inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
287 Atomic32 value; 287 Atomic64 value;
288 288
289 __asm__ __volatile__ ( // NOLINT 289 __asm__ __volatile__ ( // NOLINT
290 "ldar %x[value], %[ptr] \n\t" 290 "ldar %x[value], %[ptr] \n\t"
291 : [value]"=r" (value) 291 : [value]"=r" (value)
292 : [ptr]"Q" (*ptr) 292 : [ptr]"Q" (*ptr)
293 : "memory" 293 : "memory"
294 ); // NOLINT 294 ); // NOLINT
295 295
296 return value; 296 return value;
297 } 297 }
298 298
299 inline Atomic64 Release_Load(volatile const Atomic64* ptr) { 299 inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
300 MemoryBarrier(); 300 MemoryBarrier();
301 return *ptr; 301 return *ptr;
302 } 302 }
303 303
304 } // namespace base::subtle 304 } // namespace base::subtle
305 } // namespace base 305 } // namespace base
306 306
307 #endif // BASE_ATOMICOPS_INTERNALS_ARM64_GCC_H_ 307 #endif // BASE_ATOMICOPS_INTERNALS_ARM64_GCC_H_
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