| OLD | NEW |
| 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 Loading... |
| 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_ |
| OLD | NEW |