Lines Matching refs:assm
44 inline Operand GetMemOp(LiftoffAssembler* assm, Register addr, Register offset, in GetMemOp() argument
52 assm->movl(scratch, Immediate(offset_imm)); in GetMemOp()
54 assm->addq(scratch, offset); in GetMemOp()
59 inline void Load(LiftoffAssembler* assm, LiftoffRegister dst, Operand src, in Load() argument
63 assm->movl(dst.gp(), src); in Load()
68 assm->movq(dst.gp(), src); in Load()
71 assm->Movss(dst.fp(), src); in Load()
74 assm->Movsd(dst.fp(), src); in Load()
77 assm->Movdqu(dst.fp(), src); in Load()
84 inline void Store(LiftoffAssembler* assm, Operand dst, LiftoffRegister src, in Store() argument
88 assm->movl(dst, src.gp()); in Store()
91 assm->movq(dst, src.gp()); in Store()
94 assm->Movss(dst, src.fp()); in Store()
97 assm->Movsd(dst, src.fp()); in Store()
100 assm->Movdqu(dst, src.fp()); in Store()
107 inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) { in push() argument
111 assm->pushq(reg.gp()); in push()
114 assm->AllocateStackSpace(kSystemPointerSize); in push()
115 assm->Movss(Operand(rsp, 0), reg.fp()); in push()
118 assm->AllocateStackSpace(kSystemPointerSize); in push()
119 assm->Movsd(Operand(rsp, 0), reg.fp()); in push()
122 assm->AllocateStackSpace(kSystemPointerSize * 2); in push()
123 assm->Movdqu(Operand(rsp, 0), reg.fp()); in push()
929 void EmitCommutativeBinOp(LiftoffAssembler* assm, Register dst, Register lhs, in EmitCommutativeBinOp() argument
932 (assm->*op)(dst, lhs); in EmitCommutativeBinOp()
934 if (dst != lhs) (assm->*mov)(dst, lhs); in EmitCommutativeBinOp()
935 (assm->*op)(dst, rhs); in EmitCommutativeBinOp()
941 void EmitCommutativeBinOpImm(LiftoffAssembler* assm, Register dst, Register lhs, in EmitCommutativeBinOpImm() argument
943 if (dst != lhs) (assm->*mov)(dst, lhs); in EmitCommutativeBinOpImm()
944 (assm->*op)(dst, Immediate(imm)); in EmitCommutativeBinOpImm()
956 void EmitIntDivOrRem(LiftoffAssembler* assm, Register dst, Register lhs, in EmitIntDivOrRem() argument
968 assm->name##l(__VA_ARGS__); \ in EmitIntDivOrRem()
970 assm->name##q(__VA_ARGS__); \ in EmitIntDivOrRem()
979 assm->SpillRegisters(rdx, rax); in EmitIntDivOrRem()
987 assm->j(zero, trap_div_by_zero); in EmitIntDivOrRem()
994 assm->j(not_equal, &do_div); in EmitIntDivOrRem()
997 assm->j(overflow, trap_div_unrepresentable); in EmitIntDivOrRem()
998 assm->bind(&do_div); in EmitIntDivOrRem()
1004 assm->j(not_equal, &do_rem); in EmitIntDivOrRem()
1009 assm->jmp(&done); in EmitIntDivOrRem()
1010 assm->bind(&do_rem); in EmitIntDivOrRem()
1017 assm->cdq(); in EmitIntDivOrRem()
1018 assm->idivl(rhs); in EmitIntDivOrRem()
1020 assm->xorl(rdx, rdx); in EmitIntDivOrRem()
1021 assm->divl(rhs); in EmitIntDivOrRem()
1023 assm->cqo(); in EmitIntDivOrRem()
1024 assm->idivq(rhs); in EmitIntDivOrRem()
1026 assm->xorq(rdx, rdx); in EmitIntDivOrRem()
1027 assm->divq(rhs); in EmitIntDivOrRem()
1035 if (special_case_minus_1) assm->bind(&done); in EmitIntDivOrRem()
1096 inline void EmitShiftOperation(LiftoffAssembler* assm, Register dst, in EmitShiftOperation() argument
1101 assm->Move(kScratchRegister, src, ValueType::Primitive(type)); in EmitShiftOperation()
1102 if (amount != rcx) assm->Move(rcx, amount, ValueType::Primitive(type)); in EmitShiftOperation()
1103 (assm->*emit_shift)(kScratchRegister); in EmitShiftOperation()
1104 assm->Move(rcx, kScratchRegister, ValueType::Primitive(type)); in EmitShiftOperation()
1113 src == rcx || assm->cache_state()->is_used(LiftoffRegister(rcx)); in EmitShiftOperation()
1114 if (use_scratch) assm->movq(kScratchRegister, rcx); in EmitShiftOperation()
1116 assm->Move(rcx, amount, ValueType::Primitive(type)); in EmitShiftOperation()
1120 if (dst != src) assm->Move(dst, src, ValueType::Primitive(type)); in EmitShiftOperation()
1121 (assm->*emit_shift)(dst); in EmitShiftOperation()
1124 if (use_scratch) assm->movq(rcx, kScratchRegister); in EmitShiftOperation()
1399 inline void EmitFloatMinOrMax(LiftoffAssembler* assm, DoubleRegister dst, in EmitFloatMinOrMax() argument
1410 assm->name##s(__VA_ARGS__); \ in EmitFloatMinOrMax()
1412 assm->name##d(__VA_ARGS__); \ in EmitFloatMinOrMax()
1419 assm->j(parity_even, &is_nan, Label::kNear); // PF=1 in EmitFloatMinOrMax()
1420 assm->j(below, &lhs_below_rhs, Label::kNear); // CF=1 in EmitFloatMinOrMax()
1421 assm->j(above, &lhs_above_rhs, Label::kNear); // CF=0 && ZF=0 in EmitFloatMinOrMax()
1430 assm->testl(kScratchRegister, Immediate(1)); in EmitFloatMinOrMax()
1431 assm->j(zero, &lhs_below_rhs, Label::kNear); in EmitFloatMinOrMax()
1432 assm->jmp(&lhs_above_rhs, Label::kNear); in EmitFloatMinOrMax()
1434 assm->bind(&is_nan); in EmitFloatMinOrMax()
1438 assm->jmp(&done, Label::kNear); in EmitFloatMinOrMax()
1440 assm->bind(&lhs_below_rhs); in EmitFloatMinOrMax()
1443 assm->jmp(&done, Label::kNear); in EmitFloatMinOrMax()
1445 assm->bind(&lhs_above_rhs); in EmitFloatMinOrMax()
1449 assm->bind(&done); in EmitFloatMinOrMax()
1661 #define __ assm->
1665 inline void ConvertFloatToIntAndBack(LiftoffAssembler* assm, Register dst, in ConvertFloatToIntAndBack() argument
1700 inline bool EmitTruncateFloatToInt(LiftoffAssembler* assm, Register dst, in EmitTruncateFloatToInt() argument
1706 CpuFeatureScope feature(assm, SSE4_1); in EmitTruncateFloatToInt()
1716 ConvertFloatToIntAndBack<dst_type, src_type>(assm, dst, rounded, in EmitTruncateFloatToInt()
1732 inline bool EmitSatTruncateFloatToInt(LiftoffAssembler* assm, Register dst, in EmitSatTruncateFloatToInt() argument
1738 CpuFeatureScope feature(assm, SSE4_1); in EmitSatTruncateFloatToInt()
1754 ConvertFloatToIntAndBack<dst_type, src_type>(assm, dst, rounded, in EmitSatTruncateFloatToInt()
1809 inline bool EmitSatTruncateFloatToUInt64(LiftoffAssembler* assm, Register dst, in EmitSatTruncateFloatToUInt64() argument
1815 CpuFeatureScope feature(assm, SSE4_1); in EmitSatTruncateFloatToUInt64()
2046 void EmitFloatSetCond(LiftoffAssembler* assm, Condition cond, Register dst, in EmitFloatSetCond() argument
2051 (assm->*cmp_op)(lhs, rhs); in EmitFloatSetCond()
2053 assm->j(parity_odd, ¬_nan, Label::kNear); in EmitFloatSetCond()
2056 assm->movl(dst, Immediate(1)); in EmitFloatSetCond()
2058 assm->xorl(dst, dst); in EmitFloatSetCond()
2060 assm->jmp(&cont, Label::kNear); in EmitFloatSetCond()
2061 assm->bind(¬_nan); in EmitFloatSetCond()
2063 assm->setcc(cond, dst); in EmitFloatSetCond()
2064 assm->movzxbl(dst, dst); in EmitFloatSetCond()
2065 assm->bind(&cont); in EmitFloatSetCond()
2115 LiftoffAssembler* assm, LiftoffRegister dst, LiftoffRegister lhs,
2118 CpuFeatureScope scope(assm, AVX);
2119 (assm->*avx_op)(dst.fp(), lhs.fp(), rhs.fp());
2124 if (feature.has_value()) sse_scope.emplace(assm, *feature);
2127 (assm->*sse_op)(dst.fp(), lhs.fp());
2129 if (dst.fp() != lhs.fp()) (assm->movaps)(dst.fp(), lhs.fp());
2130 (assm->*sse_op)(dst.fp(), rhs.fp());
2137 LiftoffAssembler* assm, LiftoffRegister dst, LiftoffRegister lhs,
2140 CpuFeatureScope scope(assm, AVX);
2141 (assm->*avx_op)(dst.fp(), lhs.fp(), rhs.fp());
2146 if (feature.has_value()) sse_scope.emplace(assm, *feature);
2149 assm->movaps(kScratchDoubleReg, rhs.fp());
2150 assm->movaps(dst.fp(), lhs.fp());
2151 (assm->*sse_op)(dst.fp(), kScratchDoubleReg);
2153 if (dst.fp() != lhs.fp()) assm->movaps(dst.fp(), lhs.fp());
2154 (assm->*sse_op)(dst.fp(), rhs.fp());
2160 void EmitSimdShiftOp(LiftoffAssembler* assm, LiftoffRegister dst, in EmitSimdShiftOp() argument
2163 assm->movq(kScratchRegister, count.gp()); in EmitSimdShiftOp()
2164 assm->andq(kScratchRegister, Immediate(mask)); in EmitSimdShiftOp()
2165 assm->Movq(kScratchDoubleReg, kScratchRegister); in EmitSimdShiftOp()
2167 CpuFeatureScope scope(assm, AVX); in EmitSimdShiftOp()
2168 (assm->*avx_op)(dst.fp(), operand.fp(), kScratchDoubleReg); in EmitSimdShiftOp()
2170 if (dst.fp() != operand.fp()) assm->movaps(dst.fp(), operand.fp()); in EmitSimdShiftOp()
2171 (assm->*sse_op)(dst.fp(), kScratchDoubleReg); in EmitSimdShiftOp()
2177 void EmitSimdShiftOpImm(LiftoffAssembler* assm, LiftoffRegister dst, in EmitSimdShiftOpImm() argument
2182 CpuFeatureScope scope(assm, AVX); in EmitSimdShiftOpImm()
2183 (assm->*avx_op)(dst.fp(), operand.fp(), shift); in EmitSimdShiftOpImm()
2185 if (dst.fp() != operand.fp()) assm->movaps(dst.fp(), operand.fp()); in EmitSimdShiftOpImm()
2186 (assm->*sse_op)(dst.fp(), shift); in EmitSimdShiftOpImm()
2191 void EmitI8x16Shr(LiftoffAssembler* assm, LiftoffRegister dst, in EmitI8x16Shr() argument
2194 assm->Punpckhbw(kScratchDoubleReg, lhs.fp()); in EmitI8x16Shr()
2195 assm->Punpcklbw(dst.fp(), lhs.fp()); in EmitI8x16Shr()
2197 assm->movq(kScratchRegister, rhs.gp()); in EmitI8x16Shr()
2199 assm->andq(kScratchRegister, Immediate(7)); in EmitI8x16Shr()
2200 assm->addq(kScratchRegister, Immediate(8)); in EmitI8x16Shr()
2201 assm->Movq(liftoff::kScratchDoubleReg2, kScratchRegister); in EmitI8x16Shr()
2203 assm->Psraw(kScratchDoubleReg, liftoff::kScratchDoubleReg2); in EmitI8x16Shr()
2204 assm->Psraw(dst.fp(), liftoff::kScratchDoubleReg2); in EmitI8x16Shr()
2205 assm->Packsswb(dst.fp(), kScratchDoubleReg); in EmitI8x16Shr()
2207 assm->Psrlw(kScratchDoubleReg, liftoff::kScratchDoubleReg2); in EmitI8x16Shr()
2208 assm->Psrlw(dst.fp(), liftoff::kScratchDoubleReg2); in EmitI8x16Shr()
2209 assm->Packuswb(dst.fp(), kScratchDoubleReg); in EmitI8x16Shr()
2216 void EmitI64x2ShrS(LiftoffAssembler* assm, LiftoffRegister dst,
2222 if (assm->cache_state()->is_used(LiftoffRegister(rcx))) {
2224 assm->movq(backup, rcx);
2226 assm->movl(rcx, rhs);
2231 assm->Pextrq(tmp, lhs.fp(), int8_t{0x0});
2232 assm->sarq_cl(tmp);
2233 assm->Pinsrq(dst.fp(), tmp, uint8_t{0x0});
2235 assm->Pextrq(tmp, lhs.fp(), int8_t{0x1});
2236 assm->sarq_cl(tmp);
2237 assm->Pinsrq(dst.fp(), tmp, uint8_t{0x1});
2241 assm->movq(rcx, backup);
2245 inline void EmitAnyTrue(LiftoffAssembler* assm, LiftoffRegister dst, in EmitAnyTrue() argument
2247 assm->xorq(dst.gp(), dst.gp()); in EmitAnyTrue()
2248 assm->Ptest(src.fp(), src.fp()); in EmitAnyTrue()
2249 assm->setcc(not_equal, dst.gp()); in EmitAnyTrue()
2253 inline void EmitAllTrue(LiftoffAssembler* assm, LiftoffRegister dst, in EmitAllTrue() argument
2256 assm->xorq(dst.gp(), dst.gp()); in EmitAllTrue()
2257 assm->Pxor(tmp, tmp); in EmitAllTrue()
2258 (assm->*pcmp)(tmp, src.fp()); in EmitAllTrue()
2259 assm->Ptest(tmp, tmp); in EmitAllTrue()
2260 assm->setcc(equal, dst.gp()); in EmitAllTrue()