| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "x64/lithium-codegen-x64.h" | 9 #include "x64/lithium-codegen-x64.h" |
| 10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
| (...skipping 3621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3632 __ j(below, &negative_sign, Label::kNear); | 3632 __ j(below, &negative_sign, Label::kNear); |
| 3633 | 3633 |
| 3634 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3634 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
| 3635 // Check for negative zero. | 3635 // Check for negative zero. |
| 3636 Label positive_sign; | 3636 Label positive_sign; |
| 3637 __ j(above, &positive_sign, Label::kNear); | 3637 __ j(above, &positive_sign, Label::kNear); |
| 3638 __ movmskpd(output_reg, input_reg); | 3638 __ movmskpd(output_reg, input_reg); |
| 3639 __ testq(output_reg, Immediate(1)); | 3639 __ testq(output_reg, Immediate(1)); |
| 3640 DeoptimizeIf(not_zero, instr->environment()); | 3640 DeoptimizeIf(not_zero, instr->environment()); |
| 3641 __ Set(output_reg, 0); | 3641 __ Set(output_reg, 0); |
| 3642 __ jmp(&done, Label::kNear); | 3642 __ jmp(&done); |
| 3643 __ bind(&positive_sign); | 3643 __ bind(&positive_sign); |
| 3644 } | 3644 } |
| 3645 | 3645 |
| 3646 // Use truncating instruction (OK because input is positive). | 3646 // Use truncating instruction (OK because input is positive). |
| 3647 __ cvttsd2si(output_reg, input_reg); | 3647 __ cvttsd2si(output_reg, input_reg); |
| 3648 // Overflow is signalled with minint. | 3648 // Overflow is signalled with minint. |
| 3649 __ cmpl(output_reg, Immediate(0x1)); | 3649 __ cmpl(output_reg, Immediate(0x1)); |
| 3650 DeoptimizeIf(overflow, instr->environment()); | 3650 DeoptimizeIf(overflow, instr->environment()); |
| 3651 __ jmp(&done, Label::kNear); | 3651 __ jmp(&done, Label::kNear); |
| 3652 | 3652 |
| (...skipping 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5711 __ bind(deferred->exit()); | 5711 __ bind(deferred->exit()); |
| 5712 __ bind(&done); | 5712 __ bind(&done); |
| 5713 } | 5713 } |
| 5714 | 5714 |
| 5715 | 5715 |
| 5716 #undef __ | 5716 #undef __ |
| 5717 | 5717 |
| 5718 } } // namespace v8::internal | 5718 } } // namespace v8::internal |
| 5719 | 5719 |
| 5720 #endif // V8_TARGET_ARCH_X64 | 5720 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |