Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: src/compiler/instruction.h

Issue 1959763002: [turbofan] Rename floating point register / slot methods. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unfix arm64. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index 1c454d81ec083df24243075043317ececfc2617d..92cb84268350bbcb985659838e3f0124ec7f67f2 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -66,9 +66,13 @@ class InstructionOperand {
inline bool IsAnyRegister() const;
inline bool IsRegister() const;
+ inline bool IsFPRegister() const;
+ inline bool IsFloatRegister() const;
inline bool IsDoubleRegister() const;
inline bool IsSimd128Register() const;
inline bool IsStackSlot() const;
+ inline bool IsFPStackSlot() const;
+ inline bool IsFloatStackSlot() const;
inline bool IsDoubleStackSlot() const;
inline bool IsSimd128StackSlot() const;
@@ -413,7 +417,7 @@ class LocationOperand : public InstructionOperand {
}
int index() const {
- DCHECK(IsStackSlot() || IsDoubleStackSlot() || IsSimd128StackSlot());
+ DCHECK(IsStackSlot() || IsFPStackSlot());
return static_cast<int64_t>(value_) >> IndexField::kShift;
}
@@ -423,8 +427,16 @@ class LocationOperand : public InstructionOperand {
IndexField::kShift);
}
+ FloatRegister GetFloatRegister() const {
+ DCHECK(IsFloatRegister());
+ return FloatRegister::from_code(static_cast<int64_t>(value_) >>
+ IndexField::kShift);
+ }
+
DoubleRegister GetDoubleRegister() const {
- DCHECK(IsDoubleRegister());
+ // TODO(bbudge) Tighten this test to IsDoubleRegister when all code
+ // generators are changed to use the correct Get*Register method.
+ DCHECK(IsFPRegister());
return DoubleRegister::from_code(static_cast<int64_t>(value_) >>
IndexField::kShift);
}
@@ -526,11 +538,23 @@ bool InstructionOperand::IsRegister() const {
!IsFloatingPoint(LocationOperand::cast(this)->representation());
}
-bool InstructionOperand::IsDoubleRegister() const {
+bool InstructionOperand::IsFPRegister() const {
return IsAnyRegister() &&
IsFloatingPoint(LocationOperand::cast(this)->representation());
}
+bool InstructionOperand::IsFloatRegister() const {
+ return IsAnyRegister() &&
+ LocationOperand::cast(this)->representation() ==
+ MachineRepresentation::kFloat32;
+}
+
+bool InstructionOperand::IsDoubleRegister() const {
+ return IsAnyRegister() &&
+ LocationOperand::cast(this)->representation() ==
+ MachineRepresentation::kFloat64;
+}
+
bool InstructionOperand::IsSimd128Register() const {
return IsAnyRegister() &&
LocationOperand::cast(this)->representation() ==
@@ -544,13 +568,29 @@ bool InstructionOperand::IsStackSlot() const {
!IsFloatingPoint(LocationOperand::cast(this)->representation());
}
-bool InstructionOperand::IsDoubleStackSlot() const {
+bool InstructionOperand::IsFPStackSlot() const {
return (IsAllocated() || IsExplicit()) &&
LocationOperand::cast(this)->location_kind() ==
LocationOperand::STACK_SLOT &&
IsFloatingPoint(LocationOperand::cast(this)->representation());
}
+bool InstructionOperand::IsFloatStackSlot() const {
+ return (IsAllocated() || IsExplicit()) &&
+ LocationOperand::cast(this)->location_kind() ==
+ LocationOperand::STACK_SLOT &&
+ LocationOperand::cast(this)->representation() ==
+ MachineRepresentation::kFloat32;
+}
+
+bool InstructionOperand::IsDoubleStackSlot() const {
+ return (IsAllocated() || IsExplicit()) &&
+ LocationOperand::cast(this)->location_kind() ==
+ LocationOperand::STACK_SLOT &&
+ LocationOperand::cast(this)->representation() ==
+ MachineRepresentation::kFloat64;
+}
+
bool InstructionOperand::IsSimd128StackSlot() const {
return (IsAllocated() || IsExplicit()) &&
LocationOperand::cast(this)->location_kind() ==
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698