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

Side by Side Diff: src/ppc/assembler-ppc.cc

Issue 1381383002: PPC: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « src/ppc/assembler-ppc.h ('k') | src/ppc/constants-ppc.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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 Register ToRegister(int num) { 121 Register ToRegister(int num) {
122 DCHECK(num >= 0 && num < kNumRegisters); 122 DCHECK(num >= 0 && num < kNumRegisters);
123 const Register kRegisters[] = {r0, sp, r2, r3, r4, r5, r6, r7, 123 const Register kRegisters[] = {r0, sp, r2, r3, r4, r5, r6, r7,
124 r8, r9, r10, r11, ip, r13, r14, r15, 124 r8, r9, r10, r11, ip, r13, r14, r15,
125 r16, r17, r18, r19, r20, r21, r22, r23, 125 r16, r17, r18, r19, r20, r21, r22, r23,
126 r24, r25, r26, r27, r28, r29, r30, fp}; 126 r24, r25, r26, r27, r28, r29, r30, fp};
127 return kRegisters[num]; 127 return kRegisters[num];
128 } 128 }
129 129
130 130
131 const char* DoubleRegister::AllocationIndexToString(int index) {
132 DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters);
133 const char* const names[] = {
134 "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "d10",
135 "d11", "d12", "d15", "d16", "d17", "d18", "d19", "d20", "d21", "d22",
136 "d23", "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31"};
137 return names[index];
138 }
139
140
141 // ----------------------------------------------------------------------------- 131 // -----------------------------------------------------------------------------
142 // Implementation of RelocInfo 132 // Implementation of RelocInfo
143 133
144 const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE | 134 const int RelocInfo::kApplyMask = 1 << RelocInfo::INTERNAL_REFERENCE |
145 1 << RelocInfo::INTERNAL_REFERENCE_ENCODED; 135 1 << RelocInfo::INTERNAL_REFERENCE_ENCODED;
146 136
147 137
148 bool RelocInfo::IsCodedSpecially() { 138 bool RelocInfo::IsCodedSpecially() {
149 // The deserializer needs to know whether a pointer is specially 139 // The deserializer needs to know whether a pointer is specially
150 // coded. Being specially coded on PPC means that it is a lis/ori 140 // coded. Being specially coded on PPC means that it is a lis/ori
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 269
280 270
281 bool Assembler::IsOri(Instr instr) { return (instr & kOpcodeMask) == ORI; } 271 bool Assembler::IsOri(Instr instr) { return (instr & kOpcodeMask) == ORI; }
282 272
283 273
284 bool Assembler::IsBranch(Instr instr) { return ((instr & kOpcodeMask) == BCX); } 274 bool Assembler::IsBranch(Instr instr) { return ((instr & kOpcodeMask) == BCX); }
285 275
286 276
287 Register Assembler::GetRA(Instr instr) { 277 Register Assembler::GetRA(Instr instr) {
288 Register reg; 278 Register reg;
289 reg.code_ = Instruction::RAValue(instr); 279 reg.reg_code = Instruction::RAValue(instr);
290 return reg; 280 return reg;
291 } 281 }
292 282
293 283
294 Register Assembler::GetRB(Instr instr) { 284 Register Assembler::GetRB(Instr instr) {
295 Register reg; 285 Register reg;
296 reg.code_ = Instruction::RBValue(instr); 286 reg.reg_code = Instruction::RBValue(instr);
297 return reg; 287 return reg;
298 } 288 }
299 289
300 290
301 #if V8_TARGET_ARCH_PPC64 291 #if V8_TARGET_ARCH_PPC64
302 // This code assumes a FIXED_SEQUENCE for 64bit loads (lis/ori) 292 // This code assumes a FIXED_SEQUENCE for 64bit loads (lis/ori)
303 bool Assembler::Is64BitLoadIntoR12(Instr instr1, Instr instr2, Instr instr3, 293 bool Assembler::Is64BitLoadIntoR12(Instr instr1, Instr instr2, Instr instr3,
304 Instr instr4, Instr instr5) { 294 Instr instr4, Instr instr5) {
305 // Check the instructions are indeed a five part load (into r12) 295 // Check the instructions are indeed a five part load (into r12)
306 // 3d800000 lis r12, 0 296 // 3d800000 lis r12, 0
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2425 2415
2426 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); 2416 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_);
2427 } 2417 }
2428 } 2418 }
2429 2419
2430 2420
2431 } // namespace internal 2421 } // namespace internal
2432 } // namespace v8 2422 } // namespace v8
2433 2423
2434 #endif // V8_TARGET_ARCH_PPC 2424 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/assembler-ppc.h ('k') | src/ppc/constants-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698