| Index: runtime/vm/locations.h
|
| diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
|
| index 6a8dda865d28d5cbf8c299964ae3177304306690..a774e61490891234a21e39a2f1f4e9dd3244889d 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 = 10,
|
|
|
| // 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());
|
| }
|
|
|
| @@ -228,14 +233,19 @@ class Location : public ValueObject {
|
| return static_cast<intptr_t>(RegisterField::decode(payload()));
|
| }
|
|
|
| + static uword make_stack_index_payload(intptr_t stack_index,
|
| + Representation rep) {
|
| + ASSERT((-kStackIndexBias <= stack_index) &&
|
| + (stack_index < kStackIndexBias));
|
| + uword payload =
|
| + IndexField::encode(static_cast<uword>(kStackIndexBias + stack_index));
|
| + return payload | RepresentationField::encode(rep);
|
| + }
|
| +
|
| // Spill slots.
|
| static Location StackSlot(intptr_t stack_index,
|
| Representation rep = kDouble) {
|
| - ASSERT((-kStackIndexBias <= stack_index) &&
|
| - (stack_index < kStackIndexBias));
|
| - uword payload =
|
| - IndexField::encode(static_cast<uword>(kStackIndexBias + stack_index))
|
| - | RepresentationField::encode(rep);
|
| + uword payload = make_stack_index_payload(stack_index, rep);
|
| Location loc(kStackSlot, payload);
|
| // Ensure that sign is preserved.
|
| ASSERT(loc.stack_index() == stack_index);
|
| @@ -247,11 +257,7 @@ class Location : public ValueObject {
|
| }
|
|
|
| static Location DoubleStackSlot(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);
|
| + uword payload = make_stack_index_payload(stack_index, rep);
|
| Location loc(kDoubleStackSlot, payload);
|
| // Ensure that sign is preserved.
|
| ASSERT(loc.stack_index() == stack_index);
|
| @@ -262,9 +268,34 @@ class Location : public ValueObject {
|
| return kind() == kDoubleStackSlot;
|
| }
|
|
|
| + static Location Float32x4StackSlot(intptr_t stack_index, Representation rep) {
|
| + uword payload = make_stack_index_payload(stack_index, 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) {
|
| + uword payload = make_stack_index_payload(stack_index, 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 +343,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,
|
|
|