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

Unified Diff: src/compiler/instruction.h

Issue 1693963004: Add a kSimd128 machine type for Turbofan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 10 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/instruction-selector-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 4d48101cc4e955281bb5c1dd53920105c7e35227..9c978cee7c37543a40f791d14a730b6879c2edd2 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -67,8 +67,10 @@ class InstructionOperand {
inline bool IsAnyRegister() const;
inline bool IsRegister() const;
inline bool IsDoubleRegister() const;
+ inline bool IsSimd128Register() const;
inline bool IsStackSlot() const;
inline bool IsDoubleStackSlot() const;
+ inline bool IsSimd128StackSlot() const;
template <typename SubKindOperand>
static SubKindOperand* New(Zone* zone, const SubKindOperand& op) {
@@ -411,7 +413,7 @@ class LocationOperand : public InstructionOperand {
}
int index() const {
- DCHECK(IsStackSlot() || IsDoubleStackSlot());
+ DCHECK(IsStackSlot() || IsDoubleStackSlot() || IsSimd128StackSlot());
return static_cast<int64_t>(value_) >> IndexField::kShift;
}
@@ -427,6 +429,12 @@ class LocationOperand : public InstructionOperand {
IndexField::kShift);
}
+ Simd128Register GetSimd128Register() const {
+ DCHECK(IsSimd128Register());
+ return Simd128Register::from_code(static_cast<int64_t>(value_) >>
+ IndexField::kShift);
+ }
+
LocationKind location_kind() const {
return LocationKindField::decode(value_);
}
@@ -441,6 +449,7 @@ class LocationOperand : public InstructionOperand {
case MachineRepresentation::kWord64:
case MachineRepresentation::kFloat32:
case MachineRepresentation::kFloat64:
+ case MachineRepresentation::kSimd128:
case MachineRepresentation::kTagged:
return true;
case MachineRepresentation::kBit:
@@ -522,6 +531,12 @@ bool InstructionOperand::IsDoubleRegister() const {
IsFloatingPoint(LocationOperand::cast(this)->representation());
}
+bool InstructionOperand::IsSimd128Register() const {
+ return IsAnyRegister() &&
+ LocationOperand::cast(this)->representation() ==
+ MachineRepresentation::kSimd128;
+}
+
bool InstructionOperand::IsStackSlot() const {
return (IsAllocated() || IsExplicit()) &&
LocationOperand::cast(this)->location_kind() ==
@@ -536,6 +551,14 @@ bool InstructionOperand::IsDoubleStackSlot() const {
IsFloatingPoint(LocationOperand::cast(this)->representation());
}
+bool InstructionOperand::IsSimd128StackSlot() const {
+ return (IsAllocated() || IsExplicit()) &&
+ LocationOperand::cast(this)->location_kind() ==
+ LocationOperand::STACK_SLOT &&
+ LocationOperand::cast(this)->representation() ==
+ MachineRepresentation::kSimd128;
+}
+
uint64_t InstructionOperand::GetCanonicalizedValue() const {
if (IsAllocated() || IsExplicit()) {
// TODO(dcarney): put machine type last and mask.
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698