Commit 794c2305 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

PPC/s390: Reland "[wasm][memory64] Prepare Liftoff for ptrsize offsets"

Port 1da429fb

Original Commit Message:

    This is a reland of 800307f6, with a
    minimal fix for arm64 (uint64_t -> uintptr_t).

    Original change's description:
    > [wasm][memory64] Prepare Liftoff for ptrsize offsets
    >
    > This CL prepares the LiftoffAssembler interface for uintptr_t offsets.
    > Many places can still only handle 32-bit values, but after this CL we can
    > start storing the offsets as uintptr_t in the memory access immediates.
    > Some TODOs are placed to extend code generation for 64-bit additions, if
    > memory64 is enabled.
    > All of this will be addressed in follow-up CLs.
    >
    > R=manoskouk@chromium.org
    >
    > Bug: v8:10949
    > Change-Id: Id3b9b8aa555ab41f082ba012f4f8d80586c35b89
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2529452
    > Commit-Queue: Clemens Backes <clemensb@chromium.org>
    > Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#71236}

R=clemensb@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I87a421ab1fe6e4d0f2098c24ff34a3888631722e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2552166Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71317}
parent 9d90e601
...@@ -119,70 +119,70 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr, ...@@ -119,70 +119,70 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
} }
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm, Register offset_reg, uintptr_t offset_imm,
LoadType type, LiftoffRegList pinned, LoadType type, LiftoffRegList pinned,
uint32_t* protected_load_pc, bool is_load_mem) { uint32_t* protected_load_pc, bool is_load_mem) {
bailout(kUnsupportedArchitecture, "Load"); bailout(kUnsupportedArchitecture, "Load");
} }
void LiftoffAssembler::Store(Register dst_addr, Register offset_reg, void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister src, uintptr_t offset_imm, LiftoffRegister src,
StoreType type, LiftoffRegList pinned, StoreType type, LiftoffRegList pinned,
uint32_t* protected_store_pc, bool is_store_mem) { uint32_t* protected_store_pc, bool is_store_mem) {
bailout(kUnsupportedArchitecture, "Store"); bailout(kUnsupportedArchitecture, "Store");
} }
void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm, Register offset_reg, uintptr_t offset_imm,
LoadType type, LiftoffRegList pinned) { LoadType type, LiftoffRegList pinned) {
bailout(kAtomics, "AtomicLoad"); bailout(kAtomics, "AtomicLoad");
} }
void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister src, uintptr_t offset_imm, LiftoffRegister src,
StoreType type, LiftoffRegList pinned) { StoreType type, LiftoffRegList pinned) {
bailout(kAtomics, "AtomicStore"); bailout(kAtomics, "AtomicStore");
} }
void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicAdd"); bailout(kAtomics, "AtomicAdd");
} }
void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicSub"); bailout(kAtomics, "AtomicSub");
} }
void LiftoffAssembler::AtomicAnd(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicAnd(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicAnd"); bailout(kAtomics, "AtomicAnd");
} }
void LiftoffAssembler::AtomicOr(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicOr(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicOr"); bailout(kAtomics, "AtomicOr");
} }
void LiftoffAssembler::AtomicXor(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicXor(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicXor"); bailout(kAtomics, "AtomicXor");
} }
void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg,
uint32_t offset_imm, uintptr_t offset_imm,
LiftoffRegister value, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicExchange"); bailout(kAtomics, "AtomicExchange");
} }
void LiftoffAssembler::AtomicCompareExchange( void LiftoffAssembler::AtomicCompareExchange(
Register dst_addr, Register offset_reg, uint32_t offset_imm, Register dst_addr, Register offset_reg, uintptr_t offset_imm,
LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result, LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result,
StoreType type) { StoreType type) {
bailout(kAtomics, "AtomicCompareExchange"); bailout(kAtomics, "AtomicCompareExchange");
...@@ -343,7 +343,7 @@ UNIMPLEMENTED_I32_BINOP_I(i32_xor) ...@@ -343,7 +343,7 @@ UNIMPLEMENTED_I32_BINOP_I(i32_xor)
UNIMPLEMENTED_I32_SHIFTOP(i32_shl) UNIMPLEMENTED_I32_SHIFTOP(i32_shl)
UNIMPLEMENTED_I32_SHIFTOP(i32_sar) UNIMPLEMENTED_I32_SHIFTOP(i32_sar)
UNIMPLEMENTED_I32_SHIFTOP(i32_shr) UNIMPLEMENTED_I32_SHIFTOP(i32_shr)
UNIMPLEMENTED_I64_BINOP_I(i64_add) UNIMPLEMENTED_I64_BINOP(i64_add)
UNIMPLEMENTED_I64_BINOP(i64_sub) UNIMPLEMENTED_I64_BINOP(i64_sub)
UNIMPLEMENTED_I64_BINOP(i64_mul) UNIMPLEMENTED_I64_BINOP(i64_mul)
#ifdef V8_TARGET_ARCH_PPC64 #ifdef V8_TARGET_ARCH_PPC64
...@@ -407,6 +407,11 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst, ...@@ -407,6 +407,11 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst,
return true; return true;
} }
void LiftoffAssembler::emit_i64_addi(LiftoffRegister dst, LiftoffRegister lhs,
int64_t imm) {
bailout(kUnsupportedArchitecture, "i64_addi");
}
void LiftoffAssembler::emit_i32_divs(Register dst, Register lhs, Register rhs, void LiftoffAssembler::emit_i32_divs(Register dst, Register lhs, Register rhs,
Label* trap_div_by_zero, Label* trap_div_by_zero,
Label* trap_div_unrepresentable) { Label* trap_div_unrepresentable) {
...@@ -556,7 +561,7 @@ bool LiftoffAssembler::emit_select(LiftoffRegister dst, Register condition, ...@@ -556,7 +561,7 @@ bool LiftoffAssembler::emit_select(LiftoffRegister dst, Register condition,
} }
void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm, Register offset_reg, uintptr_t offset_imm,
LoadType type, LoadType type,
LoadTransformationKind transform, LoadTransformationKind transform,
uint32_t* protected_load_pc) { uint32_t* protected_load_pc) {
......
...@@ -118,70 +118,70 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr, ...@@ -118,70 +118,70 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
} }
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm, Register offset_reg, uintptr_t offset_imm,
LoadType type, LiftoffRegList pinned, LoadType type, LiftoffRegList pinned,
uint32_t* protected_load_pc, bool is_load_mem) { uint32_t* protected_load_pc, bool is_load_mem) {
bailout(kUnsupportedArchitecture, "Load"); bailout(kUnsupportedArchitecture, "Load");
} }
void LiftoffAssembler::Store(Register dst_addr, Register offset_reg, void LiftoffAssembler::Store(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister src, uintptr_t offset_imm, LiftoffRegister src,
StoreType type, LiftoffRegList pinned, StoreType type, LiftoffRegList pinned,
uint32_t* protected_store_pc, bool is_store_mem) { uint32_t* protected_store_pc, bool is_store_mem) {
bailout(kUnsupportedArchitecture, "Store"); bailout(kUnsupportedArchitecture, "Store");
} }
void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm, Register offset_reg, uintptr_t offset_imm,
LoadType type, LiftoffRegList pinned) { LoadType type, LiftoffRegList pinned) {
bailout(kAtomics, "AtomicLoad"); bailout(kAtomics, "AtomicLoad");
} }
void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicStore(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister src, uintptr_t offset_imm, LiftoffRegister src,
StoreType type, LiftoffRegList pinned) { StoreType type, LiftoffRegList pinned) {
bailout(kAtomics, "AtomicStore"); bailout(kAtomics, "AtomicStore");
} }
void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicAdd(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicAdd"); bailout(kAtomics, "AtomicAdd");
} }
void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicSub(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicSub"); bailout(kAtomics, "AtomicSub");
} }
void LiftoffAssembler::AtomicAnd(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicAnd(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicAnd"); bailout(kAtomics, "AtomicAnd");
} }
void LiftoffAssembler::AtomicOr(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicOr(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicOr"); bailout(kAtomics, "AtomicOr");
} }
void LiftoffAssembler::AtomicXor(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicXor(Register dst_addr, Register offset_reg,
uint32_t offset_imm, LiftoffRegister value, uintptr_t offset_imm, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicXor"); bailout(kAtomics, "AtomicXor");
} }
void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg, void LiftoffAssembler::AtomicExchange(Register dst_addr, Register offset_reg,
uint32_t offset_imm, uintptr_t offset_imm,
LiftoffRegister value, LiftoffRegister value,
LiftoffRegister result, StoreType type) { LiftoffRegister result, StoreType type) {
bailout(kAtomics, "AtomicExchange"); bailout(kAtomics, "AtomicExchange");
} }
void LiftoffAssembler::AtomicCompareExchange( void LiftoffAssembler::AtomicCompareExchange(
Register dst_addr, Register offset_reg, uint32_t offset_imm, Register dst_addr, Register offset_reg, uintptr_t offset_imm,
LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result, LiftoffRegister expected, LiftoffRegister new_value, LiftoffRegister result,
StoreType type) { StoreType type) {
bailout(kAtomics, "AtomicCompareExchange"); bailout(kAtomics, "AtomicCompareExchange");
...@@ -347,7 +347,7 @@ UNIMPLEMENTED_I32_BINOP_I(i32_xor) ...@@ -347,7 +347,7 @@ UNIMPLEMENTED_I32_BINOP_I(i32_xor)
UNIMPLEMENTED_I32_SHIFTOP(i32_shl) UNIMPLEMENTED_I32_SHIFTOP(i32_shl)
UNIMPLEMENTED_I32_SHIFTOP(i32_sar) UNIMPLEMENTED_I32_SHIFTOP(i32_sar)
UNIMPLEMENTED_I32_SHIFTOP(i32_shr) UNIMPLEMENTED_I32_SHIFTOP(i32_shr)
UNIMPLEMENTED_I64_BINOP_I(i64_add) UNIMPLEMENTED_I64_BINOP(i64_add)
UNIMPLEMENTED_I64_BINOP(i64_sub) UNIMPLEMENTED_I64_BINOP(i64_sub)
UNIMPLEMENTED_I64_BINOP(i64_mul) UNIMPLEMENTED_I64_BINOP(i64_mul)
#ifdef V8_TARGET_ARCH_S390X #ifdef V8_TARGET_ARCH_S390X
...@@ -411,6 +411,11 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst, ...@@ -411,6 +411,11 @@ bool LiftoffAssembler::emit_i64_popcnt(LiftoffRegister dst,
return true; return true;
} }
void LiftoffAssembler::emit_i64_addi(LiftoffRegister dst, LiftoffRegister lhs,
int64_t imm) {
bailout(kUnsupportedArchitecture, "i64_addi");
}
void LiftoffAssembler::emit_i32_divs(Register dst, Register lhs, Register rhs, void LiftoffAssembler::emit_i32_divs(Register dst, Register lhs, Register rhs,
Label* trap_div_by_zero, Label* trap_div_by_zero,
Label* trap_div_unrepresentable) { Label* trap_div_unrepresentable) {
...@@ -560,7 +565,7 @@ bool LiftoffAssembler::emit_select(LiftoffRegister dst, Register condition, ...@@ -560,7 +565,7 @@ bool LiftoffAssembler::emit_select(LiftoffRegister dst, Register condition,
} }
void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm, Register offset_reg, uintptr_t offset_imm,
LoadType type, LoadType type,
LoadTransformationKind transform, LoadTransformationKind transform,
uint32_t* protected_load_pc) { uint32_t* protected_load_pc) {
......
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