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

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

Issue 1801013002: [wasm] Int64Lowering of F64ReinterpretI64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-bit-cast
Patch Set: Rebase. Created 4 years, 9 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 | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/int64-lowering.cc
diff --git a/src/compiler/int64-lowering.cc b/src/compiler/int64-lowering.cc
index 3d3c2419b1fa797327b9127217ac258bd28b1846..6a9d68124439bb8eec5994eff2b36b28920397c9 100644
--- a/src/compiler/int64-lowering.cc
+++ b/src/compiler/int64-lowering.cc
@@ -120,6 +120,8 @@ void Int64Lowering::LowerNode(Node* node) {
}
NodeProperties::ChangeOp(node, load_op);
ReplaceNode(node, node, high_node);
+ } else {
+ DefaultLowering(node);
}
break;
}
@@ -162,6 +164,8 @@ void Int64Lowering::LowerNode(Node* node) {
node->ReplaceInput(2, GetReplacementLow(value));
NodeProperties::ChangeOp(node, store_op);
ReplaceNode(node, node, high_node);
+ } else {
+ DefaultLowering(node);
}
break;
}
@@ -443,10 +447,41 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
// kExprF64ReinterpretI64:
+ case IrOpcode::kBitcastInt64ToFloat64: {
+ DCHECK(node->InputCount() == 1);
+ Node* input = node->InputAt(0);
+ Node* stack_slot = graph()->NewNode(
+ machine()->StackSlot(MachineRepresentation::kWord64));
+
+ Node* store_high_word = graph()->NewNode(
+ machine()->Store(
+ StoreRepresentation(MachineRepresentation::kWord32,
+ WriteBarrierKind::kNoWriteBarrier)),
+ stack_slot, graph()->NewNode(common()->Int32Constant(4)),
+ GetReplacementHigh(input), graph()->start(), graph()->start());
+
+ Node* store_low_word = graph()->NewNode(
+ machine()->Store(
+ StoreRepresentation(MachineRepresentation::kWord32,
+ WriteBarrierKind::kNoWriteBarrier)),
+ stack_slot, graph()->NewNode(common()->Int32Constant(0)),
+ GetReplacementLow(input), store_high_word, graph()->start());
+
+ Node* load =
+ graph()->NewNode(machine()->Load(MachineType::Float64()), stack_slot,
+ graph()->NewNode(common()->Int32Constant(0)),
+ store_low_word, graph()->start());
+
+ ReplaceNode(node, load, nullptr);
+ break;
+ }
// kExprI64ReinterpretF64:
case IrOpcode::kBitcastFloat64ToInt64: {
DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0);
+ if (HasReplacementLow(input)) {
+ input = GetReplacementLow(input);
+ }
Node* stack_slot = graph()->NewNode(
machine()->StackSlot(MachineRepresentation::kWord64));
Node* store = graph()->NewNode(
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698