| OLD | NEW |
| 1 //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===// | 1 //===- subzero/src/IceAssemblerARM32.h - Assembler for ARM32 ----*- C++ -*-===// |
| 2 // | 2 // |
| 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 // | 6 // |
| 7 // Modified by the Subzero authors. | 7 // Modified by the Subzero authors. |
| 8 // | 8 // |
| 9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
| 10 // | 10 // |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 public: | 65 public: |
| 66 // Rotation values. | 66 // Rotation values. |
| 67 enum RotationValue { | 67 enum RotationValue { |
| 68 kRotateNone, // Omitted | 68 kRotateNone, // Omitted |
| 69 kRotate8, // ror #8 | 69 kRotate8, // ror #8 |
| 70 kRotate16, // ror #16 | 70 kRotate16, // ror #16 |
| 71 kRotate24 // ror #24 | 71 kRotate24 // ror #24 |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 // Encoding of the number of D registers in a list of D registers. |
| 75 enum DRegListSize { |
| 76 DRegListSize1 = 7, // 0b0111 |
| 77 DRegListSize2 = 10, // 0b1010 |
| 78 DRegListSIze3 = 6, // 0b0110 |
| 79 DRegListSize4 = 2 // 0b0010 |
| 80 }; |
| 81 |
| 74 class TargetInfo { | 82 class TargetInfo { |
| 75 TargetInfo(const TargetInfo &) = delete; | 83 TargetInfo(const TargetInfo &) = delete; |
| 76 TargetInfo &operator=(const TargetInfo &) = delete; | 84 TargetInfo &operator=(const TargetInfo &) = delete; |
| 77 | 85 |
| 78 public: | 86 public: |
| 79 TargetInfo(bool HasFramePointer, SizeT FrameOrStackReg) | 87 TargetInfo(bool HasFramePointer, SizeT FrameOrStackReg) |
| 80 : HasFramePointer(HasFramePointer), FrameOrStackReg(FrameOrStackReg) {} | 88 : HasFramePointer(HasFramePointer), FrameOrStackReg(FrameOrStackReg) {} |
| 81 explicit TargetInfo(const TargetLowering *Target) | 89 explicit TargetInfo(const TargetLowering *Target) |
| 82 : HasFramePointer(Target->hasFramePointer()), | 90 : HasFramePointer(Target->hasFramePointer()), |
| 83 FrameOrStackReg(Target->getFrameOrStackReg()) {} | 91 FrameOrStackReg(Target->getFrameOrStackReg()) {} |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 398 |
| 391 void vldrs(const Operand *OpSd, const Operand *OpAddress, | 399 void vldrs(const Operand *OpSd, const Operand *OpAddress, |
| 392 CondARM32::Cond Cond, const TargetInfo &TInfo); | 400 CondARM32::Cond Cond, const TargetInfo &TInfo); |
| 393 | 401 |
| 394 void vldrs(const Operand *OpSd, const Operand *OpAddress, | 402 void vldrs(const Operand *OpSd, const Operand *OpAddress, |
| 395 CondARM32::Cond Cond, const TargetLowering *Lowering) { | 403 CondARM32::Cond Cond, const TargetLowering *Lowering) { |
| 396 const TargetInfo TInfo(Lowering); | 404 const TargetInfo TInfo(Lowering); |
| 397 vldrs(OpSd, OpAddress, Cond, TInfo); | 405 vldrs(OpSd, OpAddress, Cond, TInfo); |
| 398 } | 406 } |
| 399 | 407 |
| 408 // ElmtSize = #bits in vector element. |
| 409 void vld1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpRn, |
| 410 const TargetInfo &TInfo); |
| 411 |
| 412 void vld1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpRn, |
| 413 const TargetLowering *Lowering) { |
| 414 const TargetInfo TInfo(Lowering); |
| 415 vld1qr(ElmtSize, OpQd, OpRn, TInfo); |
| 416 } |
| 417 |
| 400 void vmovd(const Operand *OpDn, const OperandARM32FlexFpImm *OpFpImm, | 418 void vmovd(const Operand *OpDn, const OperandARM32FlexFpImm *OpFpImm, |
| 401 CondARM32::Cond Cond); | 419 CondARM32::Cond Cond); |
| 402 | 420 |
| 403 void vmovdd(const Operand *OpDd, const Variable *OpDm, CondARM32::Cond Cond); | 421 void vmovdd(const Operand *OpDd, const Variable *OpDm, CondARM32::Cond Cond); |
| 404 | 422 |
| 405 void vmovdrr(const Operand *OpDm, const Operand *OpRt, const Operand *OpRt2, | 423 void vmovdrr(const Operand *OpDm, const Operand *OpRt, const Operand *OpRt2, |
| 406 CondARM32::Cond Cond); | 424 CondARM32::Cond Cond); |
| 407 | 425 |
| 408 void vmovrrd(const Operand *OpRt, const Operand *OpRt2, const Operand *OpDm, | 426 void vmovrrd(const Operand *OpRt, const Operand *OpRt2, const Operand *OpDm, |
| 409 CondARM32::Cond Cond); | 427 CondARM32::Cond Cond); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 486 |
| 469 void vstrs(const Operand *OpSd, const Operand *OpAddress, | 487 void vstrs(const Operand *OpSd, const Operand *OpAddress, |
| 470 CondARM32::Cond Cond, const TargetInfo &TInfo); | 488 CondARM32::Cond Cond, const TargetInfo &TInfo); |
| 471 | 489 |
| 472 void vstrs(const Operand *OpSd, const Operand *OpAddress, | 490 void vstrs(const Operand *OpSd, const Operand *OpAddress, |
| 473 CondARM32::Cond Cond, const TargetLowering *Lowering) { | 491 CondARM32::Cond Cond, const TargetLowering *Lowering) { |
| 474 const TargetInfo TInfo(Lowering); | 492 const TargetInfo TInfo(Lowering); |
| 475 vstrs(OpSd, OpAddress, Cond, TInfo); | 493 vstrs(OpSd, OpAddress, Cond, TInfo); |
| 476 } | 494 } |
| 477 | 495 |
| 496 // ElmtSize = #bits in vector element. |
| 497 void vst1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpAddress, |
| 498 const TargetInfo &TInfo); |
| 499 |
| 500 void vst1qr(size_t ElmtSize, const Operand *OpQd, const Operand *OpRn, |
| 501 const TargetLowering *Lowering) { |
| 502 const TargetInfo TInfo(Lowering); |
| 503 vst1qr(ElmtSize, OpQd, OpRn, TInfo); |
| 504 } |
| 505 |
| 478 void vsubd(const Operand *OpDd, const Operand *OpDn, const Operand *OpDm, | 506 void vsubd(const Operand *OpDd, const Operand *OpDn, const Operand *OpDm, |
| 479 CondARM32::Cond Cond); | 507 CondARM32::Cond Cond); |
| 480 | 508 |
| 481 // Integer vector subtract. | 509 // Integer vector subtract. |
| 482 void vsubqi(Type ElmtTy, const Operand *OpQd, const Operand *OpQm, | 510 void vsubqi(Type ElmtTy, const Operand *OpQd, const Operand *OpQm, |
| 483 const Operand *OpQn); | 511 const Operand *OpQn); |
| 484 | 512 |
| 485 // Float vector subtract | 513 // Float vector subtract |
| 486 void vsubqf(const Operand *OpQd, const Operand *OpQm, const Operand *OpQn); | 514 void vsubqf(const Operand *OpQd, const Operand *OpQm, const Operand *OpQn); |
| 487 | 515 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 const Variable *OpBaseReg, SizeT NumConsecRegs); | 620 const Variable *OpBaseReg, SizeT NumConsecRegs); |
| 593 | 621 |
| 594 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, ddddD=Sd, | 622 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, ddddD=Sd, |
| 595 // Mmmmm=Dm, and xx0xxxxxxdddd000xxx0x0000=Opcode. | 623 // Mmmmm=Dm, and xx0xxxxxxdddd000xxx0x0000=Opcode. |
| 596 void emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd, IValueT Dm); | 624 void emitVFPsd(CondARM32::Cond Cond, IValueT Opcode, IValueT Sd, IValueT Dm); |
| 597 | 625 |
| 598 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, Ddddd=Dd, | 626 // Pattern cccc111xxDxxxxxxdddd101xxxMxmmmm where cccc=Cond, Ddddd=Dd, |
| 599 // mmmmM=Sm, and xx0xxxxxxdddd000xxx0x0000=Opcode. | 627 // mmmmM=Sm, and xx0xxxxxxdddd000xxx0x0000=Opcode. |
| 600 void emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, IValueT Sm); | 628 void emitVFPds(CondARM32::Cond Cond, IValueT Opcode, IValueT Dd, IValueT Sm); |
| 601 | 629 |
| 630 // Pattern 111100000D00nnnnddddttttssaammmm | Opcode where Ddddd=Dd, nnnn=Rn, |
| 631 // mmmmm=Rm, tttt=NumDRegs, ElmtSize in {8, 16, 32, 64) and defines ss, and |
| 632 // aa=Align. |
| 633 void emitVMem1Op(IValueT Opcode, IValueT Dd, IValueT Rn, IValueT Rm, |
| 634 DRegListSize NumDRegs, size_t ElmtSize, IValueT Align, |
| 635 const char *InstName); |
| 636 |
| 602 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, | 637 // Pattern cccc011100x1dddd1111mmmm0001nnn where cccc=Cond, |
| 603 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. | 638 // x=Opcode, dddd=Rd, nnnn=Rn, mmmm=Rm. |
| 604 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 639 void emitDivOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
| 605 IValueT Rm); | 640 IValueT Rm); |
| 606 | 641 |
| 607 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 642 // Pattern ccccxxxxxxxfnnnnddddssss1001mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 608 // mmmm=Rm, ssss=Rs, f=SetFlags and xxxxxxx=Opcode. | 643 // mmmm=Rm, ssss=Rs, f=SetFlags and xxxxxxx=Opcode. |
| 609 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, | 644 void emitMulOp(CondARM32::Cond Cond, IValueT Opcode, IValueT Rd, IValueT Rn, |
| 610 IValueT Rm, IValueT Rs, bool SetFlags); | 645 IValueT Rm, IValueT Rs, bool SetFlags); |
| 611 | 646 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 706 |
| 672 void emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpSd, | 707 void emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, const Operand *OpSd, |
| 673 const Operand *OpSn, const Operand *OpSm, | 708 const Operand *OpSn, const Operand *OpSm, |
| 674 const char *InstName); | 709 const char *InstName); |
| 675 }; | 710 }; |
| 676 | 711 |
| 677 } // end of namespace ARM32 | 712 } // end of namespace ARM32 |
| 678 } // end of namespace Ice | 713 } // end of namespace Ice |
| 679 | 714 |
| 680 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H | 715 #endif // SUBZERO_SRC_ICEASSEMBLERARM32_H |
| OLD | NEW |