diff options
Diffstat (limited to 'deps/v8/src/wasm/baseline/loong64/liftoff-assembler-loong64.h')
-rw-r--r-- | deps/v8/src/wasm/baseline/loong64/liftoff-assembler-loong64.h | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/deps/v8/src/wasm/baseline/loong64/liftoff-assembler-loong64.h b/deps/v8/src/wasm/baseline/loong64/liftoff-assembler-loong64.h index b62fee4e04..7a88ff5c03 100644 --- a/deps/v8/src/wasm/baseline/loong64/liftoff-assembler-loong64.h +++ b/deps/v8/src/wasm/baseline/loong64/liftoff-assembler-loong64.h @@ -299,7 +299,7 @@ constexpr int LiftoffAssembler::StaticStackFrameSize() { int LiftoffAssembler::SlotSizeForType(ValueKind kind) { switch (kind) { case kS128: - return element_size_bytes(kind); + return value_kind_size(kind); default: return kStackSlotSize; } @@ -599,8 +599,7 @@ void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg, void LiftoffAssembler::Atomic##name( \ Register dst_addr, Register offset_reg, uintptr_t offset_imm, \ LiftoffRegister value, LiftoffRegister result, StoreType type) { \ - LiftoffRegList pinned = \ - LiftoffRegList::ForRegs(dst_addr, offset_reg, value, result); \ + LiftoffRegList pinned = {dst_addr, offset_reg, value, result}; \ Register temp0 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); \ Register temp1 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); \ Register temp2 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); \ @@ -655,8 +654,7 @@ ATOMIC_BINOP_CASE(Xor, Xor, Xor, xor) void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg, uintptr_t offset_imm, LiftoffRegister value, LiftoffRegister result, StoreType type) { - LiftoffRegList pinned = - LiftoffRegList::ForRegs(dst_addr, offset_reg, value, result); + LiftoffRegList pinned = {dst_addr, offset_reg, value, result}; Register temp0 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); Register temp1 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); Register temp2 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); @@ -714,8 +712,7 @@ void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg, uintptr_t offset_imm, LiftoffRegister value, LiftoffRegister result, StoreType type) { - LiftoffRegList pinned = - LiftoffRegList::ForRegs(dst_addr, offset_reg, value, result); + LiftoffRegList pinned = {dst_addr, offset_reg, value, result}; Register temp0 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); Register temp1 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); Register temp2 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); @@ -790,8 +787,7 @@ void LiftoffAssembler::AtomicCompareExchange( Register dst_addr, Register offset_reg, uintptr_t offset_imm, LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result, StoreType type) { - LiftoffRegList pinned = LiftoffRegList::ForRegs(dst_addr, offset_reg, - expected, new_value, result); + LiftoffRegList pinned = {dst_addr, offset_reg, expected, new_value, result}; Register temp0 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); Register temp1 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); Register temp2 = pinned.set(GetUnusedRegister(kGpReg, pinned)).gp(); @@ -1000,6 +996,15 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst, return true; } +void LiftoffAssembler::IncrementSmi(LiftoffRegister dst, int offset) { + UseScratchRegisterScope temps(this); + Register scratch = temps.Acquire(); + SmiUntag(scratch, MemOperand(dst.gp(), offset)); + Add_d(scratch, scratch, Operand(1)); + SmiTag(scratch); + St_d(scratch, MemOperand(dst.gp(), offset)); +} + void LiftoffAssembler::emit_i32_mul(Register dst, Register lhs, Register rhs) { TurboAssembler::Mul_w(dst, lhs, rhs); } @@ -1320,10 +1325,9 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, TurboAssembler::bstrpick_w(dst.gp(), src.gp(), 31, 0); return true; case kExprI32SConvertF32: { - LiftoffRegister rounded = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src)); + LiftoffRegister rounded = GetUnusedRegister(kFpReg, LiftoffRegList{src}); LiftoffRegister converted_back = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src, rounded)); + GetUnusedRegister(kFpReg, LiftoffRegList{src, rounded}); // Real conversion. TurboAssembler::Trunc_s(rounded.fp(), src.fp()); @@ -1343,10 +1347,9 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, return true; } case kExprI32UConvertF32: { - LiftoffRegister rounded = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src)); + LiftoffRegister rounded = GetUnusedRegister(kFpReg, LiftoffRegList{src}); LiftoffRegister converted_back = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src, rounded)); + GetUnusedRegister(kFpReg, LiftoffRegList{src, rounded}); // Real conversion. TurboAssembler::Trunc_s(rounded.fp(), src.fp()); @@ -1364,10 +1367,9 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, return true; } case kExprI32SConvertF64: { - LiftoffRegister rounded = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src)); + LiftoffRegister rounded = GetUnusedRegister(kFpReg, LiftoffRegList{src}); LiftoffRegister converted_back = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src, rounded)); + GetUnusedRegister(kFpReg, LiftoffRegList{src, rounded}); // Real conversion. TurboAssembler::Trunc_d(rounded.fp(), src.fp()); @@ -1381,10 +1383,9 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, return true; } case kExprI32UConvertF64: { - LiftoffRegister rounded = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src)); + LiftoffRegister rounded = GetUnusedRegister(kFpReg, LiftoffRegList{src}); LiftoffRegister converted_back = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src, rounded)); + GetUnusedRegister(kFpReg, LiftoffRegList{src, rounded}); // Real conversion. TurboAssembler::Trunc_d(rounded.fp(), src.fp()); @@ -1406,10 +1407,9 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, TurboAssembler::bstrpick_d(dst.gp(), src.gp(), 31, 0); return true; case kExprI64SConvertF32: { - LiftoffRegister rounded = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src)); + LiftoffRegister rounded = GetUnusedRegister(kFpReg, LiftoffRegList{src}); LiftoffRegister converted_back = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src, rounded)); + GetUnusedRegister(kFpReg, LiftoffRegList{src, rounded}); // Real conversion. TurboAssembler::Trunc_s(rounded.fp(), src.fp()); @@ -1438,10 +1438,9 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, return true; } case kExprI64SConvertF64: { - LiftoffRegister rounded = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src)); + LiftoffRegister rounded = GetUnusedRegister(kFpReg, LiftoffRegList{src}); LiftoffRegister converted_back = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(src, rounded)); + GetUnusedRegister(kFpReg, LiftoffRegList{src, rounded}); // Real conversion. TurboAssembler::Trunc_d(rounded.fp(), src.fp()); @@ -1473,8 +1472,7 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, movfr2gr_d(dst.gp(), src.fp()); return true; case kExprF32SConvertI32: { - LiftoffRegister scratch = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(dst)); + LiftoffRegister scratch = GetUnusedRegister(kFpReg, LiftoffRegList{dst}); movgr2fr_w(scratch.fp(), src.gp()); ffint_s_w(dst.fp(), scratch.fp()); return true; @@ -1489,8 +1487,7 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, TurboAssembler::FmoveLow(dst.fp(), src.gp()); return true; case kExprF64SConvertI32: { - LiftoffRegister scratch = - GetUnusedRegister(kFpReg, LiftoffRegList::ForRegs(dst)); + LiftoffRegister scratch = GetUnusedRegister(kFpReg, LiftoffRegList{dst}); movgr2fr_w(scratch.fp(), src.gp()); ffint_d_w(dst.fp(), scratch.fp()); return true; @@ -1635,7 +1632,7 @@ void LiftoffAssembler::emit_i32_set_cond(LiftoffCondition liftoff_cond, Condition cond = liftoff::ToCondition(liftoff_cond); Register tmp = dst; if (dst == lhs || dst == rhs) { - tmp = GetUnusedRegister(kGpReg, LiftoffRegList::ForRegs(lhs, rhs)).gp(); + tmp = GetUnusedRegister(kGpReg, LiftoffRegList{lhs, rhs}).gp(); } // Write 1 as result. TurboAssembler::li(tmp, 1); @@ -1658,7 +1655,7 @@ void LiftoffAssembler::emit_i64_set_cond(LiftoffCondition liftoff_cond, Condition cond = liftoff::ToCondition(liftoff_cond); Register tmp = dst; if (dst == lhs.gp() || dst == rhs.gp()) { - tmp = GetUnusedRegister(kGpReg, LiftoffRegList::ForRegs(lhs, rhs)).gp(); + tmp = GetUnusedRegister(kGpReg, LiftoffRegList{lhs, rhs}).gp(); } // Write 1 as result. TurboAssembler::li(tmp, 1); @@ -2966,7 +2963,7 @@ void LiftoffAssembler::CallC(const ValueKindSig* sig, int arg_bytes = 0; for (ValueKind param_kind : sig->parameters()) { liftoff::Store(this, sp, arg_bytes, *args++, param_kind); - arg_bytes += element_size_bytes(param_kind); + arg_bytes += value_kind_size(param_kind); } DCHECK_LE(arg_bytes, stack_bytes); |