Commit 1effec7b authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

s390x: Clean up Double/FloatMin/Max

Change-Id: I358d4e811f47cb0975c488fc6c9c0c57648fe42e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2836325Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74046}
parent bf74af74
......@@ -41,6 +41,12 @@ namespace internal {
void TurboAssembler::DoubleMax(DoubleRegister result_reg,
DoubleRegister left_reg,
DoubleRegister right_reg) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmax(result_reg, left_reg, right_reg, Condition(1), Condition(8),
Condition(3));
return;
}
Label check_zero, return_left, return_right, return_nan, done;
cdbr(left_reg, right_reg);
bunordered(&return_nan, Label::kNear);
......@@ -81,6 +87,11 @@ void TurboAssembler::DoubleMax(DoubleRegister result_reg,
void TurboAssembler::DoubleMin(DoubleRegister result_reg,
DoubleRegister left_reg,
DoubleRegister right_reg) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmin(result_reg, left_reg, right_reg, Condition(1), Condition(8),
Condition(3));
return;
}
Label check_zero, return_left, return_right, return_nan, done;
cdbr(left_reg, right_reg);
bunordered(&return_nan, Label::kNear);
......@@ -127,6 +138,11 @@ void TurboAssembler::DoubleMin(DoubleRegister result_reg,
void TurboAssembler::FloatMax(DoubleRegister result_reg,
DoubleRegister left_reg,
DoubleRegister right_reg) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmax(result_reg, left_reg, right_reg, Condition(1), Condition(8),
Condition(2));
return;
}
Label check_zero, return_left, return_right, return_nan, done;
cebr(left_reg, right_reg);
bunordered(&return_nan, Label::kNear);
......@@ -167,6 +183,12 @@ void TurboAssembler::FloatMax(DoubleRegister result_reg,
void TurboAssembler::FloatMin(DoubleRegister result_reg,
DoubleRegister left_reg,
DoubleRegister right_reg) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmin(result_reg, left_reg, right_reg, Condition(1), Condition(8),
Condition(2));
return;
}
Label check_zero, return_left, return_right, return_nan, done;
cebr(left_reg, right_reg);
bunordered(&return_nan, Label::kNear);
......
......@@ -1538,19 +1538,11 @@ bool LiftoffAssembler::emit_f32_nearest_int(DoubleRegister dst,
void LiftoffAssembler::emit_f64_min(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmin(dst, lhs, rhs, Condition(1), Condition(8), Condition(3));
return;
}
DoubleMin(dst, lhs, rhs);
}
void LiftoffAssembler::emit_f32_min(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmin(dst, lhs, rhs, Condition(1), Condition(8), Condition(2));
return;
}
FloatMin(dst, lhs, rhs);
}
......@@ -1577,19 +1569,11 @@ bool LiftoffAssembler::emit_f64_nearest_int(DoubleRegister dst,
void LiftoffAssembler::emit_f64_max(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmax(dst, lhs, rhs, Condition(1), Condition(8), Condition(3));
return;
}
DoubleMax(dst, lhs, rhs);
}
void LiftoffAssembler::emit_f32_max(DoubleRegister dst, DoubleRegister lhs,
DoubleRegister rhs) {
if (CpuFeatures::IsSupported(VECTOR_ENHANCE_FACILITY_1)) {
vfmax(dst, lhs, rhs, Condition(1), Condition(8), Condition(2));
return;
}
FloatMax(dst, lhs, rhs);
}
......
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