Commit c00de386 authored by michael_dawson's avatar michael_dawson Committed by Commit bot

PPC: [turbofan] Add new Float32Abs and Float64Abs operators.

Port 9af9f1d0

Original commit message:
These operators compute the absolute floating point value of some
arbitrary input, and are implemented without any branches (i.e. using
vabs on arm, and andps/andpd on x86).

R=mbrandy@us.ibm.com

BUG=

Review URL: https://codereview.chromium.org/1072963002

Cr-Commit-Position: refs/heads/master@{#27727}
parent 5110b400
......@@ -857,6 +857,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kPPC_MinDouble:
ASSEMBLE_FLOAT_MIN(kScratchDoubleReg);
break;
case kPPC_AbsDouble:
ASSEMBLE_FLOAT_UNOP_RC(fabs);
break;
case kPPC_SqrtDouble:
ASSEMBLE_FLOAT_UNOP_RC(fsqrt);
break;
......
......@@ -60,6 +60,7 @@ namespace compiler {
V(PPC_RoundDouble) \
V(PPC_MaxDouble) \
V(PPC_MinDouble) \
V(PPC_AbsDouble) \
V(PPC_Cntlz32) \
V(PPC_Cmp32) \
V(PPC_Cmp64) \
......
......@@ -995,10 +995,14 @@ void InstructionSelector::VisitFloat64Min(Node* node) {
}
void InstructionSelector::VisitFloat32Abs(Node* node) { UNREACHABLE(); }
void InstructionSelector::VisitFloat32Abs(Node* node) {
VisitRR(this, kPPC_AbsDouble, node);
}
void InstructionSelector::VisitFloat64Abs(Node* node) { UNREACHABLE(); }
void InstructionSelector::VisitFloat64Abs(Node* node) {
VisitRR(this, kPPC_AbsDouble, node);
}
void InstructionSelector::VisitFloat32Sqrt(Node* node) {
......@@ -1536,8 +1540,10 @@ void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
return MachineOperatorBuilder::kFloat32Max |
return MachineOperatorBuilder::kFloat32Abs |
MachineOperatorBuilder::kFloat32Max |
MachineOperatorBuilder::kFloat32Min |
MachineOperatorBuilder::kFloat64Abs |
MachineOperatorBuilder::kFloat64Max |
MachineOperatorBuilder::kFloat64Min |
MachineOperatorBuilder::kFloat64RoundDown |
......
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