OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3691 // Deoptimize on negative zero. | 3691 // Deoptimize on negative zero. |
3692 Label non_zero; | 3692 Label non_zero; |
3693 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. | 3693 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. |
3694 __ ucomisd(input_reg, xmm_scratch); | 3694 __ ucomisd(input_reg, xmm_scratch); |
3695 __ j(not_equal, &non_zero, Label::kNear); | 3695 __ j(not_equal, &non_zero, Label::kNear); |
3696 __ movmskpd(output_reg, input_reg); | 3696 __ movmskpd(output_reg, input_reg); |
3697 __ test(output_reg, Immediate(1)); | 3697 __ test(output_reg, Immediate(1)); |
3698 DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero); | 3698 DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero); |
3699 __ bind(&non_zero); | 3699 __ bind(&non_zero); |
3700 } | 3700 } |
3701 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); | 3701 __ roundsd(xmm_scratch, input_reg, kRoundDown); |
3702 __ cvttsd2si(output_reg, Operand(xmm_scratch)); | 3702 __ cvttsd2si(output_reg, Operand(xmm_scratch)); |
3703 // Overflow is signalled with minint. | 3703 // Overflow is signalled with minint. |
3704 __ cmp(output_reg, 0x1); | 3704 __ cmp(output_reg, 0x1); |
3705 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); | 3705 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); |
3706 } else { | 3706 } else { |
3707 Label negative_sign, done; | 3707 Label negative_sign, done; |
3708 // Deoptimize on unordered. | 3708 // Deoptimize on unordered. |
3709 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. | 3709 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. |
3710 __ ucomisd(input_reg, xmm_scratch); | 3710 __ ucomisd(input_reg, xmm_scratch); |
3711 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); | 3711 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); |
(...skipping 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5781 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5781 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5782 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5782 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5783 } | 5783 } |
5784 | 5784 |
5785 | 5785 |
5786 #undef __ | 5786 #undef __ |
5787 | 5787 |
5788 } } // namespace v8::internal | 5788 } } // namespace v8::internal |
5789 | 5789 |
5790 #endif // V8_TARGET_ARCH_IA32 | 5790 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |