Commit 276355cb authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[liftoff] Rename {emit_u32_to_intptr} to {emit_u32_to_uintptr}

The 32-bit value is zero-extended to pointer size, which is a no-op on
32-bit systems. The operation changes nothing about the signedness of
the value, so the old name was a bit misleading.

We also provide one unified no-op implementation for all 32-bit systems.

R=thibaudm@chromium.org

Bug: v8:10949, chromium:1281995
Change-Id: Id04641fe793155ea98bf878b6789e4afce3da7df
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3424493Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78881}
parent 9a6efed9
...@@ -1974,10 +1974,6 @@ void LiftoffAssembler::emit_f64_max(DoubleRegister dst, DoubleRegister lhs, ...@@ -1974,10 +1974,6 @@ void LiftoffAssembler::emit_f64_max(DoubleRegister dst, DoubleRegister lhs,
liftoff::EmitFloatMinOrMax(this, dst, lhs, rhs, liftoff::MinOrMax::kMax); liftoff::EmitFloatMinOrMax(this, dst, lhs, rhs, liftoff::MinOrMax::kMax);
} }
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) {
// This is a nop on arm.
}
void LiftoffAssembler::emit_f32_copysign(DoubleRegister dst, DoubleRegister lhs, void LiftoffAssembler::emit_f32_copysign(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) { DoubleRegister rhs) {
constexpr uint32_t kF32SignBit = uint32_t{1} << 31; constexpr uint32_t kF32SignBit = uint32_t{1} << 31;
......
...@@ -1336,7 +1336,7 @@ bool LiftoffAssembler::emit_i64_remu(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1336,7 +1336,7 @@ bool LiftoffAssembler::emit_i64_remu(LiftoffRegister dst, LiftoffRegister lhs,
return true; return true;
} }
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) { void LiftoffAssembler::emit_u32_to_uintptr(Register dst, Register src) {
Uxtw(dst, src); Uxtw(dst, src);
} }
......
...@@ -1866,10 +1866,6 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst, ...@@ -1866,10 +1866,6 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst,
return true; return true;
} }
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) {
// This is a nop on ia32.
}
void LiftoffAssembler::emit_f32_add(DoubleRegister dst, DoubleRegister lhs, void LiftoffAssembler::emit_f32_add(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) { DoubleRegister rhs) {
if (CpuFeatures::IsSupported(AVX)) { if (CpuFeatures::IsSupported(AVX)) {
......
...@@ -886,7 +886,7 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -886,7 +886,7 @@ class LiftoffAssembler : public TurboAssembler {
inline void emit_i64_ctz(LiftoffRegister dst, LiftoffRegister src); inline void emit_i64_ctz(LiftoffRegister dst, LiftoffRegister src);
inline bool emit_i64_popcnt(LiftoffRegister dst, LiftoffRegister src); inline bool emit_i64_popcnt(LiftoffRegister dst, LiftoffRegister src);
inline void emit_u32_to_intptr(Register dst, Register src); inline void emit_u32_to_uintptr(Register dst, Register src);
void emit_ptrsize_add(Register dst, Register lhs, Register rhs) { void emit_ptrsize_add(Register dst, Register lhs, Register rhs) {
if (kSystemPointerSize == 8) { if (kSystemPointerSize == 8) {
...@@ -1664,6 +1664,10 @@ void LiftoffAssembler::emit_i64_xori(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1664,6 +1664,10 @@ void LiftoffAssembler::emit_i64_xori(LiftoffRegister dst, LiftoffRegister lhs,
this, dst, lhs, imm); this, dst, lhs, imm);
} }
void LiftoffAssembler::emit_u32_to_uintptr(Register dst, Register src) {
// This is a no-op on 32-bit systems.
}
#endif // V8_TARGET_ARCH_32_BIT #endif // V8_TARGET_ARCH_32_BIT
// End of the partially platform-independent implementations of the // End of the partially platform-independent implementations of the
......
...@@ -2822,7 +2822,7 @@ class LiftoffCompiler { ...@@ -2822,7 +2822,7 @@ class LiftoffCompiler {
// Convert the index to ptrsize, bounds-checking the high word on 32-bit // Convert the index to ptrsize, bounds-checking the high word on 32-bit
// systems for memory64. // systems for memory64.
if (!env_->module->is_memory64) { if (!env_->module->is_memory64) {
__ emit_u32_to_intptr(index_ptrsize, index_ptrsize); __ emit_u32_to_uintptr(index_ptrsize, index_ptrsize);
} else if (kSystemPointerSize == kInt32Size) { } else if (kSystemPointerSize == kInt32Size) {
DCHECK_GE(kMaxUInt32, env_->max_memory_size); DCHECK_GE(kMaxUInt32, env_->max_memory_size);
__ emit_cond_jump(kNotEqualZero, trap_label, kI32, index.high_gp()); __ emit_cond_jump(kNotEqualZero, trap_label, kI32, index.high_gp());
......
...@@ -945,7 +945,7 @@ I64_SHIFTOP_I(shr, srl_d, srli_d) ...@@ -945,7 +945,7 @@ I64_SHIFTOP_I(shr, srl_d, srli_d)
#undef I64_SHIFTOP #undef I64_SHIFTOP
#undef I64_SHIFTOP_I #undef I64_SHIFTOP_I
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) { void LiftoffAssembler::emit_u32_to_uintptr(Register dst, Register src) {
bstrpick_d(dst, src, 31, 0); bstrpick_d(dst, src, 31, 0);
} }
......
...@@ -1239,10 +1239,6 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst, ...@@ -1239,10 +1239,6 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst,
return true; return true;
} }
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) {
// This is a nop on mips32.
}
void LiftoffAssembler::emit_f32_neg(DoubleRegister dst, DoubleRegister src) { void LiftoffAssembler::emit_f32_neg(DoubleRegister dst, DoubleRegister src) {
TurboAssembler::Neg_s(dst, src); TurboAssembler::Neg_s(dst, src);
} }
......
...@@ -1074,7 +1074,7 @@ I64_SHIFTOP_I(shr, dsrl) ...@@ -1074,7 +1074,7 @@ I64_SHIFTOP_I(shr, dsrl)
#undef I64_SHIFTOP #undef I64_SHIFTOP
#undef I64_SHIFTOP_I #undef I64_SHIFTOP_I
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) { void LiftoffAssembler::emit_u32_to_uintptr(Register dst, Register src) {
Dext(dst, src, 0, 32); Dext(dst, src, 0, 32);
} }
......
...@@ -1326,7 +1326,7 @@ void LiftoffAssembler::emit_i64_addi(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1326,7 +1326,7 @@ void LiftoffAssembler::emit_i64_addi(LiftoffRegister dst, LiftoffRegister lhs,
int64_t imm) { int64_t imm) {
TurboAssembler::Add64(dst.gp(), lhs.gp(), Operand(imm)); TurboAssembler::Add64(dst.gp(), lhs.gp(), Operand(imm));
} }
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) { void LiftoffAssembler::emit_u32_to_uintptr(Register dst, Register src) {
addw(dst, src, zero_reg); addw(dst, src, zero_reg);
} }
......
...@@ -1471,7 +1471,7 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst, ...@@ -1471,7 +1471,7 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst,
return true; return true;
} }
void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) { void LiftoffAssembler::emit_u32_to_uintptr(Register dst, Register src) {
movl(dst, src); movl(dst, src);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment