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

Side by Side Diff: src/base/cpu.cc

Issue 1799263002: Fix a warning about inline asm source/destination mismatches for cache_type_register_. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project 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 #include "src/base/cpu.h" 5 #include "src/base/cpu.h"
6 6
7 #if V8_LIBC_MSVCRT 7 #if V8_LIBC_MSVCRT
8 #include <intrin.h> // __cpuid() 8 #include <intrin.h> // __cpuid()
9 #endif 9 #endif
10 #if V8_OS_LINUX 10 #if V8_OS_LINUX
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 || V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64 78 || V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
79 79
80 #if V8_HOST_ARCH_ARM64 80 #if V8_HOST_ARCH_ARM64
81 class CacheLineSizes { 81 class CacheLineSizes {
82 public: 82 public:
83 CacheLineSizes() { 83 CacheLineSizes() {
84 #ifdef USE_SIMULATOR 84 #ifdef USE_SIMULATOR
85 cache_type_register_ = 0; 85 cache_type_register_ = 0;
86 #else 86 #else
87 // Copy the content of the cache type register to a core register. 87 // Copy the content of the cache type register to a core register.
88 __asm__ __volatile__("mrs %[ctr], ctr_el0" // NOLINT 88 __asm__ __volatile__("mrs %x[ctr], ctr_el0" // NOLINT
89 : [ctr] "=r"(cache_type_register_)); 89 : [ctr] "=r"(cache_type_register_));
90 #endif 90 #endif
91 } 91 }
92 92
93 uint32_t icache_line_size() const { return ExtractCacheLineSize(0); } 93 uint32_t icache_line_size() const { return ExtractCacheLineSize(0); }
94 uint32_t dcache_line_size() const { return ExtractCacheLineSize(16); } 94 uint32_t dcache_line_size() const { return ExtractCacheLineSize(16); }
95 95
96 private: 96 private:
97 uint32_t ExtractCacheLineSize(int cache_line_size_shift) const { 97 uint32_t ExtractCacheLineSize(int cache_line_size_shift) const {
98 // The cache type register holds the size of cache lines in words as a 98 // The cache type register holds the size of cache lines in words as a
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 part_ = PPC_POWER5; 726 part_ = PPC_POWER5;
727 break; 727 break;
728 } 728 }
729 #endif // V8_OS_AIX 729 #endif // V8_OS_AIX
730 #endif // !USE_SIMULATOR 730 #endif // !USE_SIMULATOR
731 #endif // V8_HOST_ARCH_PPC 731 #endif // V8_HOST_ARCH_PPC
732 } 732 }
733 733
734 } // namespace base 734 } // namespace base
735 } // namespace v8 735 } // namespace v8
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