Commit e0f4f0b8 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

S390: Implement Float/Double NearestInt

Flags are also updated under `instruction-selector` to include
these operations. Not having them was causing their Simd versions
to remain unused as well. V8 was just interpreting them at runtime.

Change-Id: I42677f7412859ad4759b70ba16667ec9d90505af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2994803Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75444}
parent 6f6bfe14
......@@ -1794,6 +1794,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ FloatMin(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
i.InputDoubleRegister(1));
break;
case kS390_FloatNearestInt:
__ NearestIntF32(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
case kS390_MinDouble:
__ DoubleMin(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
i.InputDoubleRegister(1));
......@@ -1814,6 +1817,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ fidbra(ROUND_TO_NEAREST_AWAY_FROM_0, i.OutputDoubleRegister(),
i.InputDoubleRegister(0));
break;
case kS390_DoubleNearestInt:
__ NearestIntF64(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
case kS390_NegFloat:
ASSEMBLE_UNARY_OP(D_DInstr(lcebr), nullInstr, nullInstr);
break;
......
......@@ -69,12 +69,14 @@ namespace compiler {
V(S390_FloorFloat) \
V(S390_CeilFloat) \
V(S390_TruncateFloat) \
V(S390_FloatNearestInt) \
V(S390_AbsFloat) \
V(S390_SqrtDouble) \
V(S390_FloorDouble) \
V(S390_CeilDouble) \
V(S390_TruncateDouble) \
V(S390_RoundDouble) \
V(S390_DoubleNearestInt) \
V(S390_MaxFloat) \
V(S390_MaxDouble) \
V(S390_MinFloat) \
......
......@@ -69,12 +69,14 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kS390_FloorFloat:
case kS390_CeilFloat:
case kS390_TruncateFloat:
case kS390_FloatNearestInt:
case kS390_AbsFloat:
case kS390_SqrtDouble:
case kS390_FloorDouble:
case kS390_CeilDouble:
case kS390_TruncateDouble:
case kS390_RoundDouble:
case kS390_DoubleNearestInt:
case kS390_MaxFloat:
case kS390_MaxDouble:
case kS390_MinFloat:
......
......@@ -1311,6 +1311,10 @@ static inline bool TryMatchDoubleConstructFromInsert(
null) \
V(Float64, Float64RoundTiesAway, kS390_RoundDouble, OperandMode::kNone, \
null) \
V(Float32, Float32RoundTiesEven, kS390_FloatNearestInt, OperandMode::kNone, \
null) \
V(Float64, Float64RoundTiesEven, kS390_DoubleNearestInt, OperandMode::kNone, \
null) \
V(Float32, Float32Neg, kS390_NegFloat, OperandMode::kNone, null) \
V(Float64, Float64Neg, kS390_NegDouble, OperandMode::kNone, null) \
/* TODO(john.yan): can use kAllowRM */ \
......@@ -1557,14 +1561,6 @@ void InstructionSelector::VisitFloat64Ieee754Binop(Node* node,
->MarkAsCall();
}
void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) {
UNREACHABLE();
}
void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
UNREACHABLE();
}
static bool CompareLogical(FlagsContinuation* cont) {
switch (cont->condition()) {
case kUnsignedLessThan:
......@@ -2875,6 +2871,8 @@ InstructionSelector::SupportedMachineOperatorFlags() {
MachineOperatorBuilder::kFloat64RoundUp |
MachineOperatorBuilder::kFloat32RoundTruncate |
MachineOperatorBuilder::kFloat64RoundTruncate |
MachineOperatorBuilder::kFloat32RoundTiesEven |
MachineOperatorBuilder::kFloat64RoundTiesEven |
MachineOperatorBuilder::kFloat64RoundTiesAway |
MachineOperatorBuilder::kWord32Popcnt |
MachineOperatorBuilder::kInt32AbsWithOverflow |
......
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