Commit a0d493e2 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][liftoff][arm][arm64] Implement load extends

Bug: v8:9909
Change-Id: Iac2146621689e0939cc7be656d5098ff1c8159a2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2207652
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67934}
parent 47513717
......@@ -2142,7 +2142,42 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
LoadType type,
LoadTransformationKind transform,
uint32_t* protected_load_pc) {
bailout(kSimd, "Load transform unimplemented");
UseScratchRegisterScope temps(this);
Register actual_src_addr = liftoff::CalculateActualAddress(
this, &temps, src_addr, offset_reg, offset_imm);
*protected_load_pc = pc_offset();
if (transform == LoadTransformationKind::kExtend) {
MachineType memtype = type.mem_type();
if (memtype == MachineType::Int8()) {
vld1(Neon8, NeonListOperand(dst.low_fp()),
NeonMemOperand(actual_src_addr));
vmovl(NeonS8, liftoff::GetSimd128Register(dst), dst.low_fp());
} else if (memtype == MachineType::Uint8()) {
vld1(Neon8, NeonListOperand(dst.low_fp()),
NeonMemOperand(actual_src_addr));
vmovl(NeonU8, liftoff::GetSimd128Register(dst), dst.low_fp());
} else if (memtype == MachineType::Int16()) {
vld1(Neon16, NeonListOperand(dst.low_fp()),
NeonMemOperand(actual_src_addr));
vmovl(NeonS16, liftoff::GetSimd128Register(dst), dst.low_fp());
} else if (memtype == MachineType::Uint16()) {
vld1(Neon16, NeonListOperand(dst.low_fp()),
NeonMemOperand(actual_src_addr));
vmovl(NeonU16, liftoff::GetSimd128Register(dst), dst.low_fp());
} else if (memtype == MachineType::Int32()) {
vld1(Neon32, NeonListOperand(dst.low_fp()),
NeonMemOperand(actual_src_addr));
vmovl(NeonS32, liftoff::GetSimd128Register(dst), dst.low_fp());
} else if (memtype == MachineType::Uint32()) {
vld1(Neon32, NeonListOperand(dst.low_fp()),
NeonMemOperand(actual_src_addr));
vmovl(NeonU32, liftoff::GetSimd128Register(dst), dst.low_fp());
}
} else {
DCHECK_EQ(LoadTransformationKind::kSplat, transform);
bailout(kSimd, "load splats unimplemented");
}
}
void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst,
......
......@@ -1168,7 +1168,36 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
LoadType type,
LoadTransformationKind transform,
uint32_t* protected_load_pc) {
bailout(kSimd, "Load transform unimplemented");
UseScratchRegisterScope temps(this);
MemOperand src_op =
liftoff::GetMemOp(this, &temps, src_addr, offset_reg, offset_imm);
*protected_load_pc = pc_offset();
if (transform == LoadTransformationKind::kExtend) {
MachineType memtype = type.mem_type();
if (memtype == MachineType::Int8()) {
Ldr(dst.fp().D(), src_op);
Sxtl(dst.fp().V8H(), dst.fp().V8B());
} else if (memtype == MachineType::Uint8()) {
Ldr(dst.fp().D(), src_op);
Uxtl(dst.fp().V8H(), dst.fp().V8B());
} else if (memtype == MachineType::Int16()) {
Ldr(dst.fp().D(), src_op);
Sxtl(dst.fp().V4S(), dst.fp().V4H());
} else if (memtype == MachineType::Uint16()) {
Ldr(dst.fp().D(), src_op);
Uxtl(dst.fp().V4S(), dst.fp().V4H());
} else if (memtype == MachineType::Int32()) {
Ldr(dst.fp().D(), src_op);
Sxtl(dst.fp().V2D(), dst.fp().V2S());
} else if (memtype == MachineType::Uint32()) {
Ldr(dst.fp().D(), src_op);
Uxtl(dst.fp().V2D(), dst.fp().V2S());
}
} else {
DCHECK_EQ(LoadTransformationKind::kSplat, transform);
bailout(kSimd, "load splats unimplemented");
}
}
void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst,
......
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