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

[wasm-relaxed-simd] Add relaxed trunc opcodes in Liftoff on ia32+x64

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

Bug: v8:12284
Change-Id: Id003edadabb061aff074ad69602caf9322bda07e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3667085Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80813}
parent eb40c67d
......@@ -2469,6 +2469,26 @@ void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
emit_i8x16_swizzle(dst, lhs, rhs);
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f32x4_s");
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f32x4_u");
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_s_zero(
LiftoffRegister dst, LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f64x2_s_zero");
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_u_zero(
LiftoffRegister dst, LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f64x2_u_zero");
}
void LiftoffAssembler::emit_s128_relaxed_laneselect(LiftoffRegister dst,
LiftoffRegister src1,
LiftoffRegister src2,
......
......@@ -1781,6 +1781,26 @@ void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
Tbl(dst.fp().V16B(), lhs.fp().V16B(), rhs.fp().V16B());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f32x4_s");
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f32x4_u");
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_s_zero(
LiftoffRegister dst, LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f64x2_s_zero");
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_u_zero(
LiftoffRegister dst, LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_relaxed_trunc_f64x2_u_zero");
}
void LiftoffAssembler::emit_s128_relaxed_laneselect(LiftoffRegister dst,
LiftoffRegister src1,
LiftoffRegister src2,
......
......@@ -2915,6 +2915,26 @@ void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
true);
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
Cvttps2dq(dst.fp(), src.fp());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
emit_i32x4_uconvert_f32x4(dst, src);
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_s_zero(
LiftoffRegister dst, LiftoffRegister src) {
Cvttpd2dq(dst.fp(), src.fp());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_u_zero(
LiftoffRegister dst, LiftoffRegister src) {
emit_i32x4_trunc_sat_f64x2_u_zero(dst, src);
}
void LiftoffAssembler::emit_s128_relaxed_laneselect(LiftoffRegister dst,
LiftoffRegister src1,
LiftoffRegister src2,
......
......@@ -1075,6 +1075,14 @@ class LiftoffAssembler : public TurboAssembler {
inline void emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs);
inline void emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,
LiftoffRegister src);
inline void emit_i32x4_relaxed_trunc_f32x4_u(LiftoffRegister dst,
LiftoffRegister src);
inline void emit_i32x4_relaxed_trunc_f64x2_s_zero(LiftoffRegister dst,
LiftoffRegister src);
inline void emit_i32x4_relaxed_trunc_f64x2_u_zero(LiftoffRegister dst,
LiftoffRegister src);
inline void emit_s128_relaxed_laneselect(LiftoffRegister dst,
LiftoffRegister src1,
LiftoffRegister src2,
......
......@@ -4090,6 +4090,18 @@ class LiftoffCompiler {
case wasm::kExprI16x8RelaxedQ15MulRS:
return EmitBinOp<kS128, kS128>(
&LiftoffAssembler::emit_i16x8_relaxed_q15mulr_s);
case wasm::kExprI32x4RelaxedTruncF32x4S:
return EmitUnOp<kS128, kS128>(
&LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s);
case wasm::kExprI32x4RelaxedTruncF32x4U:
return EmitUnOp<kS128, kS128>(
&LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_u);
case wasm::kExprI32x4RelaxedTruncF64x2SZero:
return EmitUnOp<kS128, kS128>(
&LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_s_zero);
case wasm::kExprI32x4RelaxedTruncF64x2UZero:
return EmitUnOp<kS128, kS128>(
&LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_u_zero);
default:
unsupported(decoder, kSimd, "simd");
}
......
......@@ -2518,6 +2518,26 @@ void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst,
kScratchRegister, true);
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
Cvttps2dq(dst.fp(), src.fp());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
emit_i32x4_uconvert_f32x4(dst, src);
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_s_zero(
LiftoffRegister dst, LiftoffRegister src) {
Cvttpd2dq(dst.fp(), src.fp());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_u_zero(
LiftoffRegister dst, LiftoffRegister src) {
emit_i32x4_trunc_sat_f64x2_u_zero(dst, src);
}
void LiftoffAssembler::emit_s128_relaxed_laneselect(LiftoffRegister dst,
LiftoffRegister src1,
LiftoffRegister src2,
......
......@@ -137,12 +137,6 @@
'test-swiss-name-dictionary-csa/SameH2': [PASS, HEAVY],
'test-intl/StringLocaleCompareFastPath': [['mode != release', SKIP], SLOW, NO_VARIANTS],
# TODO(12284): Implement relaxed SIMD in Liftoff.
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF32x4S_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF32x4U_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF64x2SZero_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF64x2UZero_liftoff': [SKIP],
}], # ALWAYS
##############################################################################
......@@ -1185,6 +1179,10 @@
'test-run-wasm-relaxed-simd/RunWasm_F32x4Qfms_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_I32x4RelaxedTruncF32x4S_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF32x4U_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF64x2SZero_liftoff': [SKIP],
'test-run-wasm-relaxed-simd/RunWasm_I32x4RelaxedTruncF64x2UZero_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