OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // Start of V8 compatibility section --------------------- | 278 // Start of V8 compatibility section --------------------- |
279 static const int kMaxNumRegisters = kNumberOfFPRegisters; | 279 static const int kMaxNumRegisters = kNumberOfFPRegisters; |
280 | 280 |
281 // Crankshaft can use all the FP registers except: | 281 // Crankshaft can use all the FP registers except: |
282 // - d15 which is used to keep the 0 double value | 282 // - d15 which is used to keep the 0 double value |
283 // - d30 which is used in crankshaft as a double scratch register | 283 // - d30 which is used in crankshaft as a double scratch register |
284 // - d31 which is used in the MacroAssembler as a double scratch register | 284 // - d31 which is used in the MacroAssembler as a double scratch register |
285 static const unsigned kAllocatableLowRangeBegin = 0; | 285 static const unsigned kAllocatableLowRangeBegin = 0; |
286 static const unsigned kAllocatableLowRangeEnd = 14; | 286 static const unsigned kAllocatableLowRangeEnd = 14; |
287 static const unsigned kAllocatableHighRangeBegin = 16; | 287 static const unsigned kAllocatableHighRangeBegin = 16; |
288 static const unsigned kAllocatableHighRangeEnd = 29; | 288 static const unsigned kAllocatableHighRangeEnd = 28; |
289 | 289 |
290 static const RegList kAllocatableFPRegisters = 0x3fff7fff; | 290 static const RegList kAllocatableFPRegisters = 0x1fff7fff; |
291 | 291 |
292 // Gap between low and high ranges. | 292 // Gap between low and high ranges. |
293 static const int kAllocatableRangeGapSize = | 293 static const int kAllocatableRangeGapSize = |
294 (kAllocatableHighRangeBegin - kAllocatableLowRangeEnd) - 1; | 294 (kAllocatableHighRangeBegin - kAllocatableLowRangeEnd) - 1; |
295 | 295 |
296 static const int kMaxNumAllocatableRegisters = | 296 static const int kMaxNumAllocatableRegisters = |
297 (kAllocatableLowRangeEnd - kAllocatableLowRangeBegin + 1) + | 297 (kAllocatableLowRangeEnd - kAllocatableLowRangeBegin + 1) + |
298 (kAllocatableHighRangeEnd - kAllocatableHighRangeBegin + 1); | 298 (kAllocatableHighRangeEnd - kAllocatableHighRangeBegin + 1); |
299 static int NumAllocatableRegisters() { return kMaxNumAllocatableRegisters; } | 299 static int NumAllocatableRegisters() { return kMaxNumAllocatableRegisters; } |
300 | 300 |
301 // Return true if the register is one that crankshaft can allocate. | 301 // Return true if the register is one that crankshaft can allocate. |
302 bool IsAllocatable() const { | 302 bool IsAllocatable() const { |
303 return (Bit() & kAllocatableFPRegisters) != 0; | 303 return (Bit() & kAllocatableFPRegisters) != 0; |
304 } | 304 } |
305 | 305 |
306 static FPRegister FromAllocationIndex(unsigned int index) { | 306 static FPRegister FromAllocationIndex(unsigned int index) { |
307 ASSERT(index < static_cast<unsigned>(NumAllocatableRegisters())); | 307 ASSERT(index < static_cast<unsigned>(NumAllocatableRegisters())); |
308 | 308 |
309 return (index <= kAllocatableLowRangeEnd) | 309 return (index <= kAllocatableLowRangeEnd) |
310 ? from_code(index) | 310 ? from_code(index) |
311 : from_code(index + kAllocatableRangeGapSize); | 311 : from_code(index + kAllocatableRangeGapSize); |
312 } | 312 } |
313 | 313 |
314 static const char* AllocationIndexToString(int index) { | 314 static const char* AllocationIndexToString(int index) { |
315 ASSERT((index >= 0) && (index < NumAllocatableRegisters())); | 315 ASSERT((index >= 0) && (index < NumAllocatableRegisters())); |
316 ASSERT((kAllocatableLowRangeBegin == 0) && | 316 ASSERT((kAllocatableLowRangeBegin == 0) && |
317 (kAllocatableLowRangeEnd == 14) && | 317 (kAllocatableLowRangeEnd == 14) && |
318 (kAllocatableHighRangeBegin == 16) && | 318 (kAllocatableHighRangeBegin == 16) && |
319 (kAllocatableHighRangeEnd == 29)); | 319 (kAllocatableHighRangeEnd == 28)); |
320 const char* const names[] = { | 320 const char* const names[] = { |
321 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", | 321 "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", |
322 "d8", "d9", "d10", "d11", "d12", "d13", "d14", | 322 "d8", "d9", "d10", "d11", "d12", "d13", "d14", |
323 "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", | 323 "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", |
324 "d24", "d25", "d26", "d27", "d28", "d29" | 324 "d24", "d25", "d26", "d27", "d28" |
325 }; | 325 }; |
326 return names[index]; | 326 return names[index]; |
327 } | 327 } |
328 | 328 |
329 static int ToAllocationIndex(FPRegister reg) { | 329 static int ToAllocationIndex(FPRegister reg) { |
330 ASSERT(reg.IsAllocatable()); | 330 ASSERT(reg.IsAllocatable()); |
331 unsigned code = reg.code(); | 331 unsigned code = reg.code(); |
332 | 332 |
333 return (code <= kAllocatableLowRangeEnd) | 333 return (code <= kAllocatableLowRangeEnd) |
334 ? code | 334 ? code |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 ALIAS_REGISTER(Register, jssp, x28); | 413 ALIAS_REGISTER(Register, jssp, x28); |
414 ALIAS_REGISTER(Register, wjssp, w28); | 414 ALIAS_REGISTER(Register, wjssp, w28); |
415 ALIAS_REGISTER(Register, fp, x29); | 415 ALIAS_REGISTER(Register, fp, x29); |
416 ALIAS_REGISTER(Register, lr, x30); | 416 ALIAS_REGISTER(Register, lr, x30); |
417 ALIAS_REGISTER(Register, xzr, x31); | 417 ALIAS_REGISTER(Register, xzr, x31); |
418 ALIAS_REGISTER(Register, wzr, w31); | 418 ALIAS_REGISTER(Register, wzr, w31); |
419 | 419 |
420 // Keeps the 0 double value. | 420 // Keeps the 0 double value. |
421 ALIAS_REGISTER(FPRegister, fp_zero, d15); | 421 ALIAS_REGISTER(FPRegister, fp_zero, d15); |
422 // Crankshaft double scratch register. | 422 // Crankshaft double scratch register. |
423 ALIAS_REGISTER(FPRegister, crankshaft_fp_scratch, d30); | 423 ALIAS_REGISTER(FPRegister, crankshaft_fp_scratch, d29); |
424 // MacroAssembler double scratch register. | 424 // MacroAssembler double scratch registers. |
425 ALIAS_REGISTER(FPRegister, fp_scratch, d31); | 425 ALIAS_REGISTER(FPRegister, fp_scratch, d30); |
| 426 ALIAS_REGISTER(FPRegister, fp_scratch1, d30); |
| 427 ALIAS_REGISTER(FPRegister, fp_scratch2, d31); |
426 | 428 |
427 #undef ALIAS_REGISTER | 429 #undef ALIAS_REGISTER |
428 | 430 |
429 | 431 |
430 Register GetAllocatableRegisterThatIsNotOneOf(Register reg1, | 432 Register GetAllocatableRegisterThatIsNotOneOf(Register reg1, |
431 Register reg2 = NoReg, | 433 Register reg2 = NoReg, |
432 Register reg3 = NoReg, | 434 Register reg3 = NoReg, |
433 Register reg4 = NoReg); | 435 Register reg4 = NoReg); |
434 | 436 |
435 | 437 |
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 class EnsureSpace BASE_EMBEDDED { | 2226 class EnsureSpace BASE_EMBEDDED { |
2225 public: | 2227 public: |
2226 explicit EnsureSpace(Assembler* assembler) { | 2228 explicit EnsureSpace(Assembler* assembler) { |
2227 assembler->CheckBuffer(); | 2229 assembler->CheckBuffer(); |
2228 } | 2230 } |
2229 }; | 2231 }; |
2230 | 2232 |
2231 } } // namespace v8::internal | 2233 } } // namespace v8::internal |
2232 | 2234 |
2233 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ | 2235 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ |
OLD | NEW |