OLD | NEW |
---|---|
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 "src/compiler/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 Node* low_node = | 282 Node* low_node = |
283 graph()->NewNode(machine()->Word32Xor(), GetReplacementLow(left), | 283 graph()->NewNode(machine()->Word32Xor(), GetReplacementLow(left), |
284 GetReplacementLow(right)); | 284 GetReplacementLow(right)); |
285 Node* high_node = | 285 Node* high_node = |
286 graph()->NewNode(machine()->Word32Xor(), GetReplacementHigh(left), | 286 graph()->NewNode(machine()->Word32Xor(), GetReplacementHigh(left), |
287 GetReplacementHigh(right)); | 287 GetReplacementHigh(right)); |
288 ReplaceNode(node, low_node, high_node); | 288 ReplaceNode(node, low_node, high_node); |
289 break; | 289 break; |
290 } | 290 } |
291 // kExprI64Shl: | 291 // kExprI64Shl: |
292 case IrOpcode::kWord64Shl: { | |
293 DCHECK(node->InputCount() == 2); | |
titzer
2016/03/02 22:32:53
Can you drop in a TODO(turbofan) here for shift co
ahaas
2016/03/04 10:21:11
Done.
| |
294 Node* shift = node->InputAt(1); | |
295 if (HasReplacementLow(shift)) { | |
296 // We do not have to care about the high word replacement, because | |
297 // the shift can only be between 0 and 63 anyways. | |
298 node->ReplaceInput(1, GetReplacementLow(shift)); | |
299 } | |
300 | |
301 Node* value = node->InputAt(0); | |
302 node->ReplaceInput(0, GetReplacementLow(value)); | |
303 node->InsertInput(zone(), 1, GetReplacementHigh(value)); | |
304 | |
305 NodeProperties::ChangeOp(node, machine()->WasmWord64Shl()); | |
306 // We access the additional return values through projections. | |
307 Node* low_node = graph()->NewNode(common()->Projection(0), node); | |
308 Node* high_node = graph()->NewNode(common()->Projection(1), node); | |
309 ReplaceNode(node, low_node, high_node); | |
310 break; | |
311 } | |
292 // kExprI64ShrU: | 312 // kExprI64ShrU: |
293 // kExprI64ShrS: | 313 // kExprI64ShrS: |
294 // kExprI64Eq: | 314 // kExprI64Eq: |
295 case IrOpcode::kWord64Equal: { | 315 case IrOpcode::kWord64Equal: { |
296 DCHECK(node->InputCount() == 2); | 316 DCHECK(node->InputCount() == 2); |
297 Node* left = node->InputAt(0); | 317 Node* left = node->InputAt(0); |
298 Node* right = node->InputAt(1); | 318 Node* right = node->InputAt(1); |
299 | 319 |
300 // TODO(wasm): Use explicit comparisons and && here? | 320 // TODO(wasm): Use explicit comparisons and && here? |
301 Node* replacement = graph()->NewNode( | 321 Node* replacement = graph()->NewNode( |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 } | 433 } |
414 | 434 |
415 Node* Int64Lowering::GetReplacementHigh(Node* node) { | 435 Node* Int64Lowering::GetReplacementHigh(Node* node) { |
416 Node* result = replacements_[node->id()].high; | 436 Node* result = replacements_[node->id()].high; |
417 DCHECK(result); | 437 DCHECK(result); |
418 return result; | 438 return result; |
419 } | 439 } |
420 } // namespace compiler | 440 } // namespace compiler |
421 } // namespace internal | 441 } // namespace internal |
422 } // namespace v8 | 442 } // namespace v8 |
OLD | NEW |