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. |