Commit 59e96890 authored by Zhou, Zhiguo's avatar Zhou, Zhiguo Committed by Commit Bot

[wasm-simd][liftoff] Implement i16x8.splat on X64 and IA32

Bug: v8:9909
Change-Id: Ia74282eab46335235cf4f0e55589af3fcc836d9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036739Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhiguo Zhou <zhiguo.zhou@intel.com>
Cr-Commit-Position: refs/heads/master@{#66300}
parent 8d7747a7
...@@ -1548,6 +1548,11 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst, ...@@ -1548,6 +1548,11 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst,
vdup(Neon32, liftoff::GetSimd128Register(dst.low_fp()), src.gp()); vdup(Neon32, liftoff::GetSimd128Register(dst.low_fp()), src.gp());
} }
void LiftoffAssembler::emit_i16x8_splat(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i16x8splat");
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) { void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
ldr(limit_address, MemOperand(limit_address)); ldr(limit_address, MemOperand(limit_address));
cmp(sp, limit_address); cmp(sp, limit_address);
......
...@@ -1079,6 +1079,11 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst, ...@@ -1079,6 +1079,11 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst,
Dup(dst.fp().V4S(), src.gp().W()); Dup(dst.fp().V4S(), src.gp().W());
} }
void LiftoffAssembler::emit_i16x8_splat(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i16x8splat");
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) { void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
Ldr(limit_address, MemOperand(limit_address)); Ldr(limit_address, MemOperand(limit_address));
Cmp(sp, limit_address); Cmp(sp, limit_address);
......
...@@ -1929,6 +1929,13 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst, ...@@ -1929,6 +1929,13 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst,
Pshufd(dst.fp(), dst.fp(), 0); Pshufd(dst.fp(), dst.fp(), 0);
} }
void LiftoffAssembler::emit_i16x8_splat(LiftoffRegister dst,
LiftoffRegister src) {
Movd(dst.fp(), src.gp());
Pshuflw(dst.fp(), dst.fp(), 0);
Pshufd(dst.fp(), dst.fp(), 0);
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) { void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
cmp(esp, Operand(limit_address, 0)); cmp(esp, Operand(limit_address, 0));
j(below_equal, ool_code); j(below_equal, ool_code);
......
...@@ -681,6 +681,7 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -681,6 +681,7 @@ class LiftoffAssembler : public TurboAssembler {
inline void emit_f32x4_splat(LiftoffRegister dst, LiftoffRegister src); inline void emit_f32x4_splat(LiftoffRegister dst, LiftoffRegister src);
inline void emit_i32x4_splat(LiftoffRegister dst, LiftoffRegister src); inline void emit_i32x4_splat(LiftoffRegister dst, LiftoffRegister src);
inline void emit_i16x8_splat(LiftoffRegister dst, LiftoffRegister src);
inline void StackCheck(Label* ool_code, Register limit_address); inline void StackCheck(Label* ool_code, Register limit_address);
......
...@@ -2223,6 +2223,12 @@ class LiftoffCompiler { ...@@ -2223,6 +2223,12 @@ class LiftoffCompiler {
__ emit_i32x4_splat(dst, src); __ emit_i32x4_splat(dst, src);
}); });
break; break;
case wasm::kExprI16x8Splat:
EmitUnOp<kWasmI32, kWasmS128>(
[=](LiftoffRegister dst, LiftoffRegister src) {
__ emit_i16x8_splat(dst, src);
});
break;
default: default:
unsupported(decoder, kSimd, "simd"); unsupported(decoder, kSimd, "simd");
} }
......
...@@ -1786,6 +1786,13 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst, ...@@ -1786,6 +1786,13 @@ void LiftoffAssembler::emit_i32x4_splat(LiftoffRegister dst,
Pshufd(dst.fp(), dst.fp(), static_cast<uint8_t>(0)); Pshufd(dst.fp(), dst.fp(), static_cast<uint8_t>(0));
} }
void LiftoffAssembler::emit_i16x8_splat(LiftoffRegister dst,
LiftoffRegister src) {
Movd(dst.fp(), src.gp());
Pshuflw(dst.fp(), dst.fp(), static_cast<uint8_t>(0));
Pshufd(dst.fp(), dst.fp(), static_cast<uint8_t>(0));
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) { void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
cmpq(rsp, Operand(limit_address, 0)); cmpq(rsp, Operand(limit_address, 0));
j(below_equal, ool_code); j(below_equal, ool_code);
......
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