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

Unified Diff: runtime/vm/locations.h

Issue 12871015: SIMD plumbing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: s/materialize/Materialize Created 7 years, 9 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 | « runtime/vm/isolate.cc ('k') | runtime/vm/locations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/locations.h
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index 90e87804b8757553145ffde89419a9f41ee6085b..24d9fd93ce000be9b7853c51351a1a3781cb2021 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -21,6 +21,8 @@ enum Representation {
kUntagged,
kUnboxedDouble,
kUnboxedMint,
+ kUnboxedFloat32x4,
+ kUnboxedUint32x4,
kNumRepresentations
};
@@ -38,7 +40,7 @@ class Location : public ValueObject {
private:
enum {
// Number of bits required to encode Kind value.
- kBitsForKind = 3,
+ kBitsForKind = 4,
kBitsForPayload = kWordSize * kBitsPerByte - kBitsForKind,
};
@@ -69,6 +71,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.
@@ -187,6 +191,7 @@ class Location : public ValueObject {
return RegisterField::decode(payload());
}
+
Representation representation() const {
return RepresentationField::decode(payload());
}
@@ -231,14 +236,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 = kTagged) {
- 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);
@@ -250,11 +260,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);
@@ -265,9 +271,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;
}
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/locations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698