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

Unified Diff: src/compiler/instruction-selector-unittest.cc

Issue 600383002: [turbofan] Add backend support for Float32Constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add InstructionSelector unit test. Created 6 years, 3 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/compiler/instruction-selector-unittest.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-unittest.cc
diff --git a/src/compiler/instruction-selector-unittest.cc b/src/compiler/instruction-selector-unittest.cc
index aa707357e991b5c43cb869654c3498d9f2bdd522..75159b09c1c30d5303ec56c31f23ba144fa2b146 100644
--- a/src/compiler/instruction-selector-unittest.cc
+++ b/src/compiler/instruction-selector-unittest.cc
@@ -113,6 +113,20 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
// Return.
+TARGET_TEST_F(InstructionSelectorTest, ReturnFloat32Constant) {
+ const float kValue = 4.2f;
+ StreamBuilder m(this, kMachFloat32);
+ m.Return(m.Float32Constant(kValue));
+ Stream s = m.Build(kAllInstructions);
+ ASSERT_EQ(2U, s.size());
+ EXPECT_EQ(kArchNop, s[0]->arch_opcode());
+ ASSERT_EQ(InstructionOperand::CONSTANT, s[0]->OutputAt(0)->kind());
+ EXPECT_FLOAT_EQ(kValue, s.ToFloat32(s[0]->OutputAt(0)));
+ EXPECT_EQ(kArchRet, s[1]->arch_opcode());
+ EXPECT_EQ(1U, s[1]->InputCount());
+}
+
+
TARGET_TEST_F(InstructionSelectorTest, ReturnParameter) {
StreamBuilder m(this, kMachInt32, kMachInt32);
m.Return(m.Parameter(0));
@@ -288,6 +302,8 @@ TARGET_TEST_F(InstructionSelectorTest, ValueEffect) {
// -----------------------------------------------------------------------------
// Calls with deoptimization.
+
+
TARGET_TEST_F(InstructionSelectorTest, CallJSFunctionWithDeopt) {
StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged, kMachAnyTagged,
kMachAnyTagged);
« no previous file with comments | « src/compiler/instruction-selector-unittest.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698