• Home
  • Raw
  • Download

Lines Matching refs:assm

41 inline void Load(LiftoffAssembler* assm, LiftoffRegister dst, Register base,  in Load()  argument
48 assm->mov(dst.gp(), src); in Load()
51 assm->mov(dst.low_gp(), src); in Load()
52 assm->mov(dst.high_gp(), Operand(base, offset + 4)); in Load()
55 assm->movss(dst.fp(), src); in Load()
58 assm->movsd(dst.fp(), src); in Load()
61 assm->movdqu(dst.fp(), src); in Load()
68 inline void Store(LiftoffAssembler* assm, Register base, int32_t offset, in Store() argument
73 assm->mov(dst, src.gp()); in Store()
76 assm->mov(dst, src.low_gp()); in Store()
77 assm->mov(Operand(base, offset + 4), src.high_gp()); in Store()
80 assm->movss(dst, src.fp()); in Store()
83 assm->movsd(dst, src.fp()); in Store()
86 assm->movdqu(dst, src.fp()); in Store()
93 inline void push(LiftoffAssembler* assm, LiftoffRegister reg, ValueType type) { in push() argument
96 assm->push(reg.gp()); in push()
99 assm->push(reg.high_gp()); in push()
100 assm->push(reg.low_gp()); in push()
103 assm->AllocateStackSpace(sizeof(float)); in push()
104 assm->movss(Operand(esp, 0), reg.fp()); in push()
107 assm->AllocateStackSpace(sizeof(double)); in push()
108 assm->movsd(Operand(esp, 0), reg.fp()); in push()
111 assm->AllocateStackSpace(sizeof(double) * 2); in push()
112 assm->movdqu(Operand(esp, 0), reg.fp()); in push()
120 inline void SpillRegisters(LiftoffAssembler* assm, Regs... regs) { in SpillRegisters() argument
122 if (assm->cache_state()->is_used(r)) assm->SpillRegister(r); in SpillRegisters()
126 inline void SignExtendI32ToI64(Assembler* assm, LiftoffRegister reg) { in SignExtendI32ToI64() argument
127 assm->mov(reg.high_gp(), reg.low_gp()); in SignExtendI32ToI64()
128 assm->sar(reg.high_gp(), 31); in SignExtendI32ToI64()
133 inline Register GetTmpByteRegister(LiftoffAssembler* assm, Register candidate) { in GetTmpByteRegister() argument
137 return assm->GetUnusedRegister(liftoff::kByteRegs, {}).gp(); in GetTmpByteRegister()
140 inline void MoveStackValue(LiftoffAssembler* assm, const Operand& src, in MoveStackValue() argument
142 if (assm->cache_state()->has_unused_register(kGpReg)) { in MoveStackValue()
143 Register tmp = assm->cache_state()->unused_register(kGpReg).gp(); in MoveStackValue()
144 assm->mov(tmp, src); in MoveStackValue()
145 assm->mov(dst, tmp); in MoveStackValue()
148 assm->push(src); in MoveStackValue()
149 assm->pop(dst); in MoveStackValue()
1200 void EmitCommutativeBinOp(LiftoffAssembler* assm, Register dst, Register lhs, in EmitCommutativeBinOp() argument
1203 (assm->*op)(dst, lhs); in EmitCommutativeBinOp()
1205 if (dst != lhs) assm->mov(dst, lhs); in EmitCommutativeBinOp()
1206 (assm->*op)(dst, rhs); in EmitCommutativeBinOp()
1211 void EmitCommutativeBinOpImm(LiftoffAssembler* assm, Register dst, Register lhs, in EmitCommutativeBinOpImm() argument
1213 if (dst != lhs) assm->mov(dst, lhs); in EmitCommutativeBinOpImm()
1214 (assm->*op)(dst, imm); in EmitCommutativeBinOpImm()
1225 void EmitInt32DivOrRem(LiftoffAssembler* assm, Register dst, Register lhs, in EmitInt32DivOrRem() argument
1239 liftoff::SpillRegisters(assm, eax, edx); in EmitInt32DivOrRem()
1242 Register tmp = assm->GetUnusedRegister(kGpReg, unavailable).gp(); in EmitInt32DivOrRem()
1243 assm->mov(tmp, rhs); in EmitInt32DivOrRem()
1248 assm->test(rhs, rhs); in EmitInt32DivOrRem()
1249 assm->j(zero, trap_div_by_zero); in EmitInt32DivOrRem()
1255 assm->cmp(rhs, -1); in EmitInt32DivOrRem()
1256 assm->j(not_equal, &do_div); in EmitInt32DivOrRem()
1257 assm->cmp(lhs, kMinInt); in EmitInt32DivOrRem()
1258 assm->j(equal, trap_div_unrepresentable); in EmitInt32DivOrRem()
1259 assm->bind(&do_div); in EmitInt32DivOrRem()
1264 assm->cmp(rhs, -1); in EmitInt32DivOrRem()
1265 assm->j(not_equal, &do_rem); in EmitInt32DivOrRem()
1266 assm->xor_(dst, dst); in EmitInt32DivOrRem()
1267 assm->jmp(&done); in EmitInt32DivOrRem()
1268 assm->bind(&do_rem); in EmitInt32DivOrRem()
1273 if (lhs != eax) assm->mov(eax, lhs); in EmitInt32DivOrRem()
1275 assm->cdq(); in EmitInt32DivOrRem()
1276 assm->idiv(rhs); in EmitInt32DivOrRem()
1278 assm->xor_(edx, edx); in EmitInt32DivOrRem()
1279 assm->div(rhs); in EmitInt32DivOrRem()
1284 if (dst != kResultReg) assm->mov(dst, kResultReg); in EmitInt32DivOrRem()
1285 if (special_case_minus_1) assm->bind(&done); in EmitInt32DivOrRem()
1339 inline void EmitShiftOperation(LiftoffAssembler* assm, Register dst, in EmitShiftOperation() argument
1345 Register tmp = assm->GetUnusedRegister(kGpReg, pinned).gp(); in EmitShiftOperation()
1346 assm->mov(tmp, src); in EmitShiftOperation()
1347 if (amount != ecx) assm->mov(ecx, amount); in EmitShiftOperation()
1348 (assm->*emit_shift)(tmp); in EmitShiftOperation()
1349 assm->mov(ecx, tmp); in EmitShiftOperation()
1357 if (assm->cache_state()->is_used(LiftoffRegister(ecx)) || in EmitShiftOperation()
1359 tmp_reg = assm->GetUnusedRegister(kGpReg, pinned).gp(); in EmitShiftOperation()
1360 assm->mov(tmp_reg, ecx); in EmitShiftOperation()
1363 assm->mov(ecx, amount); in EmitShiftOperation()
1367 if (dst != src) assm->mov(dst, src); in EmitShiftOperation()
1368 (assm->*emit_shift)(dst); in EmitShiftOperation()
1371 if (tmp_reg.is_valid()) assm->mov(ecx, tmp_reg); in EmitShiftOperation()
1426 inline void OpWithCarry(LiftoffAssembler* assm, LiftoffRegister dst, in OpWithCarry() argument
1433 ? assm->GetUnusedRegister(kGpReg, keep_alive).gp() in OpWithCarry()
1436 if (dst_low != lhs.low_gp()) assm->mov(dst_low, lhs.low_gp()); in OpWithCarry()
1437 (assm->*op)(dst_low, rhs.low_gp()); in OpWithCarry()
1442 ? assm->GetUnusedRegister(kGpReg, keep_alive).gp() in OpWithCarry()
1445 if (dst_high != lhs.high_gp()) assm->mov(dst_high, lhs.high_gp()); in OpWithCarry()
1446 (assm->*op_with_carry)(dst_high, rhs.high_gp()); in OpWithCarry()
1450 if (tmp_result != dst) assm->Move(dst, tmp_result, kWasmI64); in OpWithCarry()
1455 inline void OpWithCarryI(LiftoffAssembler* assm, LiftoffRegister dst, in OpWithCarryI() argument
1462 if (dst.low_gp() != lhs.low_gp()) assm->mov(dst.low_gp(), lhs.low_gp()); in OpWithCarryI()
1463 (assm->*op)(dst.low_gp(), Immediate(imm)); in OpWithCarryI()
1466 if (dst.high_gp() != lhs.high_gp()) assm->mov(dst.high_gp(), lhs.high_gp()); in OpWithCarryI()
1469 (assm->*op_with_carry)(dst.high_gp(), sign_extend); in OpWithCarryI()
1570 LiftoffAssembler* assm, LiftoffRegister dst, LiftoffRegister src, in Emit64BitShiftOperation() argument
1583 ecx_replace = assm->GetUnusedRegister(kGpReg, pinned).gp(); in Emit64BitShiftOperation()
1589 (assm->cache_state()->is_used(LiftoffRegister(ecx)) || in Emit64BitShiftOperation()
1591 ecx_replace = assm->GetUnusedRegister(kGpReg, pinned).gp(); in Emit64BitShiftOperation()
1597 assm->ParallelRegisterMove(VectorOf(reg_moves)); in Emit64BitShiftOperation()
1600 (assm->*emit_shift)(dst.high_gp(), dst.low_gp()); in Emit64BitShiftOperation()
1603 if (ecx_replace != no_reg) assm->mov(ecx, ecx_replace); in Emit64BitShiftOperation()
1805 inline void EmitFloatMinOrMax(LiftoffAssembler* assm, DoubleRegister dst, in EmitFloatMinOrMax() argument
1815 Register tmp = assm->GetUnusedRegister(kGpReg, {}).gp(); in EmitFloatMinOrMax()
1820 assm->name##s(__VA_ARGS__); \ in EmitFloatMinOrMax()
1822 assm->name##d(__VA_ARGS__); \ in EmitFloatMinOrMax()
1829 assm->j(parity_even, &is_nan, Label::kNear); // PF=1 in EmitFloatMinOrMax()
1830 assm->j(below, &lhs_below_rhs, Label::kNear); // CF=1 in EmitFloatMinOrMax()
1831 assm->j(above, &lhs_above_rhs, Label::kNear); // CF=0 && ZF=0 in EmitFloatMinOrMax()
1840 assm->test(tmp, Immediate(1)); in EmitFloatMinOrMax()
1841 assm->j(zero, &lhs_below_rhs, Label::kNear); in EmitFloatMinOrMax()
1842 assm->jmp(&lhs_above_rhs, Label::kNear); in EmitFloatMinOrMax()
1844 assm->bind(&is_nan); in EmitFloatMinOrMax()
1848 assm->jmp(&done, Label::kNear); in EmitFloatMinOrMax()
1850 assm->bind(&lhs_below_rhs); in EmitFloatMinOrMax()
1853 assm->jmp(&done, Label::kNear); in EmitFloatMinOrMax()
1855 assm->bind(&lhs_above_rhs); in EmitFloatMinOrMax()
1859 assm->bind(&done); in EmitFloatMinOrMax()
2078 #define __ assm->
2082 inline void ConvertFloatToIntAndBack(LiftoffAssembler* assm, Register dst, in ConvertFloatToIntAndBack() argument
2108 inline bool EmitTruncateFloatToInt(LiftoffAssembler* assm, Register dst, in EmitTruncateFloatToInt() argument
2114 CpuFeatureScope feature(assm, SSE4_1); in EmitTruncateFloatToInt()
2127 ConvertFloatToIntAndBack<dst_type, src_type>(assm, dst, rounded, in EmitTruncateFloatToInt()
2143 inline bool EmitSatTruncateFloatToInt(LiftoffAssembler* assm, Register dst, in EmitSatTruncateFloatToInt() argument
2149 CpuFeatureScope feature(assm, SSE4_1); in EmitSatTruncateFloatToInt()
2169 ConvertFloatToIntAndBack<dst_type, src_type>(assm, dst, rounded, in EmitSatTruncateFloatToInt()
2356 inline void setcc_32_no_spill(LiftoffAssembler* assm, Condition cond, in setcc_32_no_spill() argument
2358 assm->setcc(cond, tmp_byte_reg); in setcc_32_no_spill()
2359 assm->movzx_b(dst, tmp_byte_reg); in setcc_32_no_spill()
2363 inline void setcc_32(LiftoffAssembler* assm, Condition cond, Register dst) { in setcc_32() argument
2364 Register tmp_byte_reg = GetTmpByteRegister(assm, dst); in setcc_32()
2365 setcc_32_no_spill(assm, cond, dst, tmp_byte_reg); in setcc_32()
2441 void EmitFloatSetCond(LiftoffAssembler* assm, Condition cond, Register dst, in EmitFloatSetCond() argument
2448 Register tmp_byte_reg = GetTmpByteRegister(assm, dst); in EmitFloatSetCond()
2450 (assm->*cmp_op)(lhs, rhs); in EmitFloatSetCond()
2452 assm->j(parity_odd, &not_nan, Label::kNear); in EmitFloatSetCond()
2455 assm->mov(dst, Immediate(1)); in EmitFloatSetCond()
2457 assm->xor_(dst, dst); in EmitFloatSetCond()
2459 assm->jmp(&cont, Label::kNear); in EmitFloatSetCond()
2460 assm->bind(&not_nan); in EmitFloatSetCond()
2462 setcc_32_no_spill(assm, cond, dst, tmp_byte_reg); in EmitFloatSetCond()
2463 assm->bind(&cont); in EmitFloatSetCond()
2490 LiftoffAssembler* assm, LiftoffRegister dst, LiftoffRegister lhs,
2493 CpuFeatureScope scope(assm, AVX);
2494 (assm->*avx_op)(dst.fp(), lhs.fp(), rhs.fp());
2499 if (feature.has_value()) sse_scope.emplace(assm, *feature);
2502 (assm->*sse_op)(dst.fp(), lhs.fp());
2504 if (dst.fp() != lhs.fp()) (assm->movaps)(dst.fp(), lhs.fp());
2505 (assm->*sse_op)(dst.fp(), rhs.fp());
2512 LiftoffAssembler* assm, LiftoffRegister dst, LiftoffRegister lhs,
2515 CpuFeatureScope scope(assm, AVX);
2516 (assm->*avx_op)(dst.fp(), lhs.fp(), rhs.fp());
2521 if (feature.has_value()) sse_scope.emplace(assm, *feature);
2524 assm->movaps(kScratchDoubleReg, rhs.fp());
2525 assm->movaps(dst.fp(), lhs.fp());
2526 (assm->*sse_op)(dst.fp(), kScratchDoubleReg);
2528 if (dst.fp() != lhs.fp()) assm->movaps(dst.fp(), lhs.fp());
2529 (assm->*sse_op)(dst.fp(), rhs.fp());
2535 void EmitSimdShiftOp(LiftoffAssembler* assm, LiftoffRegister dst, in EmitSimdShiftOp() argument
2539 assm->GetUnusedRegister(tmp_rc, LiftoffRegList::ForRegs(count)); in EmitSimdShiftOp()
2542 assm->mov(tmp.gp(), count.gp()); in EmitSimdShiftOp()
2543 assm->and_(tmp.gp(), Immediate(mask)); in EmitSimdShiftOp()
2544 assm->Movd(kScratchDoubleReg, tmp.gp()); in EmitSimdShiftOp()
2546 CpuFeatureScope scope(assm, AVX); in EmitSimdShiftOp()
2547 (assm->*avx_op)(dst.fp(), operand.fp(), kScratchDoubleReg); in EmitSimdShiftOp()
2549 if (dst.fp() != operand.fp()) assm->movaps(dst.fp(), operand.fp()); in EmitSimdShiftOp()
2550 (assm->*sse_op)(dst.fp(), kScratchDoubleReg); in EmitSimdShiftOp()
2556 void EmitSimdShiftOpImm(LiftoffAssembler* assm, LiftoffRegister dst, in EmitSimdShiftOpImm() argument
2561 CpuFeatureScope scope(assm, AVX); in EmitSimdShiftOpImm()
2562 (assm->*avx_op)(dst.fp(), operand.fp(), shift); in EmitSimdShiftOpImm()
2564 if (dst.fp() != operand.fp()) assm->movaps(dst.fp(), operand.fp()); in EmitSimdShiftOpImm()
2565 (assm->*sse_op)(dst.fp(), shift); in EmitSimdShiftOpImm()
2572 void EmitI8x16Shr(LiftoffAssembler* assm, LiftoffRegister dst, in EmitI8x16Shr() argument
2578 assm->GetUnusedRegister(kGpReg, LiftoffRegList::ForRegs(rhs)).gp(); in EmitI8x16Shr()
2580 assm->GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(dst, lhs)).fp(); in EmitI8x16Shr()
2583 assm->Punpckhbw(liftoff::kScratchDoubleReg, lhs.fp()); in EmitI8x16Shr()
2584 assm->Punpcklbw(dst.fp(), lhs.fp()); in EmitI8x16Shr()
2585 assm->mov(tmp, rhs.gp()); in EmitI8x16Shr()
2587 assm->and_(tmp, 7); in EmitI8x16Shr()
2588 assm->add(tmp, Immediate(8)); in EmitI8x16Shr()
2589 assm->Movd(tmp_simd, tmp); in EmitI8x16Shr()
2591 assm->Psraw(liftoff::kScratchDoubleReg, liftoff::kScratchDoubleReg, in EmitI8x16Shr()
2593 assm->Psraw(dst.fp(), dst.fp(), tmp_simd); in EmitI8x16Shr()
2594 assm->Packsswb(dst.fp(), liftoff::kScratchDoubleReg); in EmitI8x16Shr()
2596 assm->Psrlw(liftoff::kScratchDoubleReg, liftoff::kScratchDoubleReg, in EmitI8x16Shr()
2598 assm->Psrlw(dst.fp(), dst.fp(), tmp_simd); in EmitI8x16Shr()
2599 assm->Packuswb(dst.fp(), liftoff::kScratchDoubleReg); in EmitI8x16Shr()
2603 inline void EmitAnyTrue(LiftoffAssembler* assm, LiftoffRegister dst, in EmitAnyTrue() argument
2606 assm->GetUnusedRegister(kGpReg, LiftoffRegList::ForRegs(dst)).gp(); in EmitAnyTrue()
2607 assm->xor_(tmp, tmp); in EmitAnyTrue()
2608 assm->mov(dst.gp(), Immediate(1)); in EmitAnyTrue()
2609 assm->Ptest(src.fp(), src.fp()); in EmitAnyTrue()
2610 assm->cmov(zero, dst.gp(), tmp); in EmitAnyTrue()
2614 inline void EmitAllTrue(LiftoffAssembler* assm, LiftoffRegister dst, in EmitAllTrue() argument
2617 assm->GetUnusedRegister(kGpReg, LiftoffRegList::ForRegs(dst)).gp(); in EmitAllTrue()
2619 assm->mov(tmp, Immediate(1)); in EmitAllTrue()
2620 assm->xor_(dst.gp(), dst.gp()); in EmitAllTrue()
2621 assm->Pxor(tmp_simd, tmp_simd); in EmitAllTrue()
2622 (assm->*pcmp)(tmp_simd, src.fp()); in EmitAllTrue()
2623 assm->Ptest(tmp_simd, tmp_simd); in EmitAllTrue()
2624 assm->cmov(zero, dst.gp(), tmp); in EmitAllTrue()