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

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

Issue 262333007: Adds arm64 double arithmetic instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 LS = 9, // unsigned lower or same 186 LS = 9, // unsigned lower or same
187 GE = 10, // signed greater than or equal 187 GE = 10, // signed greater than or equal
188 LT = 11, // signed less than 188 LT = 11, // signed less than
189 GT = 12, // signed greater than 189 GT = 12, // signed greater than
190 LE = 13, // signed less than or equal 190 LE = 13, // signed less than or equal
191 AL = 14, // always (unconditional) 191 AL = 14, // always (unconditional)
192 NV = 15, // special condition (refer to section C1.2.3) 192 NV = 15, // special condition (refer to section C1.2.3)
193 kMaxCondition = 16, 193 kMaxCondition = 16,
194 }; 194 };
195 195
196 static inline Condition InvertCondition(Condition c) {
197 const int32_t i = static_cast<int32_t>(c) ^ 0x1;
198 return static_cast<Condition>(i);
199 }
200
196 enum Bits { 201 enum Bits {
197 B0 = (1 << 0), B1 = (1 << 1), B2 = (1 << 2), B3 = (1 << 3), 202 B0 = (1 << 0), B1 = (1 << 1), B2 = (1 << 2), B3 = (1 << 3),
198 B4 = (1 << 4), B5 = (1 << 5), B6 = (1 << 6), B7 = (1 << 7), 203 B4 = (1 << 4), B5 = (1 << 5), B6 = (1 << 6), B7 = (1 << 7),
199 B8 = (1 << 8), B9 = (1 << 9), B10 = (1 << 10), B11 = (1 << 11), 204 B8 = (1 << 8), B9 = (1 << 9), B10 = (1 << 10), B11 = (1 << 11),
200 B12 = (1 << 12), B13 = (1 << 13), B14 = (1 << 14), B15 = (1 << 15), 205 B12 = (1 << 12), B13 = (1 << 13), B14 = (1 << 14), B15 = (1 << 15),
201 B16 = (1 << 16), B17 = (1 << 17), B18 = (1 << 18), B19 = (1 << 19), 206 B16 = (1 << 16), B17 = (1 << 17), B18 = (1 << 18), B19 = (1 << 19),
202 B20 = (1 << 20), B21 = (1 << 21), B22 = (1 << 22), B23 = (1 << 23), 207 B20 = (1 << 20), B21 = (1 << 21), B22 = (1 << 22), B23 = (1 << 23),
203 B24 = (1 << 24), B25 = (1 << 25), B26 = (1 << 26), B27 = (1 << 27), 208 B24 = (1 << 24), B25 = (1 << 25), B26 = (1 << 26), B27 = (1 << 27),
204 B28 = (1 << 28), B29 = (1 << 29), B30 = (1 << 30), B31 = (1 << 31), 209 B28 = (1 << 28), B29 = (1 << 29), B30 = (1 << 30), B31 = (1 << 31),
205 }; 210 };
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 AddSubShiftExtFixed = DPRegisterFixed | B24, 382 AddSubShiftExtFixed = DPRegisterFixed | B24,
378 ADD = AddSubShiftExtFixed, 383 ADD = AddSubShiftExtFixed,
379 SUB = AddSubShiftExtFixed | B30, 384 SUB = AddSubShiftExtFixed | B30,
380 }; 385 };
381 386
382 // C3.5.6 387 // C3.5.6
383 enum ConditionalSelectOp { 388 enum ConditionalSelectOp {
384 ConditionalSelectMask = 0x1fe00000, 389 ConditionalSelectMask = 0x1fe00000,
385 ConditionalSelectFixed = DPRegisterFixed | B28 | B23, 390 ConditionalSelectFixed = DPRegisterFixed | B28 | B23,
386 CSEL = ConditionalSelectFixed, 391 CSEL = ConditionalSelectFixed,
392 CSINC = ConditionalSelectFixed | B10,
387 }; 393 };
388 394
389 // C3.5.8 395 // C3.5.8
390 enum MiscDP2SourceOp { 396 enum MiscDP2SourceOp {
391 MiscDP2SourceMask = 0x5fe00000, 397 MiscDP2SourceMask = 0x5fe00000,
392 MiscDP2SourceFixed = DPRegisterFixed | B28 | B23 | B22, 398 MiscDP2SourceFixed = DPRegisterFixed | B28 | B23 | B22,
393 UDIV = MiscDP2SourceFixed | B11, 399 UDIV = MiscDP2SourceFixed | B11,
394 SDIV = MiscDP2SourceFixed | B11 | B10, 400 SDIV = MiscDP2SourceFixed | B11 | B10,
395 LSLV = MiscDP2SourceFixed | B13, 401 LSLV = MiscDP2SourceFixed | B13,
396 LSRV = MiscDP2SourceFixed | B13 | B10, 402 LSRV = MiscDP2SourceFixed | B13 | B10,
(...skipping 16 matching lines...) Expand all
413 AND = LogicalShiftFixed, 419 AND = LogicalShiftFixed,
414 BIC = LogicalShiftFixed | B21, 420 BIC = LogicalShiftFixed | B21,
415 ORR = LogicalShiftFixed | B29, 421 ORR = LogicalShiftFixed | B29,
416 ORN = LogicalShiftFixed | B29 | B21, 422 ORN = LogicalShiftFixed | B29 | B21,
417 EOR = LogicalShiftFixed | B30, 423 EOR = LogicalShiftFixed | B30,
418 EON = LogicalShiftFixed | B30 | B21, 424 EON = LogicalShiftFixed | B30 | B21,
419 ANDS = LogicalShiftFixed | B30 | B29, 425 ANDS = LogicalShiftFixed | B30 | B29,
420 BICS = LogicalShiftFixed | B30 | B29 | B21, 426 BICS = LogicalShiftFixed | B30 | B29 | B21,
421 }; 427 };
422 428
429 // C.3.6.22
430 enum FPCompareOp {
431 FPCompareMask = 0xffa0fc07,
432 FPCompareFixed = FPFixed | B21 | B13,
433 FCMPD = FPCompareFixed | B22,
434 FCMPZD = FPCompareFixed | B22 | B3,
435 };
436
423 // C3.6.25 437 // C3.6.25
424 enum FPOneSourceOp { 438 enum FPOneSourceOp {
425 FPOneSourceMask = 0x5f207c00, 439 FPOneSourceMask = 0x5f207c00,
426 FPOneSourceFixed = FPFixed | B21 | B14, 440 FPOneSourceFixed = FPFixed | B21 | B14,
427 FMOVDD = FPOneSourceFixed | B22, 441 FMOVDD = FPOneSourceFixed | B22,
428 }; 442 };
429 443
444 // C3.6.26
445 enum FPTwoSourceOp {
446 FPTwoSourceMask = 0xff200c00,
447 FPTwoSourceFixed = FPFixed | B21 | B11,
448 FMULD = FPTwoSourceFixed | B22,
449 FDIVD = FPTwoSourceFixed | B22 | B12,
450 FADDD = FPTwoSourceFixed | B22 | B13,
451 FSUBD = FPTwoSourceFixed | B22 | B13 | B12,
452 };
453
430 // C3.6.28 454 // C3.6.28
431 enum FPImmOp { 455 enum FPImmOp {
432 FPImmMask = 0x5f201c00, 456 FPImmMask = 0x5f201c00,
433 FPImmFixed = FPFixed | B21 | B12, 457 FPImmFixed = FPFixed | B21 | B12,
434 FMOVSI = FPImmFixed, 458 FMOVSI = FPImmFixed,
435 FMOVDI = FPImmFixed | B22, 459 FMOVDI = FPImmFixed | B22,
436 }; 460 };
437 461
438 // C3.6.29 462 // C3.6.30
439 enum FPIntCvtOp { 463 enum FPIntCvtOp {
440 FPIntCvtMask = 0x5f20fc00, 464 FPIntCvtMask = 0x5f20fc00,
441 FPIntCvtFixed = FPFixed | B21, 465 FPIntCvtFixed = FPFixed | B21,
442 FMOVRD = FPIntCvtFixed | B31 | B22 | B18 | B17, 466 FMOVRD = FPIntCvtFixed | B31 | B22 | B18 | B17,
443 FMOVDR = FPIntCvtFixed | B31 | B22 | B18 | B17 | B16, 467 FMOVDR = FPIntCvtFixed | B31 | B22 | B18 | B17 | B16,
468 FCVTZDS = FPIntCvtFixed | B31 | B22 | B20 | B19,
469 SCVTFD = FPIntCvtFixed | B31 | B22 | B17,
444 }; 470 };
445 471
446 472
447 #define APPLY_OP_LIST(_V) \ 473 #define APPLY_OP_LIST(_V) \
448 _V(DPImmediate) \ 474 _V(DPImmediate) \
449 _V(CompareBranch) \ 475 _V(CompareBranch) \
450 _V(LoadStore) \ 476 _V(LoadStore) \
451 _V(DPRegister) \ 477 _V(DPRegister) \
452 _V(DPSimd1) \ 478 _V(DPSimd1) \
453 _V(DPSimd2) \ 479 _V(DPSimd2) \
(...skipping 10 matching lines...) Expand all
464 _V(AddSubImm) \ 490 _V(AddSubImm) \
465 _V(LogicalImm) \ 491 _V(LogicalImm) \
466 _V(MoveWide) \ 492 _V(MoveWide) \
467 _V(PCRel) \ 493 _V(PCRel) \
468 _V(AddSubShiftExt) \ 494 _V(AddSubShiftExt) \
469 _V(ConditionalSelect) \ 495 _V(ConditionalSelect) \
470 _V(MiscDP2Source) \ 496 _V(MiscDP2Source) \
471 _V(MiscDP3Source) \ 497 _V(MiscDP3Source) \
472 _V(LogicalShift) \ 498 _V(LogicalShift) \
473 _V(FPOneSource) \ 499 _V(FPOneSource) \
500 _V(FPTwoSource) \
474 _V(FPImm) \ 501 _V(FPImm) \
475 _V(FPIntCvt) \ 502 _V(FPIntCvt) \
503 _V(FPCompare) \
476 504
477 505
478 enum Shift { 506 enum Shift {
479 kNoShift = -1, 507 kNoShift = -1,
480 LSL = 0, // Logical shift left 508 LSL = 0, // Logical shift left
481 LSR = 1, // Logical shift right 509 LSR = 1, // Logical shift right
482 ASR = 2, // Arithmetic shift right 510 ASR = 2, // Arithmetic shift right
483 ROR = 3, // Rotate right 511 ROR = 3, // Rotate right
484 kMaxShift = 4, 512 kMaxShift = 4,
485 }; 513 };
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 kRmShift = 16, 555 kRmShift = 16,
528 kRmBits = 5, 556 kRmBits = 5,
529 kRtShift = 0, 557 kRtShift = 0,
530 kRtBits = 5, 558 kRtBits = 5,
531 559
532 // V Registers. 560 // V Registers.
533 kVdShift = 0, 561 kVdShift = 0,
534 kVdBits = 5, 562 kVdBits = 5,
535 kVnShift = 5, 563 kVnShift = 5,
536 kVnBits = 5, 564 kVnBits = 5,
565 kVmShift = 16,
566 kVmBits = 5,
537 kVtShift = 0, 567 kVtShift = 0,
538 kVtBits = 5, 568 kVtBits = 5,
539 569
540 // Immediates. 570 // Immediates.
541 kImm3Shift = 10, 571 kImm3Shift = 10,
542 kImm3Bits = 3, 572 kImm3Bits = 3,
543 kImm6Shift = 10, 573 kImm6Shift = 10,
544 kImm6Bits = 6, 574 kImm6Bits = 6,
545 kImm8Shift = 13, 575 kImm8Shift = 13,
546 kImm8Bits = 8, 576 kImm8Bits = 8,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 Bits(kRaShift, kRaBits)); } 727 Bits(kRaShift, kRaBits)); }
698 inline Register RmField() const { return static_cast<Register>( 728 inline Register RmField() const { return static_cast<Register>(
699 Bits(kRmShift, kRmBits)); } 729 Bits(kRmShift, kRmBits)); }
700 inline Register RtField() const { return static_cast<Register>( 730 inline Register RtField() const { return static_cast<Register>(
701 Bits(kRtShift, kRtBits)); } 731 Bits(kRtShift, kRtBits)); }
702 732
703 inline VRegister VdField() const { return static_cast<VRegister>( 733 inline VRegister VdField() const { return static_cast<VRegister>(
704 Bits(kVdShift, kVdBits)); } 734 Bits(kVdShift, kVdBits)); }
705 inline VRegister VnField() const { return static_cast<VRegister>( 735 inline VRegister VnField() const { return static_cast<VRegister>(
706 Bits(kVnShift, kVnBits)); } 736 Bits(kVnShift, kVnBits)); }
737 inline VRegister VmField() const { return static_cast<VRegister>(
738 Bits(kVmShift, kVmBits)); }
707 inline VRegister VtField() const { return static_cast<VRegister>( 739 inline VRegister VtField() const { return static_cast<VRegister>(
708 Bits(kVtShift, kVtBits)); } 740 Bits(kVtShift, kVtBits)); }
709 741
710 // Immediates 742 // Immediates
711 inline int Imm3Field() const { return Bits(kImm3Shift, kImm3Bits); } 743 inline int Imm3Field() const { return Bits(kImm3Shift, kImm3Bits); }
712 inline int Imm6Field() const { return Bits(kImm6Shift, kImm6Bits); } 744 inline int Imm6Field() const { return Bits(kImm6Shift, kImm6Bits); }
713 inline int Imm8Field() const { return Bits(kImm8Shift, kImm8Bits); } 745 inline int Imm8Field() const { return Bits(kImm8Shift, kImm8Bits); }
714 inline int Imm9Field() const { return Bits(kImm9Shift, kImm9Bits); } 746 inline int Imm9Field() const { return Bits(kImm9Shift, kImm9Bits); }
715 // Sign-extended Imm9Field() 747 // Sign-extended Imm9Field()
716 inline int64_t SImm9Field() const { 748 inline int64_t SImm9Field() const {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); } 907 static Instr* At(uword pc) { return reinterpret_cast<Instr*>(pc); }
876 908
877 private: 909 private:
878 DISALLOW_ALLOCATION(); 910 DISALLOW_ALLOCATION();
879 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr); 911 DISALLOW_IMPLICIT_CONSTRUCTORS(Instr);
880 }; 912 };
881 913
882 } // namespace dart 914 } // namespace dart
883 915
884 #endif // VM_CONSTANTS_ARM64_H_ 916 #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