OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 case kSSEFloat64ToInt32: { | 462 case kSSEFloat64ToInt32: { |
463 RegisterOrOperand input = i.InputRegisterOrOperand(0); | 463 RegisterOrOperand input = i.InputRegisterOrOperand(0); |
464 if (input.type == kDoubleRegister) { | 464 if (input.type == kDoubleRegister) { |
465 __ cvttsd2si(i.OutputRegister(), input.double_reg); | 465 __ cvttsd2si(i.OutputRegister(), input.double_reg); |
466 } else { | 466 } else { |
467 __ cvttsd2si(i.OutputRegister(), input.operand); | 467 __ cvttsd2si(i.OutputRegister(), input.operand); |
468 } | 468 } |
469 break; | 469 break; |
470 } | 470 } |
471 case kSSEFloat64ToUint32: { | 471 case kSSEFloat64ToUint32: { |
472 // TODO(turbofan): X64 SSE cvttsd2siq should support operands. | 472 RegisterOrOperand input = i.InputRegisterOrOperand(0); |
473 __ cvttsd2siq(i.OutputRegister(), i.InputDoubleRegister(0)); | 473 if (input.type == kDoubleRegister) { |
| 474 __ cvttsd2siq(i.OutputRegister(), input.double_reg); |
| 475 } else { |
| 476 __ cvttsd2siq(i.OutputRegister(), input.operand); |
| 477 } |
474 __ andl(i.OutputRegister(), i.OutputRegister()); // clear upper bits. | 478 __ andl(i.OutputRegister(), i.OutputRegister()); // clear upper bits. |
475 // TODO(turbofan): generated code should not look at the upper 32 bits | |
476 // of the result, but those bits could escape to the outside world. | |
477 break; | 479 break; |
478 } | 480 } |
479 case kSSEInt32ToFloat64: { | 481 case kSSEInt32ToFloat64: { |
480 RegisterOrOperand input = i.InputRegisterOrOperand(0); | 482 RegisterOrOperand input = i.InputRegisterOrOperand(0); |
481 if (input.type == kRegister) { | 483 if (input.type == kRegister) { |
482 __ cvtlsi2sd(i.OutputDoubleRegister(), input.reg); | 484 __ cvtlsi2sd(i.OutputDoubleRegister(), input.reg); |
483 } else { | 485 } else { |
484 __ cvtlsi2sd(i.OutputDoubleRegister(), input.operand); | 486 __ cvtlsi2sd(i.OutputDoubleRegister(), input.operand); |
485 } | 487 } |
486 break; | 488 break; |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 } | 1001 } |
1000 | 1002 |
1001 | 1003 |
1002 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 1004 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
1003 | 1005 |
1004 #undef __ | 1006 #undef __ |
1005 | 1007 |
1006 } // namespace internal | 1008 } // namespace internal |
1007 } // namespace compiler | 1009 } // namespace compiler |
1008 } // namespace v8 | 1010 } // namespace v8 |
OLD | NEW |