Commit 6eaa5193 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][liftoff][arm][arm64] Implement float min max

Bug: v8:9909
Change-Id: I22351c7532e58ccd085f5934d1c59e0108c97cea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2161390Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67339}
parent 28a15326
...@@ -1913,12 +1913,26 @@ void LiftoffAssembler::emit_f64x2_div(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1913,12 +1913,26 @@ void LiftoffAssembler::emit_f64x2_div(LiftoffRegister dst, LiftoffRegister lhs,
void LiftoffAssembler::emit_f64x2_min(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f64x2_min(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f64x2min"); Simd128Register dest = liftoff::GetSimd128Register(dst);
Simd128Register left = liftoff::GetSimd128Register(lhs);
Simd128Register right = liftoff::GetSimd128Register(rhs);
liftoff::EmitFloatMinOrMax(this, dest.low(), left.low(), right.low(),
liftoff::MinOrMax::kMin);
liftoff::EmitFloatMinOrMax(this, dest.high(), left.high(), right.high(),
liftoff::MinOrMax::kMin);
} }
void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f64x2max"); Simd128Register dest = liftoff::GetSimd128Register(dst);
Simd128Register left = liftoff::GetSimd128Register(lhs);
Simd128Register right = liftoff::GetSimd128Register(rhs);
liftoff::EmitFloatMinOrMax(this, dest.low(), left.low(), right.low(),
liftoff::MinOrMax::kMax);
liftoff::EmitFloatMinOrMax(this, dest.high(), left.high(), right.high(),
liftoff::MinOrMax::kMax);
} }
void LiftoffAssembler::emit_f32x4_splat(LiftoffRegister dst, void LiftoffAssembler::emit_f32x4_splat(LiftoffRegister dst,
...@@ -2006,12 +2020,14 @@ void LiftoffAssembler::emit_f32x4_div(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -2006,12 +2020,14 @@ void LiftoffAssembler::emit_f32x4_div(LiftoffRegister dst, LiftoffRegister lhs,
void LiftoffAssembler::emit_f32x4_min(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f32x4_min(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f32x4min"); vmin(liftoff::GetSimd128Register(dst), liftoff::GetSimd128Register(lhs),
liftoff::GetSimd128Register(rhs));
} }
void LiftoffAssembler::emit_f32x4_max(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f32x4_max(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f32x4max"); vmax(liftoff::GetSimd128Register(dst), liftoff::GetSimd128Register(lhs),
liftoff::GetSimd128Register(rhs));
} }
void LiftoffAssembler::emit_i64x2_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i64x2_splat(LiftoffRegister dst,
......
...@@ -1143,12 +1143,12 @@ void LiftoffAssembler::emit_f64x2_div(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1143,12 +1143,12 @@ void LiftoffAssembler::emit_f64x2_div(LiftoffRegister dst, LiftoffRegister lhs,
void LiftoffAssembler::emit_f64x2_min(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f64x2_min(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f64x2min"); Fmin(dst.fp().V2D(), lhs.fp().V2D(), rhs.fp().V2D());
} }
void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f64x2max"); Fmax(dst.fp().V2D(), lhs.fp().V2D(), rhs.fp().V2D());
} }
void LiftoffAssembler::emit_f32x4_splat(LiftoffRegister dst, void LiftoffAssembler::emit_f32x4_splat(LiftoffRegister dst,
...@@ -1209,12 +1209,12 @@ void LiftoffAssembler::emit_f32x4_div(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1209,12 +1209,12 @@ void LiftoffAssembler::emit_f32x4_div(LiftoffRegister dst, LiftoffRegister lhs,
void LiftoffAssembler::emit_f32x4_min(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f32x4_min(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f32x4min"); Fmin(dst.fp().V4S(), lhs.fp().V4S(), rhs.fp().V4S());
} }
void LiftoffAssembler::emit_f32x4_max(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f32x4_max(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "f32x4max"); Fmax(dst.fp().V4S(), lhs.fp().V4S(), rhs.fp().V4S());
} }
void LiftoffAssembler::emit_i64x2_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i64x2_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