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

Unified Diff: src/compiler/change-lowering.cc

Issue 840953003: [turbofan] Correctify representation changes to bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: std::isnan Created 5 years, 11 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/change-lowering.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index 7ddc751ab53199af0e8fc501b6f7eb12215f0d3c..fd425c28850690ddf4e9156d4b09c2bc0d429eff 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -22,9 +22,13 @@ Reduction ChangeLowering::Reduce(Node* node) {
Node* control = graph()->start();
switch (node->opcode()) {
case IrOpcode::kChangeBitToBool:
- return ChangeBitToBool(node->InputAt(0), control);
+ return ChangeBitToBool(node->InputAt(0));
case IrOpcode::kChangeBoolToBit:
return ChangeBoolToBit(node->InputAt(0));
+ case IrOpcode::kChangeWord32ToBit:
+ return ChangeWord32ToBit(node->InputAt(0));
+ case IrOpcode::kChangeWord64ToBit:
+ return ChangeWord64ToBit(node->InputAt(0));
case IrOpcode::kChangeFloat64ToTagged:
return ChangeFloat64ToTagged(node->InputAt(0), control);
case IrOpcode::kChangeInt32ToTagged:
@@ -138,17 +142,35 @@ Node* ChangeLowering::Uint32LessThanOrEqual(Node* lhs, Node* rhs) {
}
-Reduction ChangeLowering::ChangeBitToBool(Node* val, Node* control) {
+Reduction ChangeLowering::ChangeBitToBool(Node* value) {
MachineType const type = static_cast<MachineType>(kTypeBool | kRepTagged);
- return Replace(graph()->NewNode(common()->Select(type), val,
+ return Replace(graph()->NewNode(common()->Select(type), value,
jsgraph()->TrueConstant(),
jsgraph()->FalseConstant()));
}
-Reduction ChangeLowering::ChangeBoolToBit(Node* val) {
+Reduction ChangeLowering::ChangeBoolToBit(Node* value) {
+ return Replace(graph()->NewNode(machine()->WordEqual(), value,
+ jsgraph()->TrueConstant()));
+}
+
+
+Reduction ChangeLowering::ChangeWord32ToBit(Node* value) {
+ return Replace(
+ graph()->NewNode(machine()->Word32Equal(),
+ graph()->NewNode(machine()->Word32Equal(), value,
+ jsgraph()->Int32Constant(0)),
+ jsgraph()->Int32Constant(0)));
+}
+
+
+Reduction ChangeLowering::ChangeWord64ToBit(Node* value) {
return Replace(
- graph()->NewNode(machine()->WordEqual(), val, jsgraph()->TrueConstant()));
+ graph()->NewNode(machine()->Word32Equal(),
+ graph()->NewNode(machine()->Word64Equal(), value,
+ jsgraph()->Int64Constant(0)),
+ jsgraph()->Int32Constant(0)));
}
« no previous file with comments | « src/compiler/change-lowering.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698