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

Side by Side Diff: src/DartARM32/assembler_arm.cc

Issue 1412963008: Add the PUSH instruction to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 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/DartARM32/assembler_arm.h ('k') | src/IceAssemblerARM32.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This is forked from Dart revision df52deea9f25690eb8b66c5995da92b70f7ac1fe 5 // This is forked from Dart revision df52deea9f25690eb8b66c5995da92b70f7ac1fe
6 // Please update the (git) revision if we merge changes from Dart. 6 // Please update the (git) revision if we merge changes from Dart.
7 // https://code.google.com/p/dart/wiki/GettingTheSource 7 // https://code.google.com/p/dart/wiki/GettingTheSource
8 8
9 #include "vm/globals.h" // NOLINT 9 #include "vm/globals.h" // NOLINT
10 #if defined(TARGET_ARCH_ARM) 10 #if defined(TARGET_ARCH_ARM)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Address ad) { 125 Address ad) {
126 ASSERT(rd != kNoRegister); 126 ASSERT(rd != kNoRegister);
127 ASSERT(cond != kNoCondition); 127 ASSERT(cond != kNoCondition);
128 int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | 128 int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
129 mode | 129 mode |
130 (static_cast<int32_t>(rd) << kRdShift) | 130 (static_cast<int32_t>(rd) << kRdShift) |
131 ad.encoding3(); 131 ad.encoding3();
132 Emit(encoding); 132 Emit(encoding);
133 } 133 }
134 134
135 135 #if 0
136 // Moved to ARM32::AssemblerARM32::emitMuliMemOp()
136 void Assembler::EmitMultiMemOp(Condition cond, 137 void Assembler::EmitMultiMemOp(Condition cond,
137 BlockAddressMode am, 138 BlockAddressMode am,
138 bool load, 139 bool load,
139 Register base, 140 Register base,
140 RegList regs) { 141 RegList regs) {
141 ASSERT(base != kNoRegister); 142 ASSERT(base != kNoRegister);
142 ASSERT(cond != kNoCondition); 143 ASSERT(cond != kNoCondition);
143 int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | 144 int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
144 B27 | 145 B27 |
145 am | 146 am |
146 (load ? L : 0) | 147 (load ? L : 0) |
147 (static_cast<int32_t>(base) << kRnShift) | 148 (static_cast<int32_t>(base) << kRnShift) |
148 regs; 149 regs;
149 Emit(encoding); 150 Emit(encoding);
150 } 151 }
151 152 #endif
152 153
153 void Assembler::EmitShiftImmediate(Condition cond, 154 void Assembler::EmitShiftImmediate(Condition cond,
154 Shift opcode, 155 Shift opcode,
155 Register rd, 156 Register rd,
156 Register rm, 157 Register rm,
157 Operand o) { 158 Operand o) {
158 ASSERT(cond != kNoCondition); 159 ASSERT(cond != kNoCondition);
159 ASSERT(o.type() == 1); 160 ASSERT(o.type() == 1);
160 int32_t encoding = static_cast<int32_t>(cond) << kConditionShift | 161 int32_t encoding = static_cast<int32_t>(cond) << kConditionShift |
161 static_cast<int32_t>(MOV) << kOpcodeShift | 162 static_cast<int32_t>(MOV) << kOpcodeShift |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 } 549 }
549 550
550 551
551 void Assembler::ldm(BlockAddressMode am, Register base, RegList regs, 552 void Assembler::ldm(BlockAddressMode am, Register base, RegList regs,
552 Condition cond) { 553 Condition cond) {
553 ASSERT(regs != 0); 554 ASSERT(regs != 0);
554 EmitMultiMemOp(cond, am, true, base, regs); 555 EmitMultiMemOp(cond, am, true, base, regs);
555 } 556 }
556 557
557 558
559 #if 0
560 // Folded into ARM32::AssemblerARM32::pushList(), since it is its only
561 // use (and doesn't implement ARM STM instruction).
558 void Assembler::stm(BlockAddressMode am, Register base, RegList regs, 562 void Assembler::stm(BlockAddressMode am, Register base, RegList regs,
559 Condition cond) { 563 Condition cond) {
560 ASSERT(regs != 0); 564 ASSERT(regs != 0);
561 EmitMultiMemOp(cond, am, false, base, regs); 565 EmitMultiMemOp(cond, am, false, base, regs);
562 } 566 }
567 #endif
563 568
564 569
565 void Assembler::ldrex(Register rt, Register rn, Condition cond) { 570 void Assembler::ldrex(Register rt, Register rn, Condition cond) {
566 ASSERT(TargetCPUFeatures::arm_version() != ARMv5TE); 571 ASSERT(TargetCPUFeatures::arm_version() != ARMv5TE);
567 ASSERT(rn != kNoRegister); 572 ASSERT(rn != kNoRegister);
568 ASSERT(rt != kNoRegister); 573 ASSERT(rt != kNoRegister);
569 ASSERT(cond != kNoCondition); 574 ASSERT(cond != kNoCondition);
570 int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) | 575 int32_t encoding = (static_cast<int32_t>(cond) << kConditionShift) |
571 B24 | 576 B24 |
572 B23 | 577 B23 |
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 bool Address::CanHoldImmediateOffset( 2559 bool Address::CanHoldImmediateOffset(
2555 bool is_load, intptr_t cid, int64_t offset) { 2560 bool is_load, intptr_t cid, int64_t offset) {
2556 int32_t offset_mask = 0; 2561 int32_t offset_mask = 0;
2557 if (is_load) { 2562 if (is_load) {
2558 return CanHoldLoadOffset(OperandSizeFor(cid), offset, &offset_mask); 2563 return CanHoldLoadOffset(OperandSizeFor(cid), offset, &offset_mask);
2559 } else { 2564 } else {
2560 return CanHoldStoreOffset(OperandSizeFor(cid), offset, &offset_mask); 2565 return CanHoldStoreOffset(OperandSizeFor(cid), offset, &offset_mask);
2561 } 2566 }
2562 } 2567 }
2563 2568
2564 2569 #if 0
2570 // Moved to ARM32::AssemblerARM32::push();
2565 void Assembler::Push(Register rd, Condition cond) { 2571 void Assembler::Push(Register rd, Condition cond) {
2566 str(rd, Address(SP, -kWordSize, Address::PreIndex), cond); 2572 str(rd, Address(SP, -kWordSize, Address::PreIndex), cond);
2567 } 2573 }
2568 2574 #endif
2569 2575
2570 void Assembler::Pop(Register rd, Condition cond) { 2576 void Assembler::Pop(Register rd, Condition cond) {
2571 ldr(rd, Address(SP, kWordSize, Address::PostIndex), cond); 2577 ldr(rd, Address(SP, kWordSize, Address::PostIndex), cond);
2572 } 2578 }
2573 2579
2574 2580 #if 0
2581 // Moved to ARM32::AssemblerARM32::pushList();
2575 void Assembler::PushList(RegList regs, Condition cond) { 2582 void Assembler::PushList(RegList regs, Condition cond) {
2576 stm(DB_W, SP, regs, cond); 2583 stm(DB_W, SP, regs, cond);
2577 } 2584 }
2578 2585 #endif
2579 2586
2580 void Assembler::PopList(RegList regs, Condition cond) { 2587 void Assembler::PopList(RegList regs, Condition cond) {
2581 ldm(IA_W, SP, regs, cond); 2588 ldm(IA_W, SP, regs, cond);
2582 } 2589 }
2583 2590
2584 2591
2585 void Assembler::MoveRegister(Register rd, Register rm, Condition cond) { 2592 void Assembler::MoveRegister(Register rd, Register rm, Condition cond) {
2586 if (rd != rm) { 2593 if (rd != rm) {
2587 mov(rd, Operand(rm), cond); 2594 mov(rd, Operand(rm), cond);
2588 } 2595 }
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
3683 3690
3684 3691
3685 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3692 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3686 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters)); 3693 ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
3687 return fpu_reg_names[reg]; 3694 return fpu_reg_names[reg];
3688 } 3695 }
3689 3696
3690 } // namespace dart 3697 } // namespace dart
3691 3698
3692 #endif // defined TARGET_ARCH_ARM 3699 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/DartARM32/assembler_arm.h ('k') | src/IceAssemblerARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698