Chromium Code Reviews

Side by Side Diff: src/arm/assembler-arm-inl.h

Issue 11428137: ARM: Make use of d16-d31 when available. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use an ExternalReference to check CpuFeatures in generated code Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/code-stubs-arm.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 40 matching lines...)
51 if (CpuFeatures::IsSupported(VFP2)) { 51 if (CpuFeatures::IsSupported(VFP2)) {
52 return kMaxNumAllocatableRegisters; 52 return kMaxNumAllocatableRegisters;
53 } else { 53 } else {
54 return kMaxNumAllocatableRegisters - kGPRsPerNonVFP2Double; 54 return kMaxNumAllocatableRegisters - kGPRsPerNonVFP2Double;
55 } 55 }
56 } 56 }
57 57
58 58
59 int DwVfpRegister::NumRegisters() { 59 int DwVfpRegister::NumRegisters() {
60 if (CpuFeatures::IsSupported(VFP2)) { 60 if (CpuFeatures::IsSupported(VFP2)) {
61 return DwVfpRegister::kNumRegisters; 61 return CpuFeatures::IsSupported(VFP32DREGS) ? 32 : 16;
62 } else { 62 } else {
63 return 1; 63 return 1;
64 } 64 }
65 } 65 }
66 66
67 67
68 int DwVfpRegister::NumAllocatableRegisters() { 68 int DwVfpRegister::NumAllocatableRegisters() {
69 if (CpuFeatures::IsSupported(VFP2)) { 69 if (CpuFeatures::IsSupported(VFP2)) {
70 return DwVfpRegister::kMaxNumAllocatableRegisters; 70 return NumRegisters() - kNumReservedRegisters;
71 } else { 71 } else {
72 return 1; 72 return 1;
73 } 73 }
74 } 74 }
75 75
76 76
77 int DwVfpRegister::ToAllocationIndex(DwVfpRegister reg) { 77 int DwVfpRegister::ToAllocationIndex(DwVfpRegister reg) {
78 ASSERT(!reg.is(kDoubleRegZero)); 78 ASSERT(!reg.is(kDoubleRegZero));
79 ASSERT(!reg.is(kScratchDoubleReg)); 79 ASSERT(!reg.is(kScratchDoubleReg));
80 if (reg.code() > kDoubleRegZero.code())
ulan_google 2013/01/18 10:44:42 Nit: brackets are needed around "if" body.
hans 2013/01/22 13:55:40 Done.
81 return reg.code() - kNumReservedRegisters;
80 return reg.code(); 82 return reg.code();
81 } 83 }
82 84
83 85
86 DwVfpRegister DwVfpRegister::FromAllocationIndex(int index) {
87 ASSERT(index >= 0 && index < NumAllocatableRegisters());
88 ASSERT(kScratchDoubleReg.code() - kDoubleRegZero.code() ==
89 kNumReservedRegisters - 1);
90 if (index >= kDoubleRegZero.code())
ulan_google 2013/01/18 10:44:42 Nit: brackets are needed around "if" body.
hans 2013/01/22 13:55:40 Done.
91 return from_code(index + kNumReservedRegisters);
92 return from_code(index);
93 }
94
95
84 void RelocInfo::apply(intptr_t delta) { 96 void RelocInfo::apply(intptr_t delta) {
85 if (RelocInfo::IsInternalReference(rmode_)) { 97 if (RelocInfo::IsInternalReference(rmode_)) {
86 // absolute code pointer inside code object moves with the code object. 98 // absolute code pointer inside code object moves with the code object.
87 int32_t* p = reinterpret_cast<int32_t*>(pc_); 99 int32_t* p = reinterpret_cast<int32_t*>(pc_);
88 *p += delta; // relocate entry 100 *p += delta; // relocate entry
89 } 101 }
90 // We do not use pc relative addressing on ARM, so there is 102 // We do not use pc relative addressing on ARM, so there is
91 // nothing else to do. 103 // nothing else to do.
92 } 104 }
93 105
(...skipping 432 matching lines...)
526 538
527 539
528 void Assembler::set_target_address_at(Address pc, Address target) { 540 void Assembler::set_target_address_at(Address pc, Address target) {
529 set_target_pointer_at(pc, target); 541 set_target_pointer_at(pc, target);
530 } 542 }
531 543
532 544
533 } } // namespace v8::internal 545 } } // namespace v8::internal
534 546
535 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_ 547 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/code-stubs-arm.h » ('j') | no next file with comments »

Powered by Google App Engine