Commit 270a284f authored by bbudge's avatar bbudge Committed by Commit bot

Turbofan: Rename IsFloat -> IsFP

Rename some methods to reflect the fact that there are multiple FP
machine representations.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2013193002
Cr-Commit-Position: refs/heads/master@{#36552}
parent 5e8f8d4e
...@@ -1106,7 +1106,7 @@ void InstructionSelector::EmitPrepareArguments( ...@@ -1106,7 +1106,7 @@ void InstructionSelector::EmitPrepareArguments(
g.CanBeImmediate(input.node()) g.CanBeImmediate(input.node())
? g.UseImmediate(input.node()) ? g.UseImmediate(input.node())
: IsSupported(ATOM) || : IsSupported(ATOM) ||
sequence()->IsFloat(GetVirtualRegister(input.node())) sequence()->IsFP(GetVirtualRegister(input.node()))
? g.UseRegister(input.node()) ? g.UseRegister(input.node())
: g.Use(input.node()); : g.Use(input.node());
if (input.type() == MachineType::Float32()) { if (input.type() == MachineType::Float32()) {
......
...@@ -1323,9 +1323,17 @@ class InstructionSequence final : public ZoneObject { ...@@ -1323,9 +1323,17 @@ class InstructionSequence final : public ZoneObject {
return GetRepresentation(virtual_register) == return GetRepresentation(virtual_register) ==
MachineRepresentation::kTagged; MachineRepresentation::kTagged;
} }
bool IsFloat(int virtual_register) const { bool IsFP(int virtual_register) const {
return IsFloatingPoint(GetRepresentation(virtual_register)); return IsFloatingPoint(GetRepresentation(virtual_register));
} }
bool IsFloat(int virtual_register) const {
return GetRepresentation(virtual_register) ==
MachineRepresentation::kFloat32;
}
bool IsDouble(int virtual_register) const {
return GetRepresentation(virtual_register) ==
MachineRepresentation::kFloat64;
}
Instruction* GetBlockStart(RpoNumber rpo) const; Instruction* GetBlockStart(RpoNumber rpo) const;
......
...@@ -160,13 +160,13 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op, ...@@ -160,13 +160,13 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
int vreg = unallocated->virtual_register(); int vreg = unallocated->virtual_register();
constraint->virtual_register_ = vreg; constraint->virtual_register_ = vreg;
if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) { if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) {
constraint->type_ = sequence()->IsFloat(vreg) ? kDoubleSlot : kSlot; constraint->type_ = sequence()->IsFP(vreg) ? kDoubleSlot : kSlot;
constraint->value_ = unallocated->fixed_slot_index(); constraint->value_ = unallocated->fixed_slot_index();
} else { } else {
switch (unallocated->extended_policy()) { switch (unallocated->extended_policy()) {
case UnallocatedOperand::ANY: case UnallocatedOperand::ANY:
case UnallocatedOperand::NONE: case UnallocatedOperand::NONE:
if (sequence()->IsFloat(vreg)) { if (sequence()->IsFP(vreg)) {
constraint->type_ = kNoneDouble; constraint->type_ = kNoneDouble;
} else { } else {
constraint->type_ = kNone; constraint->type_ = kNone;
...@@ -186,14 +186,14 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op, ...@@ -186,14 +186,14 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
constraint->value_ = unallocated->fixed_register_index(); constraint->value_ = unallocated->fixed_register_index();
break; break;
case UnallocatedOperand::MUST_HAVE_REGISTER: case UnallocatedOperand::MUST_HAVE_REGISTER:
if (sequence()->IsFloat(vreg)) { if (sequence()->IsFP(vreg)) {
constraint->type_ = kDoubleRegister; constraint->type_ = kDoubleRegister;
} else { } else {
constraint->type_ = kRegister; constraint->type_ = kRegister;
} }
break; break;
case UnallocatedOperand::MUST_HAVE_SLOT: case UnallocatedOperand::MUST_HAVE_SLOT:
constraint->type_ = sequence()->IsFloat(vreg) ? kDoubleSlot : kSlot; constraint->type_ = sequence()->IsFP(vreg) ? kDoubleSlot : kSlot;
break; break;
case UnallocatedOperand::SAME_AS_FIRST_INPUT: case UnallocatedOperand::SAME_AS_FIRST_INPUT:
constraint->type_ = kSameAsFirst; constraint->type_ = kSameAsFirst;
......
...@@ -1440,7 +1440,7 @@ void InstructionSelector::EmitPrepareArguments( ...@@ -1440,7 +1440,7 @@ void InstructionSelector::EmitPrepareArguments(
g.CanBeImmediate(input.node()) g.CanBeImmediate(input.node())
? g.UseImmediate(input.node()) ? g.UseImmediate(input.node())
: IsSupported(ATOM) || : IsSupported(ATOM) ||
sequence()->IsFloat(GetVirtualRegister(input.node())) sequence()->IsFP(GetVirtualRegister(input.node()))
? g.UseRegister(input.node()) ? g.UseRegister(input.node())
: g.Use(input.node()); : g.Use(input.node());
Emit(kX64Push, g.NoOutput(), value); Emit(kX64Push, g.NoOutput(), value);
......
...@@ -1121,7 +1121,7 @@ void InstructionSelector::EmitPrepareArguments( ...@@ -1121,7 +1121,7 @@ void InstructionSelector::EmitPrepareArguments(
g.CanBeImmediate(input.node()) g.CanBeImmediate(input.node())
? g.UseImmediate(input.node()) ? g.UseImmediate(input.node())
: IsSupported(ATOM) || : IsSupported(ATOM) ||
sequence()->IsFloat(GetVirtualRegister(input.node())) sequence()->IsFP(GetVirtualRegister(input.node()))
? g.UseRegister(input.node()) ? g.UseRegister(input.node())
: g.Use(input.node()); : g.Use(input.node());
Emit(kX87Push, g.NoOutput(), value); Emit(kX87Push, g.NoOutput(), value);
......
...@@ -94,12 +94,12 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build( ...@@ -94,12 +94,12 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
} }
for (auto i : s.virtual_registers_) { for (auto i : s.virtual_registers_) {
int const virtual_register = i.second; int const virtual_register = i.second;
if (sequence.IsFloat(virtual_register)) { if (sequence.IsFP(virtual_register)) {
EXPECT_FALSE(sequence.IsReference(virtual_register)); EXPECT_FALSE(sequence.IsReference(virtual_register));
s.doubles_.insert(virtual_register); s.doubles_.insert(virtual_register);
} }
if (sequence.IsReference(virtual_register)) { if (sequence.IsReference(virtual_register)) {
EXPECT_FALSE(sequence.IsFloat(virtual_register)); EXPECT_FALSE(sequence.IsFP(virtual_register));
s.references_.insert(virtual_register); s.references_.insert(virtual_register);
} }
} }
......
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