| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ | 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ |
| 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ | 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ |
| 7 | 7 |
| 8 #include <ctype.h> | 8 #include <ctype.h> |
| 9 | 9 |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 547 |
| 548 void MacroAssembler::Extr(const Register& rd, | 548 void MacroAssembler::Extr(const Register& rd, |
| 549 const Register& rn, | 549 const Register& rn, |
| 550 const Register& rm, | 550 const Register& rm, |
| 551 unsigned lsb) { | 551 unsigned lsb) { |
| 552 DCHECK(allow_macro_instructions_); | 552 DCHECK(allow_macro_instructions_); |
| 553 DCHECK(!rd.IsZero()); | 553 DCHECK(!rd.IsZero()); |
| 554 extr(rd, rn, rm, lsb); | 554 extr(rd, rn, rm, lsb); |
| 555 } | 555 } |
| 556 | 556 |
| 557 | 557 void MacroAssembler::Fabs(const VRegister& fd, const VRegister& fn) { |
| 558 void MacroAssembler::Fabs(const FPRegister& fd, const FPRegister& fn) { | |
| 559 DCHECK(allow_macro_instructions_); | 558 DCHECK(allow_macro_instructions_); |
| 560 fabs(fd, fn); | 559 fabs(fd, fn); |
| 561 } | 560 } |
| 562 | 561 |
| 563 | 562 void MacroAssembler::Fadd(const VRegister& fd, const VRegister& fn, |
| 564 void MacroAssembler::Fadd(const FPRegister& fd, | 563 const VRegister& fm) { |
| 565 const FPRegister& fn, | |
| 566 const FPRegister& fm) { | |
| 567 DCHECK(allow_macro_instructions_); | 564 DCHECK(allow_macro_instructions_); |
| 568 fadd(fd, fn, fm); | 565 fadd(fd, fn, fm); |
| 569 } | 566 } |
| 570 | 567 |
| 571 | 568 void MacroAssembler::Fccmp(const VRegister& fn, const VRegister& fm, |
| 572 void MacroAssembler::Fccmp(const FPRegister& fn, | 569 StatusFlags nzcv, Condition cond) { |
| 573 const FPRegister& fm, | |
| 574 StatusFlags nzcv, | |
| 575 Condition cond) { | |
| 576 DCHECK(allow_macro_instructions_); | 570 DCHECK(allow_macro_instructions_); |
| 577 DCHECK((cond != al) && (cond != nv)); | 571 DCHECK((cond != al) && (cond != nv)); |
| 578 fccmp(fn, fm, nzcv, cond); | 572 fccmp(fn, fm, nzcv, cond); |
| 579 } | 573 } |
| 580 | 574 |
| 581 | 575 void MacroAssembler::Fcmp(const VRegister& fn, const VRegister& fm) { |
| 582 void MacroAssembler::Fcmp(const FPRegister& fn, const FPRegister& fm) { | |
| 583 DCHECK(allow_macro_instructions_); | 576 DCHECK(allow_macro_instructions_); |
| 584 fcmp(fn, fm); | 577 fcmp(fn, fm); |
| 585 } | 578 } |
| 586 | 579 |
| 587 | 580 void MacroAssembler::Fcmp(const VRegister& fn, double value) { |
| 588 void MacroAssembler::Fcmp(const FPRegister& fn, double value) { | |
| 589 DCHECK(allow_macro_instructions_); | 581 DCHECK(allow_macro_instructions_); |
| 590 if (value != 0.0) { | 582 if (value != 0.0) { |
| 591 UseScratchRegisterScope temps(this); | 583 UseScratchRegisterScope temps(this); |
| 592 FPRegister tmp = temps.AcquireSameSizeAs(fn); | 584 VRegister tmp = temps.AcquireSameSizeAs(fn); |
| 593 Fmov(tmp, value); | 585 Fmov(tmp, value); |
| 594 fcmp(fn, tmp); | 586 fcmp(fn, tmp); |
| 595 } else { | 587 } else { |
| 596 fcmp(fn, value); | 588 fcmp(fn, value); |
| 597 } | 589 } |
| 598 } | 590 } |
| 599 | 591 |
| 600 | 592 void MacroAssembler::Fcsel(const VRegister& fd, const VRegister& fn, |
| 601 void MacroAssembler::Fcsel(const FPRegister& fd, | 593 const VRegister& fm, Condition cond) { |
| 602 const FPRegister& fn, | |
| 603 const FPRegister& fm, | |
| 604 Condition cond) { | |
| 605 DCHECK(allow_macro_instructions_); | 594 DCHECK(allow_macro_instructions_); |
| 606 DCHECK((cond != al) && (cond != nv)); | 595 DCHECK((cond != al) && (cond != nv)); |
| 607 fcsel(fd, fn, fm, cond); | 596 fcsel(fd, fn, fm, cond); |
| 608 } | 597 } |
| 609 | 598 |
| 610 | 599 void MacroAssembler::Fcvt(const VRegister& fd, const VRegister& fn) { |
| 611 void MacroAssembler::Fcvt(const FPRegister& fd, const FPRegister& fn) { | |
| 612 DCHECK(allow_macro_instructions_); | 600 DCHECK(allow_macro_instructions_); |
| 613 fcvt(fd, fn); | 601 fcvt(fd, fn); |
| 614 } | 602 } |
| 615 | 603 |
| 616 | 604 void MacroAssembler::Fcvtas(const Register& rd, const VRegister& fn) { |
| 617 void MacroAssembler::Fcvtas(const Register& rd, const FPRegister& fn) { | |
| 618 DCHECK(allow_macro_instructions_); | 605 DCHECK(allow_macro_instructions_); |
| 619 DCHECK(!rd.IsZero()); | 606 DCHECK(!rd.IsZero()); |
| 620 fcvtas(rd, fn); | 607 fcvtas(rd, fn); |
| 621 } | 608 } |
| 622 | 609 |
| 623 | 610 void MacroAssembler::Fcvtau(const Register& rd, const VRegister& fn) { |
| 624 void MacroAssembler::Fcvtau(const Register& rd, const FPRegister& fn) { | |
| 625 DCHECK(allow_macro_instructions_); | 611 DCHECK(allow_macro_instructions_); |
| 626 DCHECK(!rd.IsZero()); | 612 DCHECK(!rd.IsZero()); |
| 627 fcvtau(rd, fn); | 613 fcvtau(rd, fn); |
| 628 } | 614 } |
| 629 | 615 |
| 630 | 616 void MacroAssembler::Fcvtms(const Register& rd, const VRegister& fn) { |
| 631 void MacroAssembler::Fcvtms(const Register& rd, const FPRegister& fn) { | |
| 632 DCHECK(allow_macro_instructions_); | 617 DCHECK(allow_macro_instructions_); |
| 633 DCHECK(!rd.IsZero()); | 618 DCHECK(!rd.IsZero()); |
| 634 fcvtms(rd, fn); | 619 fcvtms(rd, fn); |
| 635 } | 620 } |
| 636 | 621 |
| 637 | 622 void MacroAssembler::Fcvtmu(const Register& rd, const VRegister& fn) { |
| 638 void MacroAssembler::Fcvtmu(const Register& rd, const FPRegister& fn) { | |
| 639 DCHECK(allow_macro_instructions_); | 623 DCHECK(allow_macro_instructions_); |
| 640 DCHECK(!rd.IsZero()); | 624 DCHECK(!rd.IsZero()); |
| 641 fcvtmu(rd, fn); | 625 fcvtmu(rd, fn); |
| 642 } | 626 } |
| 643 | 627 |
| 644 | 628 void MacroAssembler::Fcvtns(const Register& rd, const VRegister& fn) { |
| 645 void MacroAssembler::Fcvtns(const Register& rd, const FPRegister& fn) { | |
| 646 DCHECK(allow_macro_instructions_); | 629 DCHECK(allow_macro_instructions_); |
| 647 DCHECK(!rd.IsZero()); | 630 DCHECK(!rd.IsZero()); |
| 648 fcvtns(rd, fn); | 631 fcvtns(rd, fn); |
| 649 } | 632 } |
| 650 | 633 |
| 651 | 634 void MacroAssembler::Fcvtnu(const Register& rd, const VRegister& fn) { |
| 652 void MacroAssembler::Fcvtnu(const Register& rd, const FPRegister& fn) { | |
| 653 DCHECK(allow_macro_instructions_); | 635 DCHECK(allow_macro_instructions_); |
| 654 DCHECK(!rd.IsZero()); | 636 DCHECK(!rd.IsZero()); |
| 655 fcvtnu(rd, fn); | 637 fcvtnu(rd, fn); |
| 656 } | 638 } |
| 657 | 639 |
| 658 | 640 void MacroAssembler::Fcvtzs(const Register& rd, const VRegister& fn) { |
| 659 void MacroAssembler::Fcvtzs(const Register& rd, const FPRegister& fn) { | |
| 660 DCHECK(allow_macro_instructions_); | 641 DCHECK(allow_macro_instructions_); |
| 661 DCHECK(!rd.IsZero()); | 642 DCHECK(!rd.IsZero()); |
| 662 fcvtzs(rd, fn); | 643 fcvtzs(rd, fn); |
| 663 } | 644 } |
| 664 void MacroAssembler::Fcvtzu(const Register& rd, const FPRegister& fn) { | 645 void MacroAssembler::Fcvtzu(const Register& rd, const VRegister& fn) { |
| 665 DCHECK(allow_macro_instructions_); | 646 DCHECK(allow_macro_instructions_); |
| 666 DCHECK(!rd.IsZero()); | 647 DCHECK(!rd.IsZero()); |
| 667 fcvtzu(rd, fn); | 648 fcvtzu(rd, fn); |
| 668 } | 649 } |
| 669 | 650 |
| 670 | 651 void MacroAssembler::Fdiv(const VRegister& fd, const VRegister& fn, |
| 671 void MacroAssembler::Fdiv(const FPRegister& fd, | 652 const VRegister& fm) { |
| 672 const FPRegister& fn, | |
| 673 const FPRegister& fm) { | |
| 674 DCHECK(allow_macro_instructions_); | 653 DCHECK(allow_macro_instructions_); |
| 675 fdiv(fd, fn, fm); | 654 fdiv(fd, fn, fm); |
| 676 } | 655 } |
| 677 | 656 |
| 678 | 657 void MacroAssembler::Fmadd(const VRegister& fd, const VRegister& fn, |
| 679 void MacroAssembler::Fmadd(const FPRegister& fd, | 658 const VRegister& fm, const VRegister& fa) { |
| 680 const FPRegister& fn, | |
| 681 const FPRegister& fm, | |
| 682 const FPRegister& fa) { | |
| 683 DCHECK(allow_macro_instructions_); | 659 DCHECK(allow_macro_instructions_); |
| 684 fmadd(fd, fn, fm, fa); | 660 fmadd(fd, fn, fm, fa); |
| 685 } | 661 } |
| 686 | 662 |
| 687 | 663 void MacroAssembler::Fmax(const VRegister& fd, const VRegister& fn, |
| 688 void MacroAssembler::Fmax(const FPRegister& fd, | 664 const VRegister& fm) { |
| 689 const FPRegister& fn, | |
| 690 const FPRegister& fm) { | |
| 691 DCHECK(allow_macro_instructions_); | 665 DCHECK(allow_macro_instructions_); |
| 692 fmax(fd, fn, fm); | 666 fmax(fd, fn, fm); |
| 693 } | 667 } |
| 694 | 668 |
| 695 | 669 void MacroAssembler::Fmaxnm(const VRegister& fd, const VRegister& fn, |
| 696 void MacroAssembler::Fmaxnm(const FPRegister& fd, | 670 const VRegister& fm) { |
| 697 const FPRegister& fn, | |
| 698 const FPRegister& fm) { | |
| 699 DCHECK(allow_macro_instructions_); | 671 DCHECK(allow_macro_instructions_); |
| 700 fmaxnm(fd, fn, fm); | 672 fmaxnm(fd, fn, fm); |
| 701 } | 673 } |
| 702 | 674 |
| 703 | 675 void MacroAssembler::Fmin(const VRegister& fd, const VRegister& fn, |
| 704 void MacroAssembler::Fmin(const FPRegister& fd, | 676 const VRegister& fm) { |
| 705 const FPRegister& fn, | |
| 706 const FPRegister& fm) { | |
| 707 DCHECK(allow_macro_instructions_); | 677 DCHECK(allow_macro_instructions_); |
| 708 fmin(fd, fn, fm); | 678 fmin(fd, fn, fm); |
| 709 } | 679 } |
| 710 | 680 |
| 711 | 681 void MacroAssembler::Fminnm(const VRegister& fd, const VRegister& fn, |
| 712 void MacroAssembler::Fminnm(const FPRegister& fd, | 682 const VRegister& fm) { |
| 713 const FPRegister& fn, | |
| 714 const FPRegister& fm) { | |
| 715 DCHECK(allow_macro_instructions_); | 683 DCHECK(allow_macro_instructions_); |
| 716 fminnm(fd, fn, fm); | 684 fminnm(fd, fn, fm); |
| 717 } | 685 } |
| 718 | 686 |
| 719 | 687 void MacroAssembler::Fmov(VRegister fd, VRegister fn) { |
| 720 void MacroAssembler::Fmov(FPRegister fd, FPRegister fn) { | |
| 721 DCHECK(allow_macro_instructions_); | 688 DCHECK(allow_macro_instructions_); |
| 722 // Only emit an instruction if fd and fn are different, and they are both D | 689 // Only emit an instruction if fd and fn are different, and they are both D |
| 723 // registers. fmov(s0, s0) is not a no-op because it clears the top word of | 690 // registers. fmov(s0, s0) is not a no-op because it clears the top word of |
| 724 // d0. Technically, fmov(d0, d0) is not a no-op either because it clears the | 691 // d0. Technically, fmov(d0, d0) is not a no-op either because it clears the |
| 725 // top of q0, but FPRegister does not currently support Q registers. | 692 // top of q0, but VRegister does not currently support Q registers. |
| 726 if (!fd.Is(fn) || !fd.Is64Bits()) { | 693 if (!fd.Is(fn) || !fd.Is64Bits()) { |
| 727 fmov(fd, fn); | 694 fmov(fd, fn); |
| 728 } | 695 } |
| 729 } | 696 } |
| 730 | 697 |
| 731 | 698 void MacroAssembler::Fmov(VRegister fd, Register rn) { |
| 732 void MacroAssembler::Fmov(FPRegister fd, Register rn) { | |
| 733 DCHECK(allow_macro_instructions_); | 699 DCHECK(allow_macro_instructions_); |
| 734 fmov(fd, rn); | 700 fmov(fd, rn); |
| 735 } | 701 } |
| 736 | 702 |
| 737 | 703 void MacroAssembler::Fmov(VRegister vd, double imm) { |
| 738 void MacroAssembler::Fmov(FPRegister fd, double imm) { | 704 DCHECK(allow_macro_instructions_); |
| 739 DCHECK(allow_macro_instructions_); | 705 |
| 740 if (fd.Is32Bits()) { | 706 if (vd.Is1S() || vd.Is2S() || vd.Is4S()) { |
| 741 Fmov(fd, static_cast<float>(imm)); | 707 Fmov(vd, static_cast<float>(imm)); |
| 742 return; | 708 return; |
| 743 } | 709 } |
| 744 | 710 |
| 745 DCHECK(fd.Is64Bits()); | 711 DCHECK(vd.Is1D() || vd.Is2D()); |
| 746 if (IsImmFP64(imm)) { | 712 if (IsImmFP64(imm)) { |
| 747 fmov(fd, imm); | 713 fmov(vd, imm); |
| 748 } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) { | |
| 749 fmov(fd, xzr); | |
| 750 } else { | 714 } else { |
| 751 Ldr(fd, imm); | 715 uint64_t bits = bit_cast<uint64_t>(imm); |
| 752 } | 716 if (vd.IsScalar()) { |
| 753 } | 717 if (bits == 0) { |
| 754 | 718 fmov(vd, xzr); |
| 755 | 719 } else { |
| 756 void MacroAssembler::Fmov(FPRegister fd, float imm) { | 720 Ldr(vd, imm); |
| 757 DCHECK(allow_macro_instructions_); | 721 } |
| 758 if (fd.Is64Bits()) { | 722 } else { |
| 759 Fmov(fd, static_cast<double>(imm)); | 723 // TODO(all): consider NEON support for load literal. |
| 724 Movi(vd, bits); |
| 725 } |
| 726 } |
| 727 } |
| 728 |
| 729 void MacroAssembler::Fmov(VRegister vd, float imm) { |
| 730 DCHECK(allow_macro_instructions_); |
| 731 if (vd.Is1D() || vd.Is2D()) { |
| 732 Fmov(vd, static_cast<double>(imm)); |
| 760 return; | 733 return; |
| 761 } | 734 } |
| 762 | 735 |
| 763 DCHECK(fd.Is32Bits()); | 736 DCHECK(vd.Is1S() || vd.Is2S() || vd.Is4S()); |
| 764 if (IsImmFP32(imm)) { | 737 if (IsImmFP32(imm)) { |
| 765 fmov(fd, imm); | 738 fmov(vd, imm); |
| 766 } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) { | |
| 767 fmov(fd, wzr); | |
| 768 } else { | 739 } else { |
| 769 UseScratchRegisterScope temps(this); | 740 uint32_t bits = bit_cast<uint32_t>(imm); |
| 770 Register tmp = temps.AcquireW(); | 741 if (vd.IsScalar()) { |
| 771 // TODO(all): Use Assembler::ldr(const FPRegister& ft, float imm). | 742 if (bits == 0) { |
| 772 Mov(tmp, float_to_rawbits(imm)); | 743 fmov(vd, wzr); |
| 773 Fmov(fd, tmp); | 744 } else { |
| 774 } | 745 UseScratchRegisterScope temps(this); |
| 775 } | 746 Register tmp = temps.AcquireW(); |
| 776 | 747 // TODO(all): Use Assembler::ldr(const VRegister& ft, float imm). |
| 777 | 748 Mov(tmp, bit_cast<uint32_t>(imm)); |
| 778 void MacroAssembler::Fmov(Register rd, FPRegister fn) { | 749 Fmov(vd, tmp); |
| 750 } |
| 751 } else { |
| 752 // TODO(all): consider NEON support for load literal. |
| 753 Movi(vd, bits); |
| 754 } |
| 755 } |
| 756 } |
| 757 |
| 758 void MacroAssembler::Fmov(Register rd, VRegister fn) { |
| 779 DCHECK(allow_macro_instructions_); | 759 DCHECK(allow_macro_instructions_); |
| 780 DCHECK(!rd.IsZero()); | 760 DCHECK(!rd.IsZero()); |
| 781 fmov(rd, fn); | 761 fmov(rd, fn); |
| 782 } | 762 } |
| 783 | 763 |
| 784 | 764 void MacroAssembler::Fmsub(const VRegister& fd, const VRegister& fn, |
| 785 void MacroAssembler::Fmsub(const FPRegister& fd, | 765 const VRegister& fm, const VRegister& fa) { |
| 786 const FPRegister& fn, | |
| 787 const FPRegister& fm, | |
| 788 const FPRegister& fa) { | |
| 789 DCHECK(allow_macro_instructions_); | 766 DCHECK(allow_macro_instructions_); |
| 790 fmsub(fd, fn, fm, fa); | 767 fmsub(fd, fn, fm, fa); |
| 791 } | 768 } |
| 792 | 769 |
| 793 | 770 void MacroAssembler::Fmul(const VRegister& fd, const VRegister& fn, |
| 794 void MacroAssembler::Fmul(const FPRegister& fd, | 771 const VRegister& fm) { |
| 795 const FPRegister& fn, | |
| 796 const FPRegister& fm) { | |
| 797 DCHECK(allow_macro_instructions_); | 772 DCHECK(allow_macro_instructions_); |
| 798 fmul(fd, fn, fm); | 773 fmul(fd, fn, fm); |
| 799 } | 774 } |
| 800 | 775 |
| 801 | 776 void MacroAssembler::Fnmadd(const VRegister& fd, const VRegister& fn, |
| 802 void MacroAssembler::Fneg(const FPRegister& fd, const FPRegister& fn) { | 777 const VRegister& fm, const VRegister& fa) { |
| 803 DCHECK(allow_macro_instructions_); | |
| 804 fneg(fd, fn); | |
| 805 } | |
| 806 | |
| 807 | |
| 808 void MacroAssembler::Fnmadd(const FPRegister& fd, | |
| 809 const FPRegister& fn, | |
| 810 const FPRegister& fm, | |
| 811 const FPRegister& fa) { | |
| 812 DCHECK(allow_macro_instructions_); | 778 DCHECK(allow_macro_instructions_); |
| 813 fnmadd(fd, fn, fm, fa); | 779 fnmadd(fd, fn, fm, fa); |
| 814 } | 780 } |
| 815 | 781 |
| 816 | 782 void MacroAssembler::Fnmsub(const VRegister& fd, const VRegister& fn, |
| 817 void MacroAssembler::Fnmsub(const FPRegister& fd, | 783 const VRegister& fm, const VRegister& fa) { |
| 818 const FPRegister& fn, | |
| 819 const FPRegister& fm, | |
| 820 const FPRegister& fa) { | |
| 821 DCHECK(allow_macro_instructions_); | 784 DCHECK(allow_macro_instructions_); |
| 822 fnmsub(fd, fn, fm, fa); | 785 fnmsub(fd, fn, fm, fa); |
| 823 } | 786 } |
| 824 | 787 |
| 825 | 788 void MacroAssembler::Fsub(const VRegister& fd, const VRegister& fn, |
| 826 void MacroAssembler::Frinta(const FPRegister& fd, const FPRegister& fn) { | 789 const VRegister& fm) { |
| 827 DCHECK(allow_macro_instructions_); | |
| 828 frinta(fd, fn); | |
| 829 } | |
| 830 | |
| 831 | |
| 832 void MacroAssembler::Frintm(const FPRegister& fd, const FPRegister& fn) { | |
| 833 DCHECK(allow_macro_instructions_); | |
| 834 frintm(fd, fn); | |
| 835 } | |
| 836 | |
| 837 | |
| 838 void MacroAssembler::Frintn(const FPRegister& fd, const FPRegister& fn) { | |
| 839 DCHECK(allow_macro_instructions_); | |
| 840 frintn(fd, fn); | |
| 841 } | |
| 842 | |
| 843 | |
| 844 void MacroAssembler::Frintp(const FPRegister& fd, const FPRegister& fn) { | |
| 845 DCHECK(allow_macro_instructions_); | |
| 846 frintp(fd, fn); | |
| 847 } | |
| 848 | |
| 849 | |
| 850 void MacroAssembler::Frintz(const FPRegister& fd, const FPRegister& fn) { | |
| 851 DCHECK(allow_macro_instructions_); | |
| 852 frintz(fd, fn); | |
| 853 } | |
| 854 | |
| 855 | |
| 856 void MacroAssembler::Fsqrt(const FPRegister& fd, const FPRegister& fn) { | |
| 857 DCHECK(allow_macro_instructions_); | |
| 858 fsqrt(fd, fn); | |
| 859 } | |
| 860 | |
| 861 | |
| 862 void MacroAssembler::Fsub(const FPRegister& fd, | |
| 863 const FPRegister& fn, | |
| 864 const FPRegister& fm) { | |
| 865 DCHECK(allow_macro_instructions_); | 790 DCHECK(allow_macro_instructions_); |
| 866 fsub(fd, fn, fm); | 791 fsub(fd, fn, fm); |
| 867 } | 792 } |
| 868 | 793 |
| 869 | 794 |
| 870 void MacroAssembler::Hint(SystemHint code) { | 795 void MacroAssembler::Hint(SystemHint code) { |
| 871 DCHECK(allow_macro_instructions_); | 796 DCHECK(allow_macro_instructions_); |
| 872 hint(code); | 797 hint(code); |
| 873 } | 798 } |
| 874 | 799 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 887 | 812 |
| 888 void MacroAssembler::Ldr(const CPURegister& rt, const Immediate& imm) { | 813 void MacroAssembler::Ldr(const CPURegister& rt, const Immediate& imm) { |
| 889 DCHECK(allow_macro_instructions_); | 814 DCHECK(allow_macro_instructions_); |
| 890 ldr(rt, imm); | 815 ldr(rt, imm); |
| 891 } | 816 } |
| 892 | 817 |
| 893 | 818 |
| 894 void MacroAssembler::Ldr(const CPURegister& rt, double imm) { | 819 void MacroAssembler::Ldr(const CPURegister& rt, double imm) { |
| 895 DCHECK(allow_macro_instructions_); | 820 DCHECK(allow_macro_instructions_); |
| 896 DCHECK(rt.Is64Bits()); | 821 DCHECK(rt.Is64Bits()); |
| 897 ldr(rt, Immediate(double_to_rawbits(imm))); | 822 ldr(rt, Immediate(bit_cast<uint64_t>(imm))); |
| 898 } | 823 } |
| 899 | 824 |
| 900 | 825 |
| 901 void MacroAssembler::Lsl(const Register& rd, | 826 void MacroAssembler::Lsl(const Register& rd, |
| 902 const Register& rn, | 827 const Register& rn, |
| 903 unsigned shift) { | 828 unsigned shift) { |
| 904 DCHECK(allow_macro_instructions_); | 829 DCHECK(allow_macro_instructions_); |
| 905 DCHECK(!rd.IsZero()); | 830 DCHECK(!rd.IsZero()); |
| 906 lsl(rd, rn, shift); | 831 lsl(rd, rn, shift); |
| 907 } | 832 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 | 995 |
| 1071 void MacroAssembler::Sbfx(const Register& rd, | 996 void MacroAssembler::Sbfx(const Register& rd, |
| 1072 const Register& rn, | 997 const Register& rn, |
| 1073 unsigned lsb, | 998 unsigned lsb, |
| 1074 unsigned width) { | 999 unsigned width) { |
| 1075 DCHECK(allow_macro_instructions_); | 1000 DCHECK(allow_macro_instructions_); |
| 1076 DCHECK(!rd.IsZero()); | 1001 DCHECK(!rd.IsZero()); |
| 1077 sbfx(rd, rn, lsb, width); | 1002 sbfx(rd, rn, lsb, width); |
| 1078 } | 1003 } |
| 1079 | 1004 |
| 1080 | 1005 void MacroAssembler::Scvtf(const VRegister& fd, const Register& rn, |
| 1081 void MacroAssembler::Scvtf(const FPRegister& fd, | |
| 1082 const Register& rn, | |
| 1083 unsigned fbits) { | 1006 unsigned fbits) { |
| 1084 DCHECK(allow_macro_instructions_); | 1007 DCHECK(allow_macro_instructions_); |
| 1085 scvtf(fd, rn, fbits); | 1008 scvtf(fd, rn, fbits); |
| 1086 } | 1009 } |
| 1087 | 1010 |
| 1088 | 1011 |
| 1089 void MacroAssembler::Sdiv(const Register& rd, | 1012 void MacroAssembler::Sdiv(const Register& rd, |
| 1090 const Register& rn, | 1013 const Register& rn, |
| 1091 const Register& rm) { | 1014 const Register& rm) { |
| 1092 DCHECK(allow_macro_instructions_); | 1015 DCHECK(allow_macro_instructions_); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 | 1097 |
| 1175 void MacroAssembler::Ubfx(const Register& rd, | 1098 void MacroAssembler::Ubfx(const Register& rd, |
| 1176 const Register& rn, | 1099 const Register& rn, |
| 1177 unsigned lsb, | 1100 unsigned lsb, |
| 1178 unsigned width) { | 1101 unsigned width) { |
| 1179 DCHECK(allow_macro_instructions_); | 1102 DCHECK(allow_macro_instructions_); |
| 1180 DCHECK(!rd.IsZero()); | 1103 DCHECK(!rd.IsZero()); |
| 1181 ubfx(rd, rn, lsb, width); | 1104 ubfx(rd, rn, lsb, width); |
| 1182 } | 1105 } |
| 1183 | 1106 |
| 1184 | 1107 void MacroAssembler::Ucvtf(const VRegister& fd, const Register& rn, |
| 1185 void MacroAssembler::Ucvtf(const FPRegister& fd, | |
| 1186 const Register& rn, | |
| 1187 unsigned fbits) { | 1108 unsigned fbits) { |
| 1188 DCHECK(allow_macro_instructions_); | 1109 DCHECK(allow_macro_instructions_); |
| 1189 ucvtf(fd, rn, fbits); | 1110 ucvtf(fd, rn, fbits); |
| 1190 } | 1111 } |
| 1191 | 1112 |
| 1192 | 1113 |
| 1193 void MacroAssembler::Udiv(const Register& rd, | 1114 void MacroAssembler::Udiv(const Register& rd, |
| 1194 const Register& rn, | 1115 const Register& rn, |
| 1195 const Register& rm) { | 1116 const Register& rm) { |
| 1196 DCHECK(allow_macro_instructions_); | 1117 DCHECK(allow_macro_instructions_); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 DCHECK(dst.Is64Bits() && src.Is64Bits()); | 1231 DCHECK(dst.Is64Bits() && src.Is64Bits()); |
| 1311 if (FLAG_enable_slow_asserts) { | 1232 if (FLAG_enable_slow_asserts) { |
| 1312 AssertSmi(src); | 1233 AssertSmi(src); |
| 1313 } | 1234 } |
| 1314 Asr(dst, src, kSmiShift); | 1235 Asr(dst, src, kSmiShift); |
| 1315 } | 1236 } |
| 1316 | 1237 |
| 1317 | 1238 |
| 1318 void MacroAssembler::SmiUntag(Register smi) { SmiUntag(smi, smi); } | 1239 void MacroAssembler::SmiUntag(Register smi) { SmiUntag(smi, smi); } |
| 1319 | 1240 |
| 1320 | 1241 void MacroAssembler::SmiUntagToDouble(VRegister dst, Register src, |
| 1321 void MacroAssembler::SmiUntagToDouble(FPRegister dst, | |
| 1322 Register src, | |
| 1323 UntagMode mode) { | 1242 UntagMode mode) { |
| 1324 DCHECK(dst.Is64Bits() && src.Is64Bits()); | 1243 DCHECK(dst.Is64Bits() && src.Is64Bits()); |
| 1325 if (FLAG_enable_slow_asserts && (mode == kNotSpeculativeUntag)) { | 1244 if (FLAG_enable_slow_asserts && (mode == kNotSpeculativeUntag)) { |
| 1326 AssertSmi(src); | 1245 AssertSmi(src); |
| 1327 } | 1246 } |
| 1328 Scvtf(dst, src, kSmiShift); | 1247 Scvtf(dst, src, kSmiShift); |
| 1329 } | 1248 } |
| 1330 | 1249 |
| 1331 | 1250 void MacroAssembler::SmiUntagToFloat(VRegister dst, Register src, |
| 1332 void MacroAssembler::SmiUntagToFloat(FPRegister dst, | |
| 1333 Register src, | |
| 1334 UntagMode mode) { | 1251 UntagMode mode) { |
| 1335 DCHECK(dst.Is32Bits() && src.Is64Bits()); | 1252 DCHECK(dst.Is32Bits() && src.Is64Bits()); |
| 1336 if (FLAG_enable_slow_asserts && (mode == kNotSpeculativeUntag)) { | 1253 if (FLAG_enable_slow_asserts && (mode == kNotSpeculativeUntag)) { |
| 1337 AssertSmi(src); | 1254 AssertSmi(src); |
| 1338 } | 1255 } |
| 1339 Scvtf(dst, src, kSmiShift); | 1256 Scvtf(dst, src, kSmiShift); |
| 1340 } | 1257 } |
| 1341 | 1258 |
| 1342 | 1259 |
| 1343 void MacroAssembler::SmiTagAndPush(Register src) { | 1260 void MacroAssembler::SmiTagAndPush(Register src) { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 DCHECK(isprint(marker_name[0]) && isprint(marker_name[1])); | 1591 DCHECK(isprint(marker_name[0]) && isprint(marker_name[1])); |
| 1675 | 1592 |
| 1676 InstructionAccurateScope scope(this, 1); | 1593 InstructionAccurateScope scope(this, 1); |
| 1677 movn(xzr, (marker_name[1] << 8) | marker_name[0]); | 1594 movn(xzr, (marker_name[1] << 8) | marker_name[0]); |
| 1678 } | 1595 } |
| 1679 | 1596 |
| 1680 } // namespace internal | 1597 } // namespace internal |
| 1681 } // namespace v8 | 1598 } // namespace v8 |
| 1682 | 1599 |
| 1683 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ | 1600 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_INL_H_ |
| OLD | NEW |