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

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

Issue 235363005: Adds comparisons, labels, branches to arm64 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/disassembler_arm64.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_CONSTANTS_ARM64_H_ 5 #ifndef VM_CONSTANTS_ARM64_H_
6 #define VM_CONSTANTS_ARM64_H_ 6 #define VM_CONSTANTS_ARM64_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 DPRegisterMask = 0x0e000000, 252 DPRegisterMask = 0x0e000000,
253 DPRegisterFixed = B27 | B25, 253 DPRegisterFixed = B27 | B25,
254 254
255 DPSimd1Mask = 0x1e000000, 255 DPSimd1Mask = 0x1e000000,
256 DPSimd1Fixed = B27 | B26 | B25, 256 DPSimd1Fixed = B27 | B26 | B25,
257 257
258 DPSimd2Mask = 0x1e000000, 258 DPSimd2Mask = 0x1e000000,
259 DPSimd2Fixed = B28 | DPSimd1Fixed, 259 DPSimd2Fixed = B28 | DPSimd1Fixed,
260 }; 260 };
261 261
262 // C3.2.1
263 enum CompareAndBranchOp {
264 CompareAndBranchMask = 0x7e000000,
265 CompareAndBranchFixed = CompareBranchFixed | B29,
266 CBZ = CompareBranchFixed,
267 CBNZ = CompareBranchFixed | B24,
268 };
269
270 // C.3.2.2
271 enum ConditionalBranchOp {
272 ConditionalBranchMask = 0xfe000000,
273 ConditionalBranchFixed = CompareBranchFixed | B30,
274 BCOND = ConditionalBranchFixed,
275 };
276
262 // C3.2.3 277 // C3.2.3
263 enum ExceptionGenOp { 278 enum ExceptionGenOp {
264 ExceptionGenMask = 0xff000000, 279 ExceptionGenMask = 0xff000000,
265 ExceptionGenFixed = CompareBranchFixed | B31 | B30, 280 ExceptionGenFixed = CompareBranchFixed | B31 | B30,
266 SVC = ExceptionGenFixed | B0, 281 SVC = ExceptionGenFixed | B0,
267 BRK = ExceptionGenFixed | B21, 282 BRK = ExceptionGenFixed | B21,
268 HLT = ExceptionGenFixed | B22, 283 HLT = ExceptionGenFixed | B22,
269 }; 284 };
270 285
271 // C3.2.4 286 // C3.2.4
272 enum SystemOp { 287 enum SystemOp {
273 SystemMask = 0xffc00000, 288 SystemMask = 0xffc00000,
274 SystemFixed = CompareBranchFixed | B31 | B30 | B24, 289 SystemFixed = CompareBranchFixed | B31 | B30 | B24,
275 HINT = SystemFixed | B17 | B16 | B13 | B4 | B3 | B2 | B1 | B0, 290 HINT = SystemFixed | B17 | B16 | B13 | B4 | B3 | B2 | B1 | B0,
276 }; 291 };
277 292
293 // C3.2.5
294 enum TestAndBranchOp {
295 TestAndBranchMask = 0x7e000000,
296 TestAndBranchFixed = CompareBranchFixed | B29 | B25,
297 TBZ = TestAndBranchFixed,
298 TBNZ = TestAndBranchFixed | B24,
299 };
300
301 // C3.2.6
302 enum UnconditionalBranchOp {
303 UnconditionalBranchMask = 0x7c000000,
304 UnconditionalBranchFixed = CompareBranchFixed,
305 B = UnconditionalBranchFixed,
306 BL = UnconditionalBranchFixed | B31,
307 };
308
278 // C3.2.7 309 // C3.2.7
279 enum UnconditionalBranchRegOp { 310 enum UnconditionalBranchRegOp {
280 UnconditionalBranchRegMask = 0xfe000000, 311 UnconditionalBranchRegMask = 0xfe000000,
281 UnconditionalBranchRegFixed = CompareBranchFixed | B31 | B30 | B25, 312 UnconditionalBranchRegFixed = CompareBranchFixed | B31 | B30 | B25,
282 BR = UnconditionalBranchRegFixed | B20 | B19 | B18 | B17 | B16, 313 BR = UnconditionalBranchRegFixed | B20 | B19 | B18 | B17 | B16,
283 BLR = BR | B21, 314 BLR = BR | B21,
284 RET = BR | B22, 315 RET = BR | B22,
285 }; 316 };
286 317
287 enum LoadStoreRegOp { 318 enum LoadStoreRegOp {
(...skipping 23 matching lines...) Expand all
311 342
312 // C3.4.5 343 // C3.4.5
313 enum MoveWideOp { 344 enum MoveWideOp {
314 MoveWideMask = 0x1f800000, 345 MoveWideMask = 0x1f800000,
315 MoveWideFixed = DPImmediateFixed | B25 | B23, 346 MoveWideFixed = DPImmediateFixed | B25 | B23,
316 MOVN = MoveWideFixed, 347 MOVN = MoveWideFixed,
317 MOVZ = MoveWideFixed | B30, 348 MOVZ = MoveWideFixed | B30,
318 MOVK = MoveWideFixed | B30 | B29, 349 MOVK = MoveWideFixed | B30 | B29,
319 }; 350 };
320 351
352 // C3.4.6
353 enum PCRelOp {
354 PCRelMask = 0x1f000000,
355 PCRelFixed = DPImmediateFixed,
356 ADR = PCRelFixed,
357 ADRP = PCRelFixed | B31,
358 };
359
321 // C3.5.1 360 // C3.5.1
322 enum AddSubShiftExtOp { 361 enum AddSubShiftExtOp {
323 AddSubShiftExtMask = 0x1f000000, 362 AddSubShiftExtMask = 0x1f000000,
324 AddSubShiftExtFixed = DPRegisterFixed | B24, 363 AddSubShiftExtFixed = DPRegisterFixed | B24,
325 ADD = AddSubShiftExtFixed, 364 ADD = AddSubShiftExtFixed,
326 SUB = AddSubShiftExtFixed | B30, 365 SUB = AddSubShiftExtFixed | B30,
327 }; 366 };
328 367
329 enum LogicalShiftOp { 368 enum LogicalShiftOp {
330 LogicalShiftMask = 0x1f000000, 369 LogicalShiftMask = 0x1f000000,
331 LogicalShiftFixed = DPRegisterFixed, 370 LogicalShiftFixed = DPRegisterFixed,
332 AND = LogicalShiftFixed, 371 AND = LogicalShiftFixed,
333 BIC = LogicalShiftFixed | B21, 372 BIC = LogicalShiftFixed | B21,
334 ORR = LogicalShiftFixed | B29, 373 ORR = LogicalShiftFixed | B29,
335 ORN = LogicalShiftFixed | B29 | B21, 374 ORN = LogicalShiftFixed | B29 | B21,
336 EOR = LogicalShiftFixed | B30, 375 EOR = LogicalShiftFixed | B30,
337 EON = LogicalShiftFixed | B30 | B21, 376 EON = LogicalShiftFixed | B30 | B21,
338 ANDS = LogicalShiftFixed | B30 | B29, 377 ANDS = LogicalShiftFixed | B30 | B29,
339 BICS = LogicalShiftFixed | B30 | B29 | B21, 378 BICS = LogicalShiftFixed | B30 | B29 | B21,
340 }; 379 };
341 380
342 #define APPLY_OP_LIST(_V) \ 381 #define APPLY_OP_LIST(_V) \
343 _V(DPImmediate) \ 382 _V(DPImmediate) \
344 _V(CompareBranch) \ 383 _V(CompareBranch) \
345 _V(LoadStore) \ 384 _V(LoadStore) \
346 _V(DPRegister) \ 385 _V(DPRegister) \
347 _V(DPSimd1) \ 386 _V(DPSimd1) \
348 _V(DPSimd2) \ 387 _V(DPSimd2) \
388 _V(CompareAndBranch) \
389 _V(ConditionalBranch) \
349 _V(ExceptionGen) \ 390 _V(ExceptionGen) \
350 _V(System) \ 391 _V(System) \
392 _V(TestAndBranch) \
393 _V(UnconditionalBranch) \
394 _V(UnconditionalBranchReg) \
351 _V(LoadStoreReg) \ 395 _V(LoadStoreReg) \
352 _V(UnconditionalBranchReg) \
353 _V(AddSubImm) \ 396 _V(AddSubImm) \
354 _V(LogicalImm) \ 397 _V(LogicalImm) \
355 _V(MoveWide) \ 398 _V(MoveWide) \
399 _V(PCRel) \
356 _V(AddSubShiftExt) \ 400 _V(AddSubShiftExt) \
357 _V(LogicalShift) \ 401 _V(LogicalShift) \
358 402
359 403
360 enum Shift { 404 enum Shift {
361 kNoShift = -1, 405 kNoShift = -1,
362 LSL = 0, // Logical shift left 406 LSL = 0, // Logical shift left
363 LSR = 1, // Logical shift right 407 LSR = 1, // Logical shift right
364 ASR = 2, // Arithmetic shift right 408 ASR = 2, // Arithmetic shift right
365 ROR = 3, // Rotate right 409 ROR = 3, // Rotate right
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 kImm3Shift = 10, 460 kImm3Shift = 10,
417 kImm3Bits = 3, 461 kImm3Bits = 3,
418 kImm6Shift = 10, 462 kImm6Shift = 10,
419 kImm6Bits = 6, 463 kImm6Bits = 6,
420 kImm9Shift = 12, 464 kImm9Shift = 12,
421 kImm9Bits = 9, 465 kImm9Bits = 9,
422 kImm12Shift = 10, 466 kImm12Shift = 10,
423 kImm12Bits = 12, 467 kImm12Bits = 12,
424 kImm12ShiftShift = 22, 468 kImm12ShiftShift = 22,
425 kImm12ShiftBits = 2, 469 kImm12ShiftBits = 2,
470 kImm14Shift = 5,
471 kImm14Bits = 14,
426 kImm16Shift = 5, 472 kImm16Shift = 5,
427 kImm16Bits = 16, 473 kImm16Bits = 16,
474 kImm19Shift = 5,
475 kImm19Bits = 19,
476 kImm19Mask = 0x7ffff,
477 kImm26Shift = 0,
478 kImm26Bits = 26,
479
480 kCondShift = 0,
481 kCondBits = 4,
428 482
429 // Bitfield immediates. 483 // Bitfield immediates.
430 kNShift = 22, 484 kNShift = 22,
431 kNBits = 1, 485 kNBits = 1,
432 kImmRShift = 16, 486 kImmRShift = 16,
433 kImmRBits = 6, 487 kImmRBits = 6,
434 kImmSShift = 10, 488 kImmSShift = 10,
435 kImmSBits = 6, 489 kImmSBits = 6,
436 490
437 kHWShift = 21, 491 kHWShift = 21,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 inline int Imm12Field() const { return Bits(kImm12Shift, kImm12Bits); } 604 inline int Imm12Field() const { return Bits(kImm12Shift, kImm12Bits); }
551 inline int Imm12ShiftField() const { 605 inline int Imm12ShiftField() const {
552 return Bits(kImm12ShiftShift, kImm12ShiftBits); } 606 return Bits(kImm12ShiftShift, kImm12ShiftBits); }
553 607
554 inline int Imm16Field() const { return Bits(kImm16Shift, kImm16Bits); } 608 inline int Imm16Field() const { return Bits(kImm16Shift, kImm16Bits); }
555 inline int HWField() const { return Bits(kHWShift, kHWBits); } 609 inline int HWField() const { return Bits(kHWShift, kHWBits); }
556 610
557 inline int ImmRField() const { return Bits(kImmRShift, kImmRBits); } 611 inline int ImmRField() const { return Bits(kImmRShift, kImmRBits); }
558 inline int ImmSField() const { return Bits(kImmSShift, kImmSBits); } 612 inline int ImmSField() const { return Bits(kImmSShift, kImmSBits); }
559 613
614 inline int Imm14Field() const { return Bits(kImm14Shift, kImm14Bits); }
615 inline int64_t SImm14Field() const {
616 return (static_cast<int32_t>(Imm14Field()) << 18) >> 18; }
617 inline int Imm19Field() const { return Bits(kImm19Shift, kImm19Bits); }
618 inline int64_t SImm19Field() const {
619 return (static_cast<int32_t>(Imm19Field()) << 13) >> 13; }
620 inline int Imm26Field() const { return Bits(kImm26Shift, kImm26Bits); }
621 inline int64_t SImm26Field() const {
622 return (static_cast<int32_t>(Imm26Field()) << 6) >> 6; }
623
624 inline Condition ConditionField() const {
625 return static_cast<Condition>(Bits(kCondShift, kCondBits));
626 }
627
560 // Shift and Extend. 628 // Shift and Extend.
561 inline bool IsShift() const { 629 inline bool IsShift() const {
562 return IsLogicalShiftOp() || (Bit(kAddShiftExtendShift) == 0); 630 return IsLogicalShiftOp() || (Bit(kAddShiftExtendShift) == 0);
563 } 631 }
564 inline bool IsExtend() const { 632 inline bool IsExtend() const {
565 return !IsLogicalShiftOp() && (Bit(kAddShiftExtendShift) == 1); 633 return !IsLogicalShiftOp() && (Bit(kAddShiftExtendShift) == 1);
566 } 634 }
567 inline Shift ShiftTypeField() const { 635 inline Shift ShiftTypeField() const {
568 return static_cast<Shift>(Bits(kShiftTypeShift, kShiftTypeBits)); } 636 return static_cast<Shift>(Bits(kShiftTypeShift, kShiftTypeBits)); }
569 inline Extend ExtendTypeField() const { 637 inline Extend ExtendTypeField() const {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } 743 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); }
676 744
677 private: 745 private:
678 DISALLOW_ALLOCATION(); 746 DISALLOW_ALLOCATION();
679 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); 747 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr);
680 }; 748 };
681 749
682 } // namespace dart 750 } // namespace dart
683 751
684 #endif // VM_CONSTANTS_ARM64_H_ 752 #endif // VM_CONSTANTS_ARM64_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/disassembler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698