Index: runtime/vm/locations.h |
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h |
index 6a8dda865d28d5cbf8c299964ae3177304306690..9a2884831a6145b2ca49121cb5a59fa23997c5d3 100644 |
--- a/runtime/vm/locations.h |
+++ b/runtime/vm/locations.h |
@@ -27,7 +27,7 @@ class Location : public ValueObject { |
private: |
enum { |
// Number of bits required to encode Kind value. |
- kBitsForKind = 3, |
+ kBitsForKind = 4, |
kBitsForPayload = kWordSize * kBitsPerByte - kBitsForKind, |
}; |
@@ -58,6 +58,8 @@ class Location : public ValueObject { |
// a spill index. |
kStackSlot = 3, |
kDoubleStackSlot = 4, |
+ kFloat32x4StackSlot = 8, |
+ kUint32x4StackSlot = 9, |
Vyacheslav Egorov (Google)
2013/03/17 18:17:10
It can't be 9 (see the comment above enum Kind).
Cutch
2013/03/17 21:52:37
Done.
|
// Register location represents a fixed register. Payload contains |
// register code. |
@@ -176,15 +178,18 @@ class Location : public ValueObject { |
return RegisterField::decode(payload()); |
} |
- // FPU registers and double spill slots can contain either doubles |
- // or 64-bit integers. |
+ // FPU registers and double spill slots can contain either doubles, |
+ // 64-bit integers, Float32x4, or Uint32x4 values. |
enum Representation { |
kDouble, |
- kMint |
+ kMint, |
+ kFloat32x4, |
+ kUint32x4 |
}; |
Representation representation() const { |
- ASSERT(IsFpuRegister() || IsDoubleStackSlot()); |
+ ASSERT(IsFpuRegister() ||IsDoubleStackSlot() || IsFloat32x4StackSlot() || |
+ IsUint32x4StackSlot()); |
return RepresentationField::decode(payload()); |
} |
@@ -262,9 +267,42 @@ class Location : public ValueObject { |
return kind() == kDoubleStackSlot; |
} |
+ static Location Float32x4StackSlot(intptr_t stack_index, Representation rep) { |
+ ASSERT((-kStackIndexBias <= stack_index) && |
+ (stack_index < kStackIndexBias)); |
+ uword payload = |
+ IndexField::encode(static_cast<uword>(kStackIndexBias + stack_index)) |
Vyacheslav Egorov (Google)
2013/03/17 18:17:10
encoding of stack indexes repeats multiple times.
Cutch
2013/03/17 21:52:37
Done.
|
+ | RepresentationField::encode(rep); |
+ Location loc(kFloat32x4StackSlot, payload); |
+ // Ensure that sign is preserved. |
+ ASSERT(loc.stack_index() == stack_index); |
+ return loc; |
+ } |
+ |
+ bool IsFloat32x4StackSlot() const { |
+ return kind() == kFloat32x4StackSlot; |
+ } |
+ |
+ static Location Uint32x4StackSlot(intptr_t stack_index, Representation rep) { |
+ ASSERT((-kStackIndexBias <= stack_index) && |
+ (stack_index < kStackIndexBias)); |
+ uword payload = |
+ IndexField::encode(static_cast<uword>(kStackIndexBias + stack_index)) |
+ | RepresentationField::encode(rep); |
+ Location loc(kUint32x4StackSlot, payload); |
+ // Ensure that sign is preserved. |
+ ASSERT(loc.stack_index() == stack_index); |
+ return loc; |
+ } |
+ |
+ bool IsUint32x4StackSlot() const { |
+ return kind() == kUint32x4StackSlot; |
+ } |
+ |
intptr_t stack_index() const { |
- ASSERT(IsStackSlot() || IsDoubleStackSlot()); |
+ ASSERT(IsStackSlot() || IsDoubleStackSlot() || IsFloat32x4StackSlot() || |
+ IsUint32x4StackSlot()); |
// Decode stack index manually to preserve sign. |
return IndexField::decode(payload()) - kStackIndexBias; |
} |
@@ -312,7 +350,7 @@ class Location : public ValueObject { |
// Layout for register locations payload. The representation bit is only used |
// for FpuRegister and unused for Register. |
- static const intptr_t kBitsForRepresentation = 1; |
+ static const intptr_t kBitsForRepresentation = 2; |
static const intptr_t kBitsForRegister = |
kBitsForPayload - kBitsForRepresentation; |
typedef BitField<Representation, |