Commit ef1d0a8a authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips][wasm-simd][liftoff] Implement pmin pmax

Port 863c2cb4
https://chromium-review.googlesource.com/c/v8/v8/+/2406593

Implement f32x4.pmin, f32x4.pmax, f64x2.pmin, and f64x2.pmax.

Change-Id: I102f8d80e72494f9dc48ae726a3eb272bcbe1661
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2411806Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#69909}
parent b14c4627
......@@ -2237,6 +2237,16 @@ void LiftoffAssembler::emit_f32x4_max(LiftoffRegister dst, LiftoffRegister lhs,
bailout(kSimd, "emit_f32x4_max");
}
void LiftoffAssembler::emit_f32x4_pmin(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_f32x4_pmin");
}
void LiftoffAssembler::emit_f32x4_pmax(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_f32x4_pmax");
}
void LiftoffAssembler::emit_f64x2_abs(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f64x2_abs");
......@@ -2282,6 +2292,16 @@ void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs,
bailout(kSimd, "emit_f64x2_max");
}
void LiftoffAssembler::emit_f64x2_pmin(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_f64x2_pmin");
}
void LiftoffAssembler::emit_f64x2_pmax(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_f64x2_pmax");
}
void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_sconvert_f32x4");
......
......@@ -2255,6 +2255,26 @@ void LiftoffAssembler::emit_f32x4_max(LiftoffRegister dst, LiftoffRegister lhs,
bsel_v(dst_msa, scratch0, scratch1);
}
void LiftoffAssembler::emit_f32x4_pmin(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
MSARegister dst_msa = dst.fp().toW();
MSARegister lhs_msa = lhs.fp().toW();
MSARegister rhs_msa = rhs.fp().toW();
// dst = rhs < lhs ? rhs : lhs
fclt_w(dst_msa, rhs_msa, lhs_msa);
bsel_v(dst_msa, lhs_msa, rhs_msa);
}
void LiftoffAssembler::emit_f32x4_pmax(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
MSARegister dst_msa = dst.fp().toW();
MSARegister lhs_msa = lhs.fp().toW();
MSARegister rhs_msa = rhs.fp().toW();
// dst = lhs < rhs ? rhs : lhs
fclt_w(dst_msa, lhs_msa, rhs_msa);
bsel_v(dst_msa, lhs_msa, rhs_msa);
}
void LiftoffAssembler::emit_f64x2_abs(LiftoffRegister dst,
LiftoffRegister src) {
bclri_d(dst.fp().toW(), src.fp().toW(), 63);
......@@ -2330,6 +2350,26 @@ void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs,
bsel_v(dst_msa, scratch0, scratch1);
}
void LiftoffAssembler::emit_f64x2_pmin(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
MSARegister dst_msa = dst.fp().toW();
MSARegister lhs_msa = lhs.fp().toW();
MSARegister rhs_msa = rhs.fp().toW();
// dst = rhs < lhs ? rhs : lhs
fclt_d(dst_msa, rhs_msa, lhs_msa);
bsel_v(dst_msa, lhs_msa, rhs_msa);
}
void LiftoffAssembler::emit_f64x2_pmax(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
MSARegister dst_msa = dst.fp().toW();
MSARegister lhs_msa = lhs.fp().toW();
MSARegister rhs_msa = rhs.fp().toW();
// dst = lhs < rhs ? rhs : lhs
fclt_d(dst_msa, lhs_msa, rhs_msa);
bsel_v(dst_msa, lhs_msa, rhs_msa);
}
void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
ftrunc_s_w(dst.fp().toW(), src.fp().toW());
......
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