Lines Matching refs:scratch
164 Register scratch = temps.Acquire();
165 DCHECK(!AreAliased(object, value, scratch));
166 Add64(scratch, object, offset - kHeapObjectTag);
167 And(scratch, scratch, Operand(kTaggedSize - 1));
168 BranchShort(&ok, eq, scratch, Operand(zero_reg));
256 Register scratch = temps.Acquire();
257 li(scratch, Operand(BuiltinEntry(builtin), RelocInfo::OFF_HEAP_TARGET));
258 Call(scratch);
306 temp, // Used as scratch.
313 temp, // Used as scratch.
363 Register scratch = temps.Acquire();
364 Li(scratch, rt.immediate());
365 addw(rd, rs, scratch);
401 Register scratch = temps.Acquire();
403 Li(scratch, rt.immediate());
404 add(rd, rs, scratch);
437 Register scratch = temps.Acquire();
440 Li(scratch, -rt.immediate());
441 addw(rd, rs, scratch);
444 Li(scratch, rt.immediate());
445 subw(rd, rs, scratch);
487 Register scratch = temps.Acquire();
488 Li(scratch, -rt.immediate());
489 add(rd, rs, scratch);
493 Register scratch = temps.Acquire();
494 Li(scratch, rt.immediate());
495 sub(rd, rs, scratch);
506 Register scratch = temps.Acquire();
507 Li(scratch, rt.immediate());
508 mulw(rd, rs, scratch);
518 Register scratch = temps.Acquire();
519 Li(scratch, rt.immediate());
520 mul(rd, rs, scratch);
543 Register scratch = temps.Acquire();
544 Li(scratch, rt.immediate());
545 mul(rd, rs, scratch);
555 Register scratch = temps.Acquire();
556 Li(scratch, rt.immediate());
557 mulh(rd, rs, scratch);
567 Register scratch = temps.Acquire();
568 Li(scratch, rt.immediate());
569 divw(res, rs, scratch);
579 Register scratch = temps.Acquire();
580 Li(scratch, rt.immediate());
581 remw(rd, rs, scratch);
591 Register scratch = temps.Acquire();
592 Li(scratch, rt.immediate());
593 remuw(rd, rs, scratch);
603 Register scratch = temps.Acquire();
604 Li(scratch, rt.immediate());
605 div(rd, rs, scratch);
615 Register scratch = temps.Acquire();
616 Li(scratch, rt.immediate());
617 divuw(res, rs, scratch);
627 Register scratch = temps.Acquire();
628 Li(scratch, rt.immediate());
629 divu(res, rs, scratch);
639 Register scratch = temps.Acquire();
640 Li(scratch, rt.immediate());
641 rem(rd, rs, scratch);
651 Register scratch = temps.Acquire();
652 Li(scratch, rt.immediate());
653 remu(rd, rs, scratch);
676 Register scratch = temps.Acquire();
677 Li(scratch, rt.immediate());
678 and_(rd, rs, scratch);
698 Register scratch = temps.Acquire();
699 Li(scratch, rt.immediate());
700 or_(rd, rs, scratch);
720 Register scratch = temps.Acquire();
721 Li(scratch, rt.immediate());
722 xor_(rd, rs, scratch);
789 Register scratch = temps.Acquire();
791 Li(scratch, rt.immediate());
792 slt(rd, rs, scratch);
806 Register scratch = temps.Acquire();
808 Li(scratch, rt.immediate());
809 sltu(rd, rs, scratch);
820 Register scratch = temps.Acquire();
822 Li(scratch, rt.immediate());
823 slt(rd, scratch, rs);
834 Register scratch = temps.Acquire();
836 Li(scratch, rt.immediate());
837 sltu(rd, scratch, rs);
858 Register scratch = temps.Acquire();
860 Li(scratch, rt.immediate());
861 slt(rd, scratch, rs);
871 Register scratch = temps.Acquire();
873 Li(scratch, rt.immediate());
874 sltu(rd, scratch, rs);
963 Register scratch = temps.Acquire();
966 negw(scratch, rt.rm());
967 sllw(scratch, rs, scratch);
969 or_(rd, scratch, rd);
979 srliw(scratch, rs, ror_value);
981 or_(rd, scratch, rd);
988 Register scratch = temps.Acquire();
991 negw(scratch, rt.rm());
992 sll(scratch, rs, scratch);
994 or_(rd, scratch, rd);
1003 srli(scratch, rs, dror_value);
1005 or_(rd, scratch, rd);
1022 Register scratch) {
1023 DCHECK_NE(scratch, rs);
1024 DCHECK_NE(scratch, rd);
1035 Register x2 = scratch;
1057 Register x2 = scratch;
1080 Register scratch) {
1081 DCHECK(rd != rs.rm() && rd != scratch);
1094 lbu(scratch, rs.rm(), rs.offset() + i);
1095 if (i) slli(scratch, scratch, i * 8);
1096 or_(rd, rd, scratch);
1149 Register scratch = temps.Acquire();
1150 LoadNBytes<NBYTES, IS_SIGNED>(rd, rs, scratch);
1152 Register scratch = temps.Acquire();
1154 LoadNBytesOverwritingBaseReg<NBYTES, IS_SIGNED>(rs, scratch, scratch2);
1174 Register scratch = temps.Acquire();
1175 DCHECK(scratch != rs.rm() && scratch_other != scratch &&
1177 LoadNBytes<NBYTES, true>(scratch, source, scratch_other);
1179 fmv_w_x(frd, scratch);
1181 fmv_d_x(frd, scratch);
1225 Register scratch) {
1227 DCHECK_NE(scratch, rs.rm());
1229 fmv_x_w(scratch, frd);
1231 fmv_x_d(scratch, frd);
1233 UnalignedStoreHelper<NBYTES>(scratch, rs);
1243 Register scratch = temps.Acquire();
1244 DCHECK(scratch != rs.rm());
1245 AdjustBaseAndOffset(&source, scratch);
1257 Register scratch = temps.Acquire();
1258 // make sure scratch does not overwrite value
1260 DCHECK(scratch.code() != value.code());
1261 DCHECK(scratch != rs.rm());
1262 AdjustBaseAndOffset(&source, scratch);
1300 Register scratch = temps.Acquire();
1302 Lw(scratch, MemOperand(rs.rm(), rs.offset() + kSystemPointerSize / 2));
1303 slli(scratch, scratch, 32);
1304 Add64(rd, rd, scratch);
1314 Register scratch = temps.Acquire();
1316 srai(scratch, rd, 32);
1317 Sw(scratch, MemOperand(rs.rm(), rs.offset() + kSystemPointerSize / 2));
1321 Register scratch) {
1322 DCHECK_NE(scratch, rs.rm());
1323 UnalignedFLoadHelper<4>(fd, rs, scratch);
1327 Register scratch) {
1328 DCHECK_NE(scratch, rs.rm());
1329 UnalignedFStoreHelper<4>(fd, rs, scratch);
1333 Register scratch) {
1334 DCHECK_NE(scratch, rs.rm());
1335 UnalignedFLoadHelper<8>(fd, rs, scratch);
1339 Register scratch) {
1340 DCHECK_NE(scratch, rs.rm());
1341 UnalignedFStoreHelper<8>(fd, rs, scratch);
1511 Register scratch = temps.Acquire();
1512 Add64(scratch, rs.rm(), rs.offset());
1513 lr_w(false, false, rd, scratch);
1523 Register scratch = temps.Acquire();
1524 Add64(scratch, rs.rm(), rs.offset());
1525 lr_d(false, false, rd, scratch);
1535 Register scratch = temps.Acquire();
1536 Add64(scratch, rs.rm(), rs.offset());
1537 sc_w(false, false, rd, scratch, rd);
1547 Register scratch = temps.Acquire();
1548 Add64(scratch, rs.rm(), rs.offset());
1549 sc_d(false, false, rd, scratch, rd);
1842 // Save csr_fflags to scratch & clear exception flags
1846 Register scratch = temps.Acquire();
1849 csrrci(scratch, csr_fflags, exception_flags);
1861 csrw(csr_fflags, scratch);
2008 Register scratch = temps2.Acquire();
2009 // extract exponent value of the source floating-point to scratch
2011 fmv_x_d(scratch, src);
2013 fmv_x_w(scratch, src);
2015 ExtractBits(scratch2, scratch, kFloatMantissaBits, kFloatExponentBits);
2031 Register scratch = temps2.Acquire();
2036 // payload is 1. In RISC-V, feq_d will set scratch to 0 if src is a NaN. If
2040 feq_d(scratch, src, src);
2041 bnez(scratch, ¬_NaN);
2044 feq_s(scratch, src, src);
2045 bnez(scratch, ¬_NaN);
2077 Register scratch = temps.Acquire();
2079 fcvt_l_d(scratch, src, frm);
2080 fcvt_d_l(dst, scratch, frm);
2082 fcvt_w_s(scratch, src, frm);
2083 fcvt_s_w(dst, scratch, frm);
2108 void TurboAssembler::RoundHelper(VRegister dst, VRegister src, Register scratch,
2110 VU.set(scratch, std::is_same<F, float>::value ? E32 : E64, m1);
2136 li(scratch, 64 - kFloatMantissaBits - kFloatExponentBits);
2137 vsll_vx(v_scratch, src, scratch);
2138 li(scratch, 64 - kFloatExponentBits);
2139 vsrl_vx(v_scratch, v_scratch, scratch);
2140 li(scratch, kFloatExponentBias + kFloatMantissaBits);
2141 vmslt_vx(v0, v_scratch, scratch);
2162 void TurboAssembler::Ceil_f(VRegister vdst, VRegister vsrc, Register scratch,
2164 RoundHelper<float>(vdst, vsrc, scratch, v_scratch, RUP);
2167 void TurboAssembler::Ceil_d(VRegister vdst, VRegister vsrc, Register scratch,
2169 RoundHelper<double>(vdst, vsrc, scratch, v_scratch, RUP);
2172 void TurboAssembler::Floor_f(VRegister vdst, VRegister vsrc, Register scratch,
2174 RoundHelper<float>(vdst, vsrc, scratch, v_scratch, RDN);
2177 void TurboAssembler::Floor_d(VRegister vdst, VRegister vsrc, Register scratch,
2179 RoundHelper<double>(vdst, vsrc, scratch, v_scratch, RDN);
2182 void TurboAssembler::Trunc_d(VRegister vdst, VRegister vsrc, Register scratch,
2184 RoundHelper<double>(vdst, vsrc, scratch, v_scratch, RTZ);
2187 void TurboAssembler::Trunc_f(VRegister vdst, VRegister vsrc, Register scratch,
2189 RoundHelper<float>(vdst, vsrc, scratch, v_scratch, RTZ);
2192 void TurboAssembler::Round_f(VRegister vdst, VRegister vsrc, Register scratch,
2194 RoundHelper<float>(vdst, vsrc, scratch, v_scratch, RNE);
2197 void TurboAssembler::Round_d(VRegister vdst, VRegister vsrc, Register scratch,
2199 RoundHelper<double>(vdst, vsrc, scratch, v_scratch, RNE);
2320 Register scratch = temps.Acquire();
2323 feq_s(scratch, cmp2, cmp2); // scratch <- !isNaN(cmp2)
2324 And(rd, rd, scratch); // rd <- !isNan(cmp1) && !isNan(cmp2)
2331 Register scratch = temps.Acquire();
2334 feq_d(scratch, cmp2, cmp2); // scratch <- !isNaN(cmp2)
2335 And(rd, rd, scratch); // rd <- !isNan(cmp1) && !isNan(cmp2)
2386 Register scratch = temps.Acquire();
2390 DCHECK(src_high != scratch2 && src_high != scratch);
2392 fmv_x_d(scratch, dst);
2394 slli(scratch, scratch, 32);
2395 srli(scratch, scratch, 32);
2396 or_(scratch, scratch, scratch2);
2397 fmv_d_x(dst, scratch);
2402 Register scratch = temps.Acquire();
2406 DCHECK(src_low != scratch && src_low != scratch2);
2407 fmv_x_d(scratch, dst);
2410 srli(scratch, scratch, 32);
2411 slli(scratch, scratch, 32);
2412 or_(scratch, scratch, scratch2);
2413 fmv_d_x(dst, scratch);
2430 Register scratch = temps.Acquire();
2431 li(scratch, Operand(static_cast<int32_t>(src)));
2432 fmv_w_x(dst, scratch);
2451 Register scratch = temps.Acquire();
2452 li(scratch, Operand(src));
2453 fmv_d_x(dst, scratch);
2506 Register scratch = temps.Acquire();
2507 seqz(scratch, condition);
2508 // neg + and may be more efficient than mul(dest, dest, scratch)
2509 neg(scratch, scratch); // 0 is still 0, 1 becomes all 1s
2510 and_(dest, dest, scratch);
2517 Register scratch = temps.Acquire();
2518 snez(scratch, condition);
2519 // neg + and may be more efficient than mul(dest, dest, scratch);
2520 neg(scratch, scratch); // 0 is still 0, 1 becomes all 1s
2521 and_(dest, dest, scratch);
2633 Register scratch = temps.Acquire();
2634 Add64(scratch, rs, -1);
2635 Xor(rd, scratch, rs);
2636 And(rd, rd, scratch);
2644 Register scratch = temps.Acquire();
2645 li(scratch, 32);
2646 Sub32(rd, scratch, rd);
2657 Register scratch = temps.Acquire();
2658 Add64(scratch, rs, -1);
2659 Xor(rd, scratch, rs);
2660 And(rd, rd, scratch);
2668 Register scratch = temps.Acquire();
2669 li(scratch, 64);
2670 Sub64(rd, scratch, rd);
2674 void TurboAssembler::Popcnt32(Register rd, Register rs, Register scratch) {
2675 DCHECK_NE(scratch, rs);
2676 DCHECK_NE(scratch, rd);
2705 Srl32(scratch, rs, 1);
2706 And(scratch, scratch, scratch2);
2707 Sub32(scratch, rs, scratch);
2711 And(rd, scratch, scratch2);
2712 Srl32(scratch, scratch, 2);
2713 And(scratch, scratch, scratch2);
2714 Add32(scratch, rd, scratch);
2715 srliw(rd, scratch, 4);
2716 Add32(rd, rd, scratch);
2724 void TurboAssembler::Popcnt64(Register rd, Register rs, Register scratch) {
2725 DCHECK_NE(scratch, rs);
2726 DCHECK_NE(scratch, rd);
2742 Srl64(scratch, rs, 1);
2743 And(scratch, scratch, scratch2);
2744 Sub64(scratch, rs, scratch);
2747 And(rd, scratch, scratch2);
2748 Srl64(scratch, scratch, 2);
2749 And(scratch, scratch, scratch2);
2750 Add64(scratch, rd, scratch);
2751 Srl64(rd, scratch, 4);
2752 Add64(rd, rd, scratch);
2765 Register scratch = temps.Acquire();
2766 // if scratch == 1, exception happens during truncation
2767 Trunc_w_d(result, double_input, scratch);
2768 // If we had no exceptions (i.e., scratch==1) we are done.
2769 Branch(done, eq, scratch, Operand(1));
2868 Register scratch = temps.Acquire();
2869 LoadRoot(scratch, index);
2870 Branch(L, cond, rs, Operand(scratch));
2896 Register scratch) {
2901 r2 = scratch;
2916 Register* scratch, const Operand& rt) {
2918 *scratch = GetRtAsRegisterHelper(rt, *scratch);
2928 Register scratch = no_reg;
2930 scratch = temps.Acquire();
2931 li(scratch, rt);
2933 scratch = rt.rm();
2950 beq(rs, scratch, offset);
2959 bne(rs, scratch, offset);
2970 bgt(rs, scratch, offset);
2980 bge(rs, scratch, offset);
2989 blt(rs, scratch, offset);
2999 ble(rs, scratch, offset);
3010 bgtu(rs, scratch, offset);
3020 bgeu(rs, scratch, offset);
3029 bltu(rs, scratch, offset);
3039 bleu(rs, scratch, offset);
3149 Register scratch = temps.Acquire();
3157 Operand(GetRtAsRegisterHelper(rt, scratch)));
3300 Register scratch = temps.Acquire();
3301 Sub64(scratch, value, Operand(lower_limit));
3302 Branch(on_in_range, Uless_equal, scratch,
3408 Register scratch = temps.Acquire();
3409 auipc(scratch, 0); // Load PC into scratch
3410 Ld(t6, MemOperand(scratch, kInstrSize * 4));
3521 void MacroAssembler::Swap(Register reg1, Register reg2, Register scratch) {
3522 if (scratch == no_reg) {
3527 Mv(scratch, reg1);
3529 Mv(reg2, scratch);
3553 Register scratch = temps.Acquire();
3554 li(scratch, Operand(smi));
3555 push(scratch);
3561 Register scratch = temps.Acquire();
3565 Mv(scratch, zero_reg);
3568 CalcScaledAddress(scratch2, array, scratch, kSystemPointerSizeLog2);
3571 Add64(scratch, scratch, Operand(1));
3573 Branch(&loop, less, scratch, Operand(size));
3575 Mv(scratch, size);
3578 CalcScaledAddress(scratch2, array, scratch, kSystemPointerSizeLog2);
3582 Add64(scratch, scratch, Operand(-1));
3583 Branch(&loop, greater_equal, scratch, Operand(zero_reg));
3589 Register scratch = temps.Acquire();
3590 li(scratch, Operand(handle));
3591 push(scratch);
3624 Register scratch = temps.Acquire();
3625 li(scratch,
3627 Sd(a1, MemOperand(scratch));
3782 Register scratch = temps.Acquire();
3783 li(scratch,
3785 Lb(scratch, MemOperand(scratch));
3786 Branch(&skip_hook, eq, scratch, Operand(zero_reg));
4055 Register scratch = temps.Acquire();
4058 li(scratch, Operand(right));
4059 right_reg = scratch;
4069 xor_(scratch, scratch2, right_reg);
4070 and_(overflow, overflow, scratch);
4075 xor_(scratch, dst, right_reg);
4076 and_(overflow, overflow, scratch);
4085 Register scratch = temps.Acquire();
4088 li(scratch, Operand(right));
4089 right_reg = scratch;
4101 xor_(scratch, left, right_reg);
4102 and_(overflow, overflow, scratch);
4107 xor_(scratch, left, right_reg);
4108 and_(overflow, overflow, scratch);
4118 Register scratch = temps.Acquire();
4121 li(scratch, Operand(right));
4122 right_reg = scratch;
4321 Register scratch = temps.Acquire();
4322 li(scratch, Operand(StackFrame::TypeToMarker(type)));
4323 PushCommonFrame(scratch);
4331 Register scratch = temps.Acquire();
4336 li(scratch, Operand(StackFrame::TypeToMarker(type)));
4337 Push(scratch);
4379 Register scratch = temps.Acquire();
4380 li(scratch, Operand(StackFrame::TypeToMarker(frame_type)));
4381 Sd(scratch, MemOperand(sp, 1 * kSystemPointerSize));
4392 Register scratch = temps.Acquire();
4395 li(scratch, ExternalReference::Create(IsolateAddressId::kCEntryFPAddress,
4397 Sd(fp, MemOperand(scratch));
4398 li(scratch,
4400 Sd(cp, MemOperand(scratch));
4431 Register scratch = temps.Acquire();
4432 addi(scratch, sp, kSystemPointerSize);
4433 Sd(scratch, MemOperand(fp, ExitFrameConstants::kSPOffset));
4441 Register scratch = temps.Acquire();
4446 Sub64(scratch, fp,
4453 LoadDouble(reg, MemOperand(scratch, cout * kDoubleSize));
4460 li(scratch,
4462 Sd(zero_reg, MemOperand(scratch));
4465 li(scratch,
4467 Ld(cp, MemOperand(scratch));
4473 Sd(scratch2, MemOperand(scratch));
4523 Register scratch = temps.Acquire();
4524 andi(scratch, sp, frame_alignment_mask);
4525 BranchShort(&alignment_as_expected, eq, scratch, Operand(zero_reg));
4562 Register scratch = temps.Acquire();
4563 andi(scratch, value, kSmiTagMask);
4564 Branch(smi_label, eq, scratch, Operand(zero_reg));
4570 Register scratch = temps.Acquire();
4572 andi(scratch, value, kSmiTagMask);
4573 Branch(not_smi_label, ne, scratch, Operand(zero_reg));
4694 Register scratch) {
4699 LoadRoot(scratch, RootIndex::kUndefinedValue);
4700 BranchShort(&done_checking, eq, object, Operand(scratch));
4701 GetObjectType(object, scratch, scratch);
4702 Assert(eq, AbortReason::kExpectedUndefinedOrCell, scratch,
4730 Register scratch = temps.Acquire();
4732 CompareIsNotNanF32(scratch, src1, src2);
4734 CompareIsNotNanF64(scratch, src1, src2);
4736 BranchFalseF(scratch, &nan);
4808 Register scratch) {
4820 Mv(scratch, sp);
4824 Sd(scratch, MemOperand(sp, stack_passed_arguments * kSystemPointerSize));
4831 Register scratch) {
4832 PrepareCallCFunction(num_reg_arguments, 0, scratch);
4878 Register scratch = temps.Acquire();
4879 And(scratch, sp, Operand(frame_alignment_mask));
4880 BranchShort(&alignment_as_expected, eq, scratch, Operand(zero_reg));
4902 // 't' registers are caller-saved so this is safe as a scratch register.
4904 Register scratch = t2;
4915 li(scratch, ExternalReference::fast_c_call_caller_pc_address(isolate()));
4916 Sd(pc_scratch, MemOperand(scratch));
4917 li(scratch, ExternalReference::fast_c_call_caller_fp_address(isolate()));
4918 Sd(fp, MemOperand(scratch));
4926 Register scratch = temps.Acquire();
4927 li(scratch, ExternalReference::fast_c_call_caller_fp_address(isolate()));
4928 Sd(zero_reg, MemOperand(scratch));
4944 void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask,
4946 And(scratch, object, Operand(~kPageAlignmentMask));
4947 Ld(scratch, MemOperand(scratch, BasicMemoryChunk::kFlagsOffset));
4948 And(scratch, scratch, Operand(mask));
4949 Branch(condition_met, cc, scratch, Operand(zero_reg));
5010 Register scratch = temps.Acquire();
5012 DCHECK(!AreAliased(destination, scratch));
5013 DCHECK(!AreAliased(code_object, scratch));
5019 Lw(scratch, FieldMemOperand(code_object, Code::kFlagsOffset));
5020 And(scratch, scratch, Operand(Code::IsOffHeapTrampoline::kMask));
5021 Branch(&if_code_is_off_heap, ne, scratch, Operand(zero_reg));
5030 Lw(scratch, FieldMemOperand(code_object, Code::kBuiltinIndexOffset));
5031 slli(destination, scratch, kSystemPointerSizeLog2);
5128 ArgumentsCountMode mode, Register scratch) {
5136 DCHECK_NE(scratch, no_reg);
5137 SmiScale(scratch, count, kPointerSizeLog2);
5138 Add64(sp, sp, scratch);
5155 Register scratch) {
5159 DropArguments(argc, type, kCountIncludesReceiver, scratch);
5162 DropArguments(argc, type, mode, scratch);