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