PPC: [turbofan] Add new Float32Abs and Float64Abs operators.
Port 9af9f1d026
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}
This commit is contained in:
parent
5110b400bf
commit
c00de38657
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user