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

Side by Side Diff: src/register-configuration.cc

Issue 2410673002: [Turbofan] Add concept of FP register aliasing on ARM 32. (Closed)
Patch Set: Add a TODO. Created 4 years, 1 month 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 | « src/register-configuration.h ('k') | src/zone/zone-allocator.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 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/register-configuration.h" 5 #include "src/register-configuration.h"
6 #include "src/globals.h" 6 #include "src/globals.h"
7 #include "src/macro-assembler.h" 7 #include "src/macro-assembler.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 enum CompilerSelector { CRANKSHAFT, TURBOFAN }; 63 enum CompilerSelector { CRANKSHAFT, TURBOFAN };
64 64
65 class ArchDefaultRegisterConfiguration : public RegisterConfiguration { 65 class ArchDefaultRegisterConfiguration : public RegisterConfiguration {
66 public: 66 public:
67 explicit ArchDefaultRegisterConfiguration(CompilerSelector compiler) 67 explicit ArchDefaultRegisterConfiguration(CompilerSelector compiler)
68 : RegisterConfiguration( 68 : RegisterConfiguration(
69 Register::kNumRegisters, DoubleRegister::kMaxNumRegisters, 69 Register::kNumRegisters, DoubleRegister::kMaxNumRegisters,
70 #if V8_TARGET_ARCH_IA32 70 #if V8_TARGET_ARCH_IA32
71 kMaxAllocatableGeneralRegisterCount, 71 kMaxAllocatableGeneralRegisterCount,
72 kMaxAllocatableDoubleRegisterCount, 72 kMaxAllocatableDoubleRegisterCount,
73 kMaxAllocatableDoubleRegisterCount,
74 #elif V8_TARGET_ARCH_X87 73 #elif V8_TARGET_ARCH_X87
75 kMaxAllocatableGeneralRegisterCount, 74 kMaxAllocatableGeneralRegisterCount,
76 compiler == TURBOFAN ? 1 : kMaxAllocatableDoubleRegisterCount, 75 compiler == TURBOFAN ? 1 : kMaxAllocatableDoubleRegisterCount,
77 compiler == TURBOFAN ? 1 : kMaxAllocatableDoubleRegisterCount,
78 #elif V8_TARGET_ARCH_X64 76 #elif V8_TARGET_ARCH_X64
79 kMaxAllocatableGeneralRegisterCount, 77 kMaxAllocatableGeneralRegisterCount,
80 kMaxAllocatableDoubleRegisterCount, 78 kMaxAllocatableDoubleRegisterCount,
81 kMaxAllocatableDoubleRegisterCount,
82 #elif V8_TARGET_ARCH_ARM 79 #elif V8_TARGET_ARCH_ARM
83 FLAG_enable_embedded_constant_pool 80 FLAG_enable_embedded_constant_pool
84 ? (kMaxAllocatableGeneralRegisterCount - 1) 81 ? (kMaxAllocatableGeneralRegisterCount - 1)
85 : kMaxAllocatableGeneralRegisterCount, 82 : kMaxAllocatableGeneralRegisterCount,
86 CpuFeatures::IsSupported(VFP32DREGS) 83 CpuFeatures::IsSupported(VFP32DREGS)
87 ? kMaxAllocatableDoubleRegisterCount 84 ? kMaxAllocatableDoubleRegisterCount
88 : (ALLOCATABLE_NO_VFP32_DOUBLE_REGISTERS(REGISTER_COUNT) 0), 85 : (ALLOCATABLE_NO_VFP32_DOUBLE_REGISTERS(REGISTER_COUNT) 0),
89 ALLOCATABLE_NO_VFP32_DOUBLE_REGISTERS(REGISTER_COUNT) 0,
90 #elif V8_TARGET_ARCH_ARM64 86 #elif V8_TARGET_ARCH_ARM64
91 kMaxAllocatableGeneralRegisterCount, 87 kMaxAllocatableGeneralRegisterCount,
92 kMaxAllocatableDoubleRegisterCount, 88 kMaxAllocatableDoubleRegisterCount,
93 kMaxAllocatableDoubleRegisterCount,
94 #elif V8_TARGET_ARCH_MIPS 89 #elif V8_TARGET_ARCH_MIPS
95 kMaxAllocatableGeneralRegisterCount, 90 kMaxAllocatableGeneralRegisterCount,
96 kMaxAllocatableDoubleRegisterCount, 91 kMaxAllocatableDoubleRegisterCount,
97 kMaxAllocatableDoubleRegisterCount,
98 #elif V8_TARGET_ARCH_MIPS64 92 #elif V8_TARGET_ARCH_MIPS64
99 kMaxAllocatableGeneralRegisterCount, 93 kMaxAllocatableGeneralRegisterCount,
100 kMaxAllocatableDoubleRegisterCount, 94 kMaxAllocatableDoubleRegisterCount,
101 kMaxAllocatableDoubleRegisterCount,
102 #elif V8_TARGET_ARCH_PPC 95 #elif V8_TARGET_ARCH_PPC
103 kMaxAllocatableGeneralRegisterCount, 96 kMaxAllocatableGeneralRegisterCount,
104 kMaxAllocatableDoubleRegisterCount, 97 kMaxAllocatableDoubleRegisterCount,
105 kMaxAllocatableDoubleRegisterCount,
106 #elif V8_TARGET_ARCH_S390 98 #elif V8_TARGET_ARCH_S390
107 kMaxAllocatableGeneralRegisterCount, 99 kMaxAllocatableGeneralRegisterCount,
108 kMaxAllocatableDoubleRegisterCount, 100 kMaxAllocatableDoubleRegisterCount,
109 kMaxAllocatableDoubleRegisterCount,
110 #else 101 #else
111 #error Unsupported target architecture. 102 #error Unsupported target architecture.
112 #endif 103 #endif
113 kAllocatableGeneralCodes, kAllocatableDoubleCodes, 104 kAllocatableGeneralCodes, kAllocatableDoubleCodes,
114 kSimpleFPAliasing ? AliasingKind::OVERLAP : AliasingKind::COMBINE, 105 kSimpleFPAliasing ? AliasingKind::OVERLAP : AliasingKind::COMBINE,
115 kGeneralRegisterNames, kFloatRegisterNames, kDoubleRegisterNames, 106 kGeneralRegisterNames, kFloatRegisterNames, kDoubleRegisterNames,
116 kSimd128RegisterNames) { 107 kSimd128RegisterNames) {
117 } 108 }
118 }; 109 };
119 110
(...skipping 18 matching lines...) Expand all
138 return &kDefaultRegisterConfigurationForCrankshaft.Get(); 129 return &kDefaultRegisterConfigurationForCrankshaft.Get();
139 } 130 }
140 131
141 const RegisterConfiguration* RegisterConfiguration::Turbofan() { 132 const RegisterConfiguration* RegisterConfiguration::Turbofan() {
142 return &kDefaultRegisterConfigurationForTurboFan.Get(); 133 return &kDefaultRegisterConfigurationForTurboFan.Get();
143 } 134 }
144 135
145 RegisterConfiguration::RegisterConfiguration( 136 RegisterConfiguration::RegisterConfiguration(
146 int num_general_registers, int num_double_registers, 137 int num_general_registers, int num_double_registers,
147 int num_allocatable_general_registers, int num_allocatable_double_registers, 138 int num_allocatable_general_registers, int num_allocatable_double_registers,
148 int num_allocatable_aliased_double_registers,
149 const int* allocatable_general_codes, const int* allocatable_double_codes, 139 const int* allocatable_general_codes, const int* allocatable_double_codes,
150 AliasingKind fp_aliasing_kind, const char* const* general_register_names, 140 AliasingKind fp_aliasing_kind, const char* const* general_register_names,
151 const char* const* float_register_names, 141 const char* const* float_register_names,
152 const char* const* double_register_names, 142 const char* const* double_register_names,
153 const char* const* simd128_register_names) 143 const char* const* simd128_register_names)
154 : num_general_registers_(num_general_registers), 144 : num_general_registers_(num_general_registers),
155 num_float_registers_(0), 145 num_float_registers_(0),
156 num_double_registers_(num_double_registers), 146 num_double_registers_(num_double_registers),
157 num_simd128_registers_(0), 147 num_simd128_registers_(0),
158 num_allocatable_general_registers_(num_allocatable_general_registers), 148 num_allocatable_general_registers_(num_allocatable_general_registers),
159 num_allocatable_float_registers_(0), 149 num_allocatable_float_registers_(0),
160 num_allocatable_double_registers_(num_allocatable_double_registers), 150 num_allocatable_double_registers_(num_allocatable_double_registers),
161 num_allocatable_aliased_double_registers_(
162 num_allocatable_aliased_double_registers),
163 num_allocatable_simd128_registers_(0), 151 num_allocatable_simd128_registers_(0),
164 allocatable_general_codes_mask_(0), 152 allocatable_general_codes_mask_(0),
165 allocatable_float_codes_mask_(0), 153 allocatable_float_codes_mask_(0),
166 allocatable_double_codes_mask_(0), 154 allocatable_double_codes_mask_(0),
167 allocatable_simd128_codes_mask_(0), 155 allocatable_simd128_codes_mask_(0),
168 allocatable_general_codes_(allocatable_general_codes), 156 allocatable_general_codes_(allocatable_general_codes),
169 allocatable_double_codes_(allocatable_double_codes), 157 allocatable_double_codes_(allocatable_double_codes),
170 fp_aliasing_kind_(fp_aliasing_kind), 158 fp_aliasing_kind_(fp_aliasing_kind),
171 general_register_names_(general_register_names), 159 general_register_names_(general_register_names),
172 float_register_names_(float_register_names), 160 float_register_names_(float_register_names),
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return index == other_index >> shift; 257 return index == other_index >> shift;
270 } 258 }
271 int shift = other_rep_int - rep_int; 259 int shift = other_rep_int - rep_int;
272 return index >> shift == other_index; 260 return index >> shift == other_index;
273 } 261 }
274 262
275 #undef REGISTER_COUNT 263 #undef REGISTER_COUNT
276 264
277 } // namespace internal 265 } // namespace internal
278 } // namespace v8 266 } // namespace v8
OLDNEW
« no previous file with comments | « src/register-configuration.h ('k') | src/zone/zone-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698