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

Side by Side Diff: test/cctest/compiler/test-simplified-lowering.cc

Issue 596703004: [turbofan] Add backend support for float32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/compiler/test-run-machops.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 6
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/control-builders.h" 8 #include "src/compiler/control-builders.h"
9 #include "src/compiler/generic-node-inl.h" 9 #include "src/compiler/generic-node-inl.h"
10 #include "src/compiler/graph-visualizer.h" 10 #include "src/compiler/graph-visualizer.h"
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0, 1516 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0,
1517 load1, t.start); 1517 load1, t.start);
1518 t.Return(t.Use(phi, kMachineTypes[i])); 1518 t.Return(t.Use(phi, kMachineTypes[i]));
1519 t.Lower(); 1519 t.Lower();
1520 1520
1521 CHECK_EQ(IrOpcode::kPhi, phi->opcode()); 1521 CHECK_EQ(IrOpcode::kPhi, phi->opcode());
1522 CHECK_EQ(RepresentationOf(kMachineTypes[i]), 1522 CHECK_EQ(RepresentationOf(kMachineTypes[i]),
1523 RepresentationOf(OpParameter<MachineType>(phi))); 1523 RepresentationOf(OpParameter<MachineType>(phi)));
1524 } 1524 }
1525 } 1525 }
1526
1527
1528 // TODO(titzer): this tests current behavior of assuming an implicit
1529 // representation change in loading float32s. Fix when float32 is fully
1530 // supported.
1531 TEST(ImplicitFloat32ToFloat64InLoads) {
1532 TestingGraph t(Type::Any());
1533
1534 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
1535 Handle<Name>::null(), Type::Any(), kMachFloat32};
1536
1537 Node* load =
1538 t.graph()->NewNode(t.simplified()->LoadField(access), t.p0, t.start);
1539 t.Return(load);
1540 t.Lower();
1541 CHECK_EQ(IrOpcode::kLoad, load->opcode());
1542 CHECK_EQ(t.p0, load->InputAt(0));
1543 CheckChangeOf(IrOpcode::kChangeFloat64ToTagged, load, t.ret->InputAt(0));
1544 }
1545
1546
1547 TEST(ImplicitFloat64ToFloat32InStores) {
1548 TestingGraph t(Type::Any(), Type::Signed32());
1549 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
1550 Handle<Name>::null(), Type::Any(), kMachFloat32};
1551
1552 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0,
1553 t.p1, t.start, t.start);
1554 t.Effect(store);
1555 t.Lower();
1556
1557 CHECK_EQ(IrOpcode::kStore, store->opcode());
1558 CHECK_EQ(t.p0, store->InputAt(0));
1559 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2));
1560 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-machops.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698