Commit ae946466 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by V8 LUCI CQ

[wasm-relaxed-simd] Add relaxed swizzle in Liftoff on ia32/x64

R=clemensb@chromium.org
CC=gdeepti@chromium.org

Bug: v8:12284
Change-Id: Idddb0b7648b29612fa0308520ca2fc2a3e5647f9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3593218Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80055}
parent fac04fbb
...@@ -2460,6 +2460,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -2460,6 +2460,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
vtbl(dst.high_fp(), table, rhs.high_fp()); vtbl(dst.high_fp(), table, rhs.high_fp());
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst, void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
TurboAssembler::Move(dst.low_fp(), src.fp()); TurboAssembler::Move(dst.low_fp(), src.fp());
......
...@@ -1775,6 +1775,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -1775,6 +1775,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
Tbl(dst.fp().V16B(), lhs.fp().V16B(), rhs.fp().V16B()); Tbl(dst.fp().V16B(), lhs.fp().V16B(), rhs.fp().V16B());
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst, void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
Dup(dst.fp().V2D(), src.fp().D(), 0); Dup(dst.fp().V2D(), src.fp().D(), 0);
......
...@@ -2907,6 +2907,14 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -2907,6 +2907,14 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
scratch); scratch);
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
Register tmp = GetUnusedRegister(RegClass::kGpReg, {}).gp();
I8x16Swizzle(dst.fp(), lhs.fp(), rhs.fp(), liftoff::kScratchDoubleReg, tmp,
true);
}
void LiftoffAssembler::emit_i8x16_popcnt(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_popcnt(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
Register scratch = GetUnusedRegister(RegClass::kGpReg, {}).gp(); Register scratch = GetUnusedRegister(RegClass::kGpReg, {}).gp();
......
...@@ -1051,6 +1051,9 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -1051,6 +1051,9 @@ class LiftoffAssembler : public TurboAssembler {
bool is_swizzle); bool is_swizzle);
inline void emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs, inline void emit_i8x16_swizzle(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs); LiftoffRegister rhs);
inline void emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs);
inline void emit_i8x16_popcnt(LiftoffRegister dst, LiftoffRegister src); inline void emit_i8x16_popcnt(LiftoffRegister dst, LiftoffRegister src);
inline void emit_i8x16_splat(LiftoffRegister dst, LiftoffRegister src); inline void emit_i8x16_splat(LiftoffRegister dst, LiftoffRegister src);
inline void emit_i16x8_splat(LiftoffRegister dst, LiftoffRegister src); inline void emit_i16x8_splat(LiftoffRegister dst, LiftoffRegister src);
......
...@@ -3523,6 +3523,9 @@ class LiftoffCompiler { ...@@ -3523,6 +3523,9 @@ class LiftoffCompiler {
switch (opcode) { switch (opcode) {
case wasm::kExprI8x16Swizzle: case wasm::kExprI8x16Swizzle:
return EmitBinOp<kS128, kS128>(&LiftoffAssembler::emit_i8x16_swizzle); return EmitBinOp<kS128, kS128>(&LiftoffAssembler::emit_i8x16_swizzle);
case wasm::kExprI8x16RelaxedSwizzle:
return EmitBinOp<kS128, kS128>(
&LiftoffAssembler::emit_i8x16_relaxed_swizzle);
case wasm::kExprI8x16Popcnt: case wasm::kExprI8x16Popcnt:
return EmitUnOp<kS128, kS128>(&LiftoffAssembler::emit_i8x16_popcnt); return EmitUnOp<kS128, kS128>(&LiftoffAssembler::emit_i8x16_popcnt);
case wasm::kExprI8x16Splat: case wasm::kExprI8x16Splat:
......
...@@ -1815,6 +1815,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -1815,6 +1815,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
bailout(kSimd, "emit_i8x16_swizzle"); bailout(kSimd, "emit_i8x16_swizzle");
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_i8x16_splat"); bailout(kSimd, "emit_i8x16_splat");
......
...@@ -1834,6 +1834,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -1834,6 +1834,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
bailout(kSimd, "emit_i8x16_swizzle"); bailout(kSimd, "emit_i8x16_swizzle");
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_i8x16_splat"); bailout(kSimd, "emit_i8x16_splat");
......
...@@ -2149,6 +2149,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -2149,6 +2149,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
vshf_b(dst_msa, kSimd128RegZero, lhs_msa); vshf_b(dst_msa, kSimd128RegZero, lhs_msa);
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
fill_b(dst.fp().toW(), src.gp()); fill_b(dst.fp().toW(), src.gp());
......
...@@ -1769,6 +1769,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -1769,6 +1769,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
bailout(kUnsupportedArchitecture, "emit_i8x16_swizzle"); bailout(kUnsupportedArchitecture, "emit_i8x16_swizzle");
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst, void LiftoffAssembler::emit_f64x2_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kUnsupportedArchitecture, "emit_f64x2splat"); bailout(kUnsupportedArchitecture, "emit_f64x2splat");
......
...@@ -1937,6 +1937,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -1937,6 +1937,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
} }
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
VU.set(kScratchReg, E8, m1); VU.set(kScratchReg, E8, m1);
......
...@@ -2725,6 +2725,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -2725,6 +2725,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
I8x16Swizzle(dest, src1, src2, r0, r1, kScratchDoubleReg, temp); I8x16Swizzle(dest, src1, src2, r0, r1, kScratchDoubleReg, temp);
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_relaxed_swizzle");
}
void LiftoffAssembler::emit_f64x2_convert_low_i32x4_s(LiftoffRegister dst, void LiftoffAssembler::emit_f64x2_convert_low_i32x4_s(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
F64x2ConvertLowI32x4S(dst.fp(), src.fp()); F64x2ConvertLowI32x4S(dst.fp(), src.fp());
......
...@@ -2511,6 +2511,13 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, ...@@ -2511,6 +2511,13 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst,
kScratchRegister); kScratchRegister);
} }
void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
I8x16Swizzle(dst.fp(), lhs.fp(), rhs.fp(), kScratchDoubleReg,
kScratchRegister, true);
}
void LiftoffAssembler::emit_i8x16_popcnt(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_popcnt(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
I8x16Popcnt(dst.fp(), src.fp(), kScratchDoubleReg, I8x16Popcnt(dst.fp(), src.fp(), kScratchDoubleReg,
......
...@@ -140,7 +140,6 @@ ...@@ -140,7 +140,6 @@
'test-intl/StringLocaleCompareFastPath': [['mode != release', SKIP], SLOW, NO_VARIANTS], 'test-intl/StringLocaleCompareFastPath': [['mode != release', SKIP], SLOW, NO_VARIANTS],
# TODO(12284): Implement relaxed SIMD in Liftoff. # TODO(12284): Implement relaxed SIMD in Liftoff.
'test-run-wasm-relaxed-simd/RunWasm_I8x16RelaxedSwizzle_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I8x16RelaxedLaneSelect_liftoff': [SKIP], 'test-run-wasm-relaxed-simd/RunWasm_I8x16RelaxedLaneSelect_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I16x8RelaxedLaneSelect_liftoff': [SKIP], 'test-run-wasm-relaxed-simd/RunWasm_I16x8RelaxedLaneSelect_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedLaneSelect_liftoff': [SKIP], 'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedLaneSelect_liftoff': [SKIP],
...@@ -1251,6 +1250,7 @@ ...@@ -1251,6 +1250,7 @@
'test-run-wasm-relaxed-simd/RunWasm_F32x4Qfms_liftoff': [SKIP], 'test-run-wasm-relaxed-simd/RunWasm_F32x4Qfms_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_F64x2Qfma_liftoff': [SKIP], 'test-run-wasm-relaxed-simd/RunWasm_F64x2Qfma_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_F64x2Qfms_liftoff': [SKIP], 'test-run-wasm-relaxed-simd/RunWasm_F64x2Qfms_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I8x16RelaxedSwizzle_liftoff': [SKIP],
}] }]
] ]
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