| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 machine()->Uint32LessThan()); | 349 machine()->Uint32LessThan()); |
| 350 break; | 350 break; |
| 351 } | 351 } |
| 352 case IrOpcode::kUint64LessThanOrEqual: { | 352 case IrOpcode::kUint64LessThanOrEqual: { |
| 353 LowerComparison(node, machine()->Uint32LessThan(), | 353 LowerComparison(node, machine()->Uint32LessThan(), |
| 354 machine()->Uint32LessThanOrEqual()); | 354 machine()->Uint32LessThanOrEqual()); |
| 355 break; | 355 break; |
| 356 } | 356 } |
| 357 | 357 |
| 358 // kExprI64SConvertI32: | 358 // kExprI64SConvertI32: |
| 359 // kExprI64UConvertI32: | 359 case IrOpcode::kChangeInt32ToInt64: { |
| 360 | 360 DCHECK(node->InputCount() == 1); |
| 361 Node* input = node->InputAt(0); |
| 362 if (HasReplacementLow(input)) { |
| 363 input = GetReplacementLow(input); |
| 364 } |
| 365 // We use SAR to preserve the sign in the high word. |
| 366 ReplaceNode( |
| 367 node, input, |
| 368 graph()->NewNode(machine()->Word32Sar(), input, |
| 369 graph()->NewNode(common()->Int32Constant(31)))); |
| 370 node->NullAllInputs(); |
| 371 break; |
| 372 } |
| 373 // kExprI64UConvertI32: { |
| 374 case IrOpcode::kChangeUint32ToUint64: { |
| 375 DCHECK(node->InputCount() == 1); |
| 376 Node* input = node->InputAt(0); |
| 377 if (HasReplacementLow(input)) { |
| 378 input = GetReplacementLow(input); |
| 379 } |
| 380 ReplaceNode(node, input, graph()->NewNode(common()->Int32Constant(0))); |
| 381 node->NullAllInputs(); |
| 382 break; |
| 383 } |
| 361 // kExprF64ReinterpretI64: | 384 // kExprF64ReinterpretI64: |
| 362 // kExprI64ReinterpretF64: | 385 // kExprI64ReinterpretF64: |
| 363 | 386 |
| 364 // kExprI64Clz: | 387 // kExprI64Clz: |
| 365 // kExprI64Ctz: | 388 // kExprI64Ctz: |
| 366 // kExprI64Popcnt: | 389 // kExprI64Popcnt: |
| 367 | 390 |
| 368 default: { DefaultLowering(node); } | 391 default: { DefaultLowering(node); } |
| 369 } | 392 } |
| 370 } | 393 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 } | 449 } |
| 427 | 450 |
| 428 Node* Int64Lowering::GetReplacementHigh(Node* node) { | 451 Node* Int64Lowering::GetReplacementHigh(Node* node) { |
| 429 Node* result = replacements_[node->id()].high; | 452 Node* result = replacements_[node->id()].high; |
| 430 DCHECK(result); | 453 DCHECK(result); |
| 431 return result; | 454 return result; |
| 432 } | 455 } |
| 433 } // namespace compiler | 456 } // namespace compiler |
| 434 } // namespace internal | 457 } // namespace internal |
| 435 } // namespace v8 | 458 } // namespace v8 |
| OLD | NEW |