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

Unified Diff: test/compiler-unittests/instruction-selector-unittest.h

Issue 500343002: [turbofan] Add backend support for load/store float32 values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 4 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: test/compiler-unittests/instruction-selector-unittest.h
diff --git a/test/compiler-unittests/instruction-selector-unittest.h b/test/compiler-unittests/instruction-selector-unittest.h
index 42aac9f44ebaba619bc03f7c610d207439fa6363..127cc1d479df10ccf367f31094908f8717ff9a61 100644
--- a/test/compiler-unittests/instruction-selector-unittest.h
+++ b/test/compiler-unittests/instruction-selector-unittest.h
@@ -24,7 +24,6 @@ class InstructionSelectorTest : public CompilerTest {
base::RandomNumberGenerator* rng() { return &rng_; }
- protected:
class Stream;
enum StreamBuilderMode { kAllInstructions, kTargetInstructions };
@@ -116,10 +115,23 @@ class InstructionSelectorTest : public CompilerTest {
return instructions_[index];
}
+ bool IsDouble(const InstructionOperand* operand) const {
+ return IsDouble(ToVreg(operand));
+ }
bool IsDouble(int virtual_register) const {
return doubles_.find(virtual_register) != doubles_.end();
}
+ bool IsInteger(const InstructionOperand* operand) const {
+ return IsInteger(ToVreg(operand));
+ }
+ bool IsInteger(int virtual_register) const {
+ return !IsDouble(virtual_register) && !IsReference(virtual_register);
+ }
+
+ bool IsReference(const InstructionOperand* operand) const {
+ return IsReference(ToVreg(operand));
+ }
bool IsReference(int virtual_register) const {
return references_.find(virtual_register) != references_.end();
}
@@ -129,6 +141,7 @@ class InstructionSelectorTest : public CompilerTest {
}
int ToVreg(const InstructionOperand* operand) const {
+ if (operand->IsConstant()) return operand->index();
EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind());
return UnallocatedOperand::cast(operand)->virtual_register();
}

Powered by Google App Engine
This is Rietveld 408576698