Lines Matching refs:zd
33 const ZRegister& zd,
36 VIXL_ASSERT(imm.FitsInLane(zd));
39 if (TrySingleAddSub(option, zd, zn, imm)) return;
46 // Add(zd.VnH(), zn.VnH(), 0xffff...) to Sub(..., 1), etc.
47 IntegerOperand signed_imm(imm.AsIntN(zd.GetLaneSizeInBits()));
53 if (TrySingleAddSub(n_option, zd, zn, n_imm)) return;
63 add(zd, zn, scratch);
65 sub(zd, zn, scratch);
70 const ZRegister& zd,
73 VIXL_ASSERT(imm.FitsInLane(zd));
77 if (imm.TryEncodeAsShiftedUintNForLane<8, 0>(zd, &imm8, &shift) ||
78 imm.TryEncodeAsShiftedUintNForLane<8, 8>(zd, &imm8, &shift)) {
79 MovprfxHelperScope guard(this, zd, zn);
82 add(zd, zd, imm8, shift);
85 sub(zd, zd, imm8, shift);
94 const ZRegister& zd,
101 MovprfxHelperScope guard(this, zd, zn);
102 (this->*imm_fn)(zd, zd, imm.AsInt8());
108 MovprfxHelperScope guard(this, zd, zn);
109 (this->*imm_fn)(zd, zd, imm.AsUint8());
116 Ptrue(pg.WithSameLaneSizeAs(zd));
118 // Try to re-use zd if we can, so we can avoid a movprfx.
120 zd.Aliases(zn) ? temps.AcquireZ().WithLaneSize(zn.GetLaneSizeInBits())
121 : zd;
126 (this->*reg_macro)(zd, pg.Merging(), zn, scratch);
129 void MacroAssembler::Mul(const ZRegister& zd,
135 IntWideImmHelper(imm_fn, reg_fn, zd, zn, imm, true);
138 void MacroAssembler::Smin(const ZRegister& zd,
142 VIXL_ASSERT(imm.FitsInSignedLane(zd));
145 IntWideImmHelper(imm_fn, reg_fn, zd, zn, imm, true);
148 void MacroAssembler::Smax(const ZRegister& zd,
152 VIXL_ASSERT(imm.FitsInSignedLane(zd));
155 IntWideImmHelper(imm_fn, reg_fn, zd, zn, imm, true);
158 void MacroAssembler::Umax(const ZRegister& zd,
162 VIXL_ASSERT(imm.FitsInUnsignedLane(zd));
165 IntWideImmHelper(imm_fn, reg_fn, zd, zn, imm, false);
168 void MacroAssembler::Umin(const ZRegister& zd,
172 VIXL_ASSERT(imm.FitsInUnsignedLane(zd));
175 IntWideImmHelper(imm_fn, reg_fn, zd, zn, imm, false);
363 void MacroAssembler::Cpy(const ZRegister& zd,
367 VIXL_ASSERT(imm.FitsInLane(zd));
370 if (imm.TryEncodeAsShiftedIntNForLane<8, 0>(zd, &imm8, &shift) ||
371 imm.TryEncodeAsShiftedIntNForLane<8, 8>(zd, &imm8, &shift)) {
373 cpy(zd, pg, imm8, shift);
381 dup(zd, 0);
386 VIXL_ASSERT(imm.FitsInLane(zd));
387 if (zd.GetLaneSizeInBits() >= kHRegSize) {
389 switch (zd.GetLaneSizeInBits()) {
408 fcpy(zd, pg_m, fp_imm);
415 Register scratch = temps.AcquireRegisterToHoldLane(zd);
419 cpy(zd, pg_m, scratch);
427 void MacroAssembler::Fcpy(const ZRegister& zd,
435 fcpy(zd, pg, imm);
441 Cpy(zd, pg, FPToRawbitsWithSize(zd.GetLaneSizeInBits(), imm));
444 void MacroAssembler::Fcpy(const ZRegister& zd,
452 fcpy(zd, pg, imm);
458 Cpy(zd, pg, FPToRawbitsWithSize(zd.GetLaneSizeInBits(), imm));
461 void MacroAssembler::Fcpy(const ZRegister& zd,
469 fcpy(zd, pg, imm);
475 Cpy(zd, pg, FPToRawbitsWithSize(zd.GetLaneSizeInBits(), imm));
478 void MacroAssembler::Dup(const ZRegister& zd, IntegerOperand imm) {
480 VIXL_ASSERT(imm.FitsInLane(zd));
481 unsigned lane_size = zd.GetLaneSizeInBits();
484 if (imm.TryEncodeAsShiftedIntNForLane<8, 0>(zd, &imm8, &shift) ||
485 imm.TryEncodeAsShiftedIntNForLane<8, 8>(zd, &imm8, &shift)) {
487 dup(zd, imm8, shift);
490 dupm(zd, imm.AsUintN(lane_size));
493 Register scratch = temps.AcquireRegisterToHoldLane(zd);
497 dup(zd, scratch);
502 const ZRegister& zd,
508 if (zd.Aliases(zn)) {
509 // E.g. zd = zd / zm
511 (this->*fn)(zd, pg, zn, zm);
512 } else if (zd.Aliases(zm)) {
513 // E.g. zd = zn / zd
515 (this->*rev_fn)(zd, pg, zm, zn);
517 // E.g. zd = zn / zm
518 MovprfxHelperScope guard(this, zd, pg, zn);
519 (this->*fn)(zd, pg, zd, zm);
524 const ZRegister& zd,
532 if (zd.Aliases(zn)) {
534 (this->*fn)(zd, pg, zd, zm);
535 } else if (zd.Aliases(zm)) {
540 (this->*fn)(zd, pg, zd, zn);
552 Mov(zd, scratch);
560 MovprfxHelperScope guard(this, zd, pg, zn);
561 (this->*fn)(zd, pg, zd, zm);
572 void MacroAssembler::MASMFN(const ZRegister& zd, \
577 if ((zd.Aliases(zn) || zd.Aliases(zm)) && !zd.Aliases(za)) { \
581 Mov(ztmp, zd.Aliases(zn) ? zn : zm); \
582 MovprfxHelperScope guard(this, zd, za); \
583 ASMFN(zd, \
584 (zd.Aliases(zn) ? ztmp : zn), \
585 (zd.Aliases(zm) ? ztmp : zm), \
588 MovprfxHelperScope guard(this, zd, za); \
589 ASMFN(zd, zn, zm, imm); \
604 void MacroAssembler::MASMFN(const ZRegister& zd, \
610 if ((zd.Aliases(zn) || zd.Aliases(zm)) && !zd.Aliases(za)) { \
612 ZRegister ztmp = temps.AcquireZ().WithSameLaneSizeAs(zd); \
617 Mov(zd, ztmp); \
619 MovprfxHelperScope guard(this, zd, za); \
620 ASMFN(zd, zn, zm, index, rot); \
645 void MacroAssembler::MASMFN(const ZRegister& zd, \
650 if (zd.Aliases(zm) && !zd.Aliases(zn)) { \
654 MovprfxHelperScope guard(this, zd, pg, zn); \
655 ASMFN(zd, pg, zd, scratch); \
657 MovprfxHelperScope guard(this, zd, pg, zn); \
658 ASMFN(zd, pg, zd, zm); \
687 void MacroAssembler::MASMFN(const ZRegister& zd, \
692 NoncommutativeArithmeticHelper(zd, \
704 void MacroAssembler::Fadd(const ZRegister& zd,
710 FPCommutativeArithmeticHelper(zd,
719 void MacroAssembler::Fabd(const ZRegister& zd,
725 FPCommutativeArithmeticHelper(zd,
734 void MacroAssembler::Fmul(const ZRegister& zd,
740 FPCommutativeArithmeticHelper(zd,
749 void MacroAssembler::Fmulx(const ZRegister& zd,
755 FPCommutativeArithmeticHelper(zd,
764 void MacroAssembler::Fmax(const ZRegister& zd,
770 FPCommutativeArithmeticHelper(zd,
779 void MacroAssembler::Fmin(const ZRegister& zd,
785 FPCommutativeArithmeticHelper(zd,
794 void MacroAssembler::Fmaxnm(const ZRegister& zd,
800 FPCommutativeArithmeticHelper(zd,
809 void MacroAssembler::Fminnm(const ZRegister& zd,
815 FPCommutativeArithmeticHelper(zd,
824 void MacroAssembler::Fdup(const ZRegister& zd, double imm) {
827 switch (zd.GetLaneSizeInBits()) {
829 Fdup(zd, Float16(imm));
832 Fdup(zd, static_cast<float>(imm));
838 fdup(zd, imm);
840 Dup(zd, bits);
846 void MacroAssembler::Fdup(const ZRegister& zd, float imm) {
849 switch (zd.GetLaneSizeInBits()) {
851 Fdup(zd, Float16(imm));
856 fdup(zd, imm);
858 Dup(zd, FloatToRawbits(imm));
862 Fdup(zd, static_cast<double>(imm));
867 void MacroAssembler::Fdup(const ZRegister& zd, Float16 imm) {
870 switch (zd.GetLaneSizeInBits()) {
874 fdup(zd, imm);
876 Dup(zd, Float16ToRawbits(imm));
880 Fdup(zd, FPToFloat(imm, kIgnoreDefaultNaN));
883 Fdup(zd, FPToDouble(imm, kIgnoreDefaultNaN));
888 void MacroAssembler::Index(const ZRegister& zd,
925 IndexOperand start_enc = IndexOperand::Prepare(this, &temps, start, zd);
926 IndexOperand step_enc = IndexOperand::Prepare(this, &temps, step, zd);
931 index(zd, start_enc.GetImm5(), step_enc.GetImm5());
933 index(zd, start_enc.GetImm5(), step_enc.GetRegister());
937 index(zd, start_enc.GetRegister(), step_enc.GetImm5());
939 index(zd, start_enc.GetRegister(), step_enc.GetRegister());
966 void MacroAssembler::Mla(const ZRegister& zd,
972 if (zd.Aliases(za)) {
975 mla(zd, pg, zn, zm);
976 } else if (zd.Aliases(zn)) {
979 mad(zd, pg, zm, za);
980 } else if (zd.Aliases(zm)) {
984 mad(zd, pg, zn, za);
986 // zd = za + (zn * zm)
988 movprfx(zd, pg, za);
989 mla(zd, pg, zn, zm);
993 void MacroAssembler::Mls(const ZRegister& zd,
999 if (zd.Aliases(za)) {
1002 mls(zd, pg, zn, zm);
1003 } else if (zd.Aliases(zn)) {
1006 msb(zd, pg, zm, za);
1007 } else if (zd.Aliases(zm)) {
1011 msb(zd, pg, zn, za);
1013 // zd = za - (zn * zm)
1015 movprfx(zd, pg, za);
1016 mls(zd, pg, zn, zm);
1090 void MacroAssembler::Sub(const ZRegister& zd,
1097 if (imm.TryEncodeAsShiftedUintNForLane<8, 0>(zd, &imm8, &shift) ||
1098 imm.TryEncodeAsShiftedUintNForLane<8, 8>(zd, &imm8, &shift)) {
1099 MovprfxHelperScope guard(this, zd, zm);
1100 subr(zd, zd, imm8, shift);
1107 sub(zd, scratch, zm);
1668 const ZRegister& zd,
1673 if (zd.Aliases(za)) {
1676 (this->*fn)(zd, zn, zm, index);
1678 } else if (zd.Aliases(zn) || zd.Aliases(zm)) {
1683 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
1689 Mov(zd, scratch);
1691 // zd = za + (zn . zm)
1692 MovprfxHelperScope guard(this, zd, za);
1693 (this->*fn)(zd, zn, zm, index);
1698 const ZRegister& zd,
1702 if (!zd.Aliases(za) && (zd.Aliases(zn) || zd.Aliases(zm))) {
1703 // zd = za . zd . zm
1704 // zd = za . zn . zd
1705 // zd = za . zd . zd
1707 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
1713 Mov(zd, scratch);
1715 MovprfxHelperScope guard(this, zd, za);
1716 (this->*fn)(zd, zn, zm);
1721 const ZRegister& zd,
1725 if (!zd.Aliases(za) && (zd.Aliases(zn) || zd.Aliases(zm))) {
1726 // zd = za . zd . zm
1727 // zd = za . zn . zd
1728 // zd = za . zd . zd
1730 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
1736 Mov(zd, scratch);
1738 MovprfxHelperScope guard(this, zd, za);
1739 (this->*fn)(zd, zd, zn, zm);
1744 const ZRegister& zd,
1749 if (!zd.Aliases(za) && (zd.Aliases(zn) || zd.Aliases(zm))) {
1750 // zd = za . zd . zm[i]
1751 // zd = za . zn . zd[i]
1752 // zd = za . zd . zd[i]
1754 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
1760 Mov(zd, scratch);
1762 // zd = za . zn . zm[i]
1763 MovprfxHelperScope guard(this, zd, za);
1764 (this->*fn)(zd, zn, zm, imm);
1769 const ZRegister& zd,
1775 if (!zd.Aliases(za)) {
1776 Mov(zd, za);
1778 } else if (zd.Aliases(za)) {
1780 (this->*fn)(zd, zn, zm);
1781 } else if (zd.Aliases(zn)) {
1785 MovprfxHelperScope guard(this, zd, za);
1786 (this->*fn)(zd, ztmp, zm);
1787 } else if (zd.Aliases(zm)) {
1791 MovprfxHelperScope guard(this, zd, za);
1792 (this->*fn)(zd, zn, ztmp);
1794 MovprfxHelperScope guard(this, zd, za);
1795 (this->*fn)(zd, zn, zm);
1845 void MacroAssembler::MASMFN(const ZRegister& zd, \
1850 HELPER(&Assembler::ASMFN, zd, za, zn, zm); \
1880 void MacroAssembler::MASMFN(const ZRegister& zd, \
1886 HELPER(&Assembler::ASMFN, zd, za, zn, zm, imm); \
1891 void MacroAssembler::Sdot(const ZRegister& zd,
1897 SVEDotIndexHelper(&Assembler::sdot, zd, za, zn, zm, index);
1900 void MacroAssembler::Udot(const ZRegister& zd,
1906 SVEDotIndexHelper(&Assembler::udot, zd, za, zn, zm, index);
1909 void MacroAssembler::Sudot(const ZRegister& zd,
1915 SVEDotIndexHelper(&Assembler::sudot, zd, za, zn, zm, index);
1918 void MacroAssembler::Usdot(const ZRegister& zd,
1924 SVEDotIndexHelper(&Assembler::usdot, zd, za, zn, zm, index);
1927 void MacroAssembler::Cdot(const ZRegister& zd,
1935 if ((zd.Aliases(zn) || zd.Aliases(zm)) && !zd.Aliases(za)) {
1937 ZRegister ztmp = temps.AcquireZ().WithSameLaneSizeAs(zd);
1942 Mov(zd, ztmp);
1944 MovprfxHelperScope guard(this, zd, za);
1945 cdot(zd, zn, zm, index, rot);
1949 void MacroAssembler::Cdot(const ZRegister& zd,
1954 if ((zd.Aliases(zn) || zd.Aliases(zm)) && !zd.Aliases(za)) {
1958 Mov(ztmp, zd.Aliases(zn) ? zn : zm);
1959 MovprfxHelperScope guard(this, zd, za);
1960 cdot(zd, (zd.Aliases(zn) ? ztmp : zn), (zd.Aliases(zm) ? ztmp : zm), rot);
1962 MovprfxHelperScope guard(this, zd, za);
1963 cdot(zd, zn, zm, rot);
1967 void MacroAssembler::FPMulAddHelper(const ZRegister& zd,
1977 if (zd.Aliases(za)) {
1980 (this->*fn_zda)(zd, pg, zn, zm);
1981 } else if (zd.Aliases(zn)) {
1984 (this->*fn_zdn)(zd, pg, zm, za);
1985 } else if (zd.Aliases(zm)) {
1992 (this->*fn_zdn)(zd, pg, zn, za);
2005 Mov(zd, scratch);
2013 // zd = (-)za + ((-)zn * zm) for fmla, fmls, fnmla and fnmls.
2014 MovprfxHelperScope guard(this, zd, pg, za);
2015 (this->*fn_zda)(zd, pg, zn, zm);
2019 void MacroAssembler::Fmla(const ZRegister& zd,
2026 FPMulAddHelper(zd,
2036 void MacroAssembler::Fmls(const ZRegister& zd,
2043 FPMulAddHelper(zd,
2053 void MacroAssembler::Fnmla(const ZRegister& zd,
2060 FPMulAddHelper(zd,
2070 void MacroAssembler::Fnmls(const ZRegister& zd,
2077 FPMulAddHelper(zd,
2087 void MacroAssembler::Ftmad(const ZRegister& zd,
2092 if (zd.Aliases(zm) && !zd.Aliases(zn)) {
2096 MovprfxHelperScope guard(this, zd, zn);
2097 ftmad(zd, zd, scratch, imm3);
2099 MovprfxHelperScope guard(this, zd, zn);
2100 ftmad(zd, zd, zm, imm3);
2104 void MacroAssembler::Fcadd(const ZRegister& zd,
2110 if (zd.Aliases(zm) && !zd.Aliases(zn)) {
2112 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
2117 Mov(zd, scratch);
2119 MovprfxHelperScope guard(this, zd, pg, zn);
2120 fcadd(zd, pg, zd, zm, rot);
2124 void MacroAssembler::Fcmla(const ZRegister& zd,
2131 if ((zd.Aliases(zn) || zd.Aliases(zm)) && !zd.Aliases(za)) {
2133 ZRegister ztmp = temps.AcquireZ().WithSameLaneSizeAs(zd);
2138 Mov(zd, pg, ztmp);
2140 MovprfxHelperScope guard(this, zd, pg, za);
2141 fcmla(zd, pg, zn, zm, rot);
2145 void MacroAssembler::Splice(const ZRegister& zd,
2150 if (CPUHas(CPUFeatures::kSVE2) && AreConsecutive(zn, zm) && !zd.Aliases(zn)) {
2152 splice(zd, pg, zn, zm);
2153 } else if (zd.Aliases(zm) && !zd.Aliases(zn)) {
2155 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
2160 Mov(zd, scratch);
2162 MovprfxHelperScope guard(this, zd, zn);
2163 splice(zd, pg, zd, zm);
2167 void MacroAssembler::Clasta(const ZRegister& zd,
2172 if (zd.Aliases(zm) && !zd.Aliases(zn)) {
2174 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
2179 Mov(zd, scratch);
2181 MovprfxHelperScope guard(this, zd, zn);
2182 clasta(zd, pg, zd, zm);
2186 void MacroAssembler::Clastb(const ZRegister& zd,
2191 if (zd.Aliases(zm) && !zd.Aliases(zn)) {
2193 ZRegister scratch = temps.AcquireZ().WithSameLaneSizeAs(zd);
2198 Mov(zd, scratch);
2200 MovprfxHelperScope guard(this, zd, zn);
2201 clastb(zd, pg, zd, zm);
2206 const ZRegister& zd,
2211 if (!zd.Aliases(za) && zd.Aliases(zn)) {
2216 MovprfxHelperScope guard(this, zd, za);
2217 (this->*fn)(zd, ztmp, shift);
2220 MovprfxHelperScope guard(this, zd, za);
2221 (this->*fn)(zd, zn, shift);
2225 void MacroAssembler::Srsra(const ZRegister& zd,
2229 ShiftRightAccumulate(&Assembler::srsra, zd, za, zn, shift);
2232 void MacroAssembler::Ssra(const ZRegister& zd,
2236 ShiftRightAccumulate(&Assembler::ssra, zd, za, zn, shift);
2239 void MacroAssembler::Ursra(const ZRegister& zd,
2243 ShiftRightAccumulate(&Assembler::ursra, zd, za, zn, shift);
2246 void MacroAssembler::Usra(const ZRegister& zd,
2250 ShiftRightAccumulate(&Assembler::usra, zd, za, zn, shift);
2254 const ZRegister& zd,
2259 if (!zd.Aliases(zn) && zd.Aliases(zm)) {
2264 MovprfxHelperScope guard(this, zd, zn);
2265 (this->*fn)(zd, zd, ztmp, rot);
2268 MovprfxHelperScope guard(this, zd, zn);
2269 (this->*fn)(zd, zd, zm, rot);
2273 void MacroAssembler::Cadd(const ZRegister& zd,
2277 ComplexAddition(&Assembler::cadd, zd, zn, zm, rot);
2280 void MacroAssembler::Sqcadd(const ZRegister& zd,
2284 ComplexAddition(&Assembler::sqcadd, zd, zn, zm, rot);