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

Unified Diff: runtime/vm/flow_graph_allocator.cc

Issue 13471013: Flow graph SIMD changes (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: runtime/vm/flow_graph_allocator.cc
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 5024030dd0841276574e642abcb4cbb196c21a15..6ba73e471080873cf2340cf7f6e317d01331a199 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -643,7 +643,9 @@ static Location::Kind RegisterKindFromPolicy(Location loc) {
static Location::Kind RegisterKindForResult(Instruction* instr) {
if ((instr->representation() == kUnboxedDouble) ||
- (instr->representation() == kUnboxedMint)) {
+ (instr->representation() == kUnboxedMint) ||
+ (instr->representation() == kUnboxedFloat32x4) ||
+ (instr->representation() == kUnboxedUint32x4)) {
return Location::kFpuRegister;
} else {
return Location::kRegister;
@@ -1596,15 +1598,26 @@ void FlowGraphAllocator::AllocateSpillSlotFor(LiveRange* range) {
if (register_kind_ == Location::kRegister) {
range->set_spill_slot(Location::StackSlot(idx));
} else {
- // Double spill slots are essentially one (x64) or two (ia32) normal
+ // FPU register spill slots are essentially two (x64) or four (ia32) normal
// word size spill slots. We use the index of the slot with the lowest
- // address as an index for the double spill slot. In terms of indexes
+ // address as an index for the FPU register spill slot. In terms of indexes
// this relation is inverted: so we have to take the highest index.
const intptr_t slot_idx =
- idx * kDoubleSpillSlotFactor + (kDoubleSpillSlotFactor - 1);
- range->set_spill_slot(
- Location::DoubleStackSlot(
- cpu_spill_slot_count_ + slot_idx, range->representation()));
+ idx * kFpuRegisterSpillFactor + (kFpuRegisterSpillFactor - 1);
+ Location location;
+ if (range->representation() == kUnboxedFloat32x4) {
+ location = Location::Float32x4StackSlot(cpu_spill_slot_count_ + slot_idx,
Vyacheslav Egorov (Google) 2013/04/03 14:25:45 moving this duplicated expression: cpu_spill_slot_
Cutch 2013/04/04 22:24:06 Done.
+ range->representation());
Vyacheslav Egorov (Google) 2013/04/03 14:25:45 I find it confusing that we still pass representat
Cutch 2013/04/04 22:24:06 Done.
+ } else if (range->representation() == kUnboxedUint32x4) {
+ location = Location::Uint32x4StackSlot(cpu_spill_slot_count_ + slot_idx,
+ range->representation());
+ } else {
+ ASSERT((range->representation() == kUnboxedDouble) ||
+ (range->representation() == kUnboxedMint));
+ location = Location::DoubleStackSlot(cpu_spill_slot_count_ + slot_idx,
+ range->representation());
+ }
+ range->set_spill_slot(location);
}
spilled_.Add(range);
@@ -2523,7 +2536,7 @@ void FlowGraphAllocator::AllocateRegisters() {
GraphEntryInstr* entry = block_order_[0]->AsGraphEntry();
ASSERT(entry != NULL);
intptr_t double_spill_slot_count =
- spill_slots_.length() * kDoubleSpillSlotFactor;
+ spill_slots_.length() * kFpuRegisterSpillFactor;
entry->set_spill_slot_count(cpu_spill_slot_count_ + double_spill_slot_count);
if (FLAG_print_ssa_liveranges) {

Powered by Google App Engine
This is Rietveld 408576698