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

Unified Diff: src/crankshaft/s390/lithium-gap-resolver-s390.cc

Issue 1763233003: S390: Initial Impl of Crankshaft features (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « src/crankshaft/s390/lithium-gap-resolver-s390.h ('k') | src/crankshaft/s390/lithium-s390.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/s390/lithium-gap-resolver-s390.cc
diff --git a/src/crankshaft/ppc/lithium-gap-resolver-ppc.cc b/src/crankshaft/s390/lithium-gap-resolver-s390.cc
similarity index 86%
copy from src/crankshaft/ppc/lithium-gap-resolver-ppc.cc
copy to src/crankshaft/s390/lithium-gap-resolver-s390.cc
index 4e249808f761a34eb7799b67e9c61f1661774c4a..cffcede226fbc2b48c8e86323f65423010561545 100644
--- a/src/crankshaft/ppc/lithium-gap-resolver-ppc.cc
+++ b/src/crankshaft/s390/lithium-gap-resolver-s390.cc
@@ -1,15 +1,15 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
+// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "src/crankshaft/ppc/lithium-gap-resolver-ppc.h"
+#include "src/crankshaft/s390/lithium-gap-resolver-s390.h"
-#include "src/crankshaft/ppc/lithium-codegen-ppc.h"
+#include "src/crankshaft/s390/lithium-codegen-s390.h"
namespace v8 {
namespace internal {
-static const Register kSavedValueRegister = {11};
+static const Register kSavedValueRegister = {1};
LGapResolver::LGapResolver(LCodeGen* owner)
: cgen_(owner),
@@ -18,7 +18,6 @@ LGapResolver::LGapResolver(LCodeGen* owner)
in_cycle_(false),
saved_destination_(NULL) {}
-
void LGapResolver::Resolve(LParallelMove* parallel_move) {
DCHECK(moves_.is_empty());
// Build up a worklist of moves.
@@ -49,7 +48,6 @@ void LGapResolver::Resolve(LParallelMove* parallel_move) {
moves_.Rewind(0);
}
-
void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) {
// Perform a linear sweep of the moves to add them to the initial list of
// moves to perform, ignoring any move that is redundant (the source is
@@ -63,7 +61,6 @@ void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) {
Verify();
}
-
void LGapResolver::PerformMove(int index) {
// Each call to this function performs a move and deletes it from the move
// graph. We first recursively perform any move blocking this one. We
@@ -121,7 +118,6 @@ void LGapResolver::PerformMove(int index) {
EmitMove(index);
}
-
void LGapResolver::Verify() {
#ifdef ENABLE_SLOW_DCHECKS
// No operand should be the destination for more than one move.
@@ -146,13 +142,13 @@ void LGapResolver::BreakCycle(int index) {
LOperand* source = moves_[index].source();
saved_destination_ = moves_[index].destination();
if (source->IsRegister()) {
- __ mr(kSavedValueRegister, cgen_->ToRegister(source));
+ __ LoadRR(kSavedValueRegister, cgen_->ToRegister(source));
} else if (source->IsStackSlot()) {
__ LoadP(kSavedValueRegister, cgen_->ToMemOperand(source));
} else if (source->IsDoubleRegister()) {
- __ fmr(kScratchDoubleReg, cgen_->ToDoubleRegister(source));
+ __ ldr(kScratchDoubleReg, cgen_->ToDoubleRegister(source));
} else if (source->IsDoubleStackSlot()) {
- __ lfd(kScratchDoubleReg, cgen_->ToMemOperand(source));
+ __ LoadDouble(kScratchDoubleReg, cgen_->ToMemOperand(source));
} else {
UNREACHABLE();
}
@@ -160,20 +156,19 @@ void LGapResolver::BreakCycle(int index) {
moves_[index].Eliminate();
}
-
void LGapResolver::RestoreValue() {
DCHECK(in_cycle_);
DCHECK(saved_destination_ != NULL);
// Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister.
if (saved_destination_->IsRegister()) {
- __ mr(cgen_->ToRegister(saved_destination_), kSavedValueRegister);
+ __ LoadRR(cgen_->ToRegister(saved_destination_), kSavedValueRegister);
} else if (saved_destination_->IsStackSlot()) {
__ StoreP(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_));
} else if (saved_destination_->IsDoubleRegister()) {
- __ fmr(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg);
+ __ ldr(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg);
} else if (saved_destination_->IsDoubleStackSlot()) {
- __ stfd(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_));
+ __ StoreDouble(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_));
} else {
UNREACHABLE();
}
@@ -182,7 +177,6 @@ void LGapResolver::RestoreValue() {
saved_destination_ = NULL;
}
-
void LGapResolver::EmitMove(int index) {
LOperand* source = moves_[index].source();
LOperand* destination = moves_[index].destination();
@@ -193,7 +187,7 @@ void LGapResolver::EmitMove(int index) {
if (source->IsRegister()) {
Register source_register = cgen_->ToRegister(source);
if (destination->IsRegister()) {
- __ mr(cgen_->ToRegister(destination), source_register);
+ __ LoadRR(cgen_->ToRegister(destination), source_register);
} else {
DCHECK(destination->IsStackSlot());
__ StoreP(source_register, cgen_->ToMemOperand(destination));
@@ -241,37 +235,37 @@ void LGapResolver::EmitMove(int index) {
} else if (source->IsDoubleRegister()) {
DoubleRegister source_register = cgen_->ToDoubleRegister(source);
if (destination->IsDoubleRegister()) {
- __ fmr(cgen_->ToDoubleRegister(destination), source_register);
+ __ ldr(cgen_->ToDoubleRegister(destination), source_register);
} else {
DCHECK(destination->IsDoubleStackSlot());
- __ stfd(source_register, cgen_->ToMemOperand(destination));
+ __ StoreDouble(source_register, cgen_->ToMemOperand(destination));
}
} else if (source->IsDoubleStackSlot()) {
MemOperand source_operand = cgen_->ToMemOperand(source);
if (destination->IsDoubleRegister()) {
- __ lfd(cgen_->ToDoubleRegister(destination), source_operand);
+ __ LoadDouble(cgen_->ToDoubleRegister(destination), source_operand);
} else {
DCHECK(destination->IsDoubleStackSlot());
MemOperand destination_operand = cgen_->ToMemOperand(destination);
if (in_cycle_) {
// kSavedDoubleValueRegister was used to break the cycle,
// but kSavedValueRegister is free.
-#if V8_TARGET_ARCH_PPC64
- __ ld(kSavedValueRegister, source_operand);
- __ std(kSavedValueRegister, destination_operand);
+#if V8_TARGET_ARCH_S390X
+ __ lg(kSavedValueRegister, source_operand);
+ __ stg(kSavedValueRegister, destination_operand);
#else
MemOperand source_high_operand = cgen_->ToHighMemOperand(source);
MemOperand destination_high_operand =
cgen_->ToHighMemOperand(destination);
- __ lwz(kSavedValueRegister, source_operand);
- __ stw(kSavedValueRegister, destination_operand);
- __ lwz(kSavedValueRegister, source_high_operand);
- __ stw(kSavedValueRegister, destination_high_operand);
+ __ LoadlW(kSavedValueRegister, source_operand);
+ __ StoreW(kSavedValueRegister, destination_operand);
+ __ LoadlW(kSavedValueRegister, source_high_operand);
+ __ StoreW(kSavedValueRegister, destination_high_operand);
#endif
} else {
- __ lfd(kScratchDoubleReg, source_operand);
- __ stfd(kScratchDoubleReg, destination_operand);
+ __ LoadDouble(kScratchDoubleReg, source_operand);
+ __ StoreDouble(kScratchDoubleReg, destination_operand);
}
}
} else {
@@ -281,7 +275,6 @@ void LGapResolver::EmitMove(int index) {
moves_[index].Eliminate();
}
-
#undef __
} // namespace internal
} // namespace v8
« no previous file with comments | « src/crankshaft/s390/lithium-gap-resolver-s390.h ('k') | src/crankshaft/s390/lithium-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698