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

Side by Side Diff: runtime/vm/assembler_arm.h

Issue 14637013: Fix ARM memory addressing mode 3 in assembler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/assembler_arm.cc » ('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 #ifndef VM_ASSEMBLER_ARM_H_ 5 #ifndef VM_ASSEMBLER_ARM_H_
6 #define VM_ASSEMBLER_ARM_H_ 6 #define VM_ASSEMBLER_ARM_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_arm.h directly; use assembler.h instead. 9 #error Do not include assembler_arm.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 IA_W = (0|4|1) << 21, // increment after with writeback to base 209 IA_W = (0|4|1) << 21, // increment after with writeback to base
210 DB_W = (8|0|1) << 21, // decrement before with writeback to base 210 DB_W = (8|0|1) << 21, // decrement before with writeback to base
211 IB_W = (8|4|1) << 21 // increment before with writeback to base 211 IB_W = (8|4|1) << 21 // increment before with writeback to base
212 }; 212 };
213 213
214 214
215 class Address : public ValueObject { 215 class Address : public ValueObject {
216 public: 216 public:
217 enum OffsetKind { 217 enum OffsetKind {
218 Immediate, 218 Immediate,
219 ShiftedRegister, 219 IndexRegister,
220 ScaledIndexRegister,
220 }; 221 };
221 222
222 // Memory operand addressing mode 223 // Memory operand addressing mode
223 enum Mode { 224 enum Mode {
224 // bit encoding P U W 225 // bit encoding P U W
225 Offset = (8|4|0) << 21, // offset (w/o writeback to base) 226 Offset = (8|4|0) << 21, // offset (w/o writeback to base)
226 PreIndex = (8|4|1) << 21, // pre-indexed addressing with writeback 227 PreIndex = (8|4|1) << 21, // pre-indexed addressing with writeback
227 PostIndex = (0|4|0) << 21, // post-indexed addressing with writeback 228 PostIndex = (0|4|0) << 21, // post-indexed addressing with writeback
228 NegOffset = (8|0|0) << 21, // negative offset (w/o writeback to base) 229 NegOffset = (8|0|0) << 21, // negative offset (w/o writeback to base)
229 NegPreIndex = (8|0|1) << 21, // negative pre-indexed with writeback 230 NegPreIndex = (8|0|1) << 21, // negative pre-indexed with writeback
(...skipping 18 matching lines...) Expand all
248 } else { 249 } else {
249 encoding_ = am | offset; 250 encoding_ = am | offset;
250 } 251 }
251 encoding_ |= static_cast<uint32_t>(rn) << kRnShift; 252 encoding_ |= static_cast<uint32_t>(rn) << kRnShift;
252 } 253 }
253 254
254 Address(Register rn, Register rm, 255 Address(Register rn, Register rm,
255 Shift shift = LSL, uint32_t shift_imm = 0, Mode am = Offset) { 256 Shift shift = LSL, uint32_t shift_imm = 0, Mode am = Offset) {
256 ShifterOperand so(rm, shift, shift_imm); 257 ShifterOperand so(rm, shift, shift_imm);
257 258
258 kind_ = ShiftedRegister; 259 if ((shift == LSL) && (shift_imm == 0)) {
260 kind_ = IndexRegister;
261 } else {
262 kind_ = ScaledIndexRegister;
263 }
259 encoding_ = so.encoding() | am | (static_cast<uint32_t>(rn) << kRnShift); 264 encoding_ = so.encoding() | am | (static_cast<uint32_t>(rn) << kRnShift);
260 } 265 }
261 266
262 static bool CanHoldLoadOffset(LoadOperandType type, 267 static bool CanHoldLoadOffset(LoadOperandType type,
263 int32_t offset, 268 int32_t offset,
264 int32_t* offset_mask); 269 int32_t* offset_mask);
265 static bool CanHoldStoreOffset(StoreOperandType type, 270 static bool CanHoldStoreOffset(StoreOperandType type,
266 int32_t offset, 271 int32_t offset,
267 int32_t* offset_mask); 272 int32_t* offset_mask);
268 273
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 Register value, 800 Register value,
796 Label* no_update); 801 Label* no_update);
797 802
798 DISALLOW_ALLOCATION(); 803 DISALLOW_ALLOCATION();
799 DISALLOW_COPY_AND_ASSIGN(Assembler); 804 DISALLOW_COPY_AND_ASSIGN(Assembler);
800 }; 805 };
801 806
802 } // namespace dart 807 } // namespace dart
803 808
804 #endif // VM_ASSEMBLER_ARM_H_ 809 #endif // VM_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698