OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3536 | 3536 |
3537 bool minus_zero_check = | 3537 bool minus_zero_check = |
3538 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); | 3538 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); |
3539 | 3539 |
3540 __ movq(kScratchRegister, one_half, RelocInfo::NONE64); | 3540 __ movq(kScratchRegister, one_half, RelocInfo::NONE64); |
3541 __ movq(xmm_scratch, kScratchRegister); | 3541 __ movq(xmm_scratch, kScratchRegister); |
3542 | 3542 |
3543 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) { | 3543 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) { |
3544 CpuFeatures::Scope scope(SSE4_1); | 3544 CpuFeatures::Scope scope(SSE4_1); |
3545 __ addsd(xmm_scratch, input_reg); | 3545 __ addsd(xmm_scratch, input_reg); |
3546 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); | 3546 __ roundsd(xmm_scratch, xmm_scratch, Assembler::kRoundDown); |
3547 __ cvttsd2si(output_reg, xmm_scratch); | 3547 __ cvttsd2si(output_reg, xmm_scratch); |
3548 // Overflow is signalled with minint. | 3548 // Overflow is signalled with minint. |
3549 __ cmpl(output_reg, Immediate(0x80000000)); | 3549 __ cmpl(output_reg, Immediate(0x80000000)); |
3550 __ RecordComment("D2I conversion overflow"); | 3550 __ RecordComment("D2I conversion overflow"); |
3551 DeoptimizeIf(equal, instr->environment()); | 3551 DeoptimizeIf(equal, instr->environment()); |
3552 } else { | 3552 } else { |
3553 Label done, round_to_zero, below_one_half, do_not_compensate; | 3553 Label done, round_to_zero, below_one_half, do_not_compensate; |
3554 __ ucomisd(xmm_scratch, input_reg); | 3554 __ ucomisd(xmm_scratch, input_reg); |
3555 __ j(above, &below_one_half); | 3555 __ j(above, &below_one_half); |
3556 | 3556 |
(...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5822 FixedArray::kHeaderSize - kPointerSize)); | 5822 FixedArray::kHeaderSize - kPointerSize)); |
5823 __ bind(&done); | 5823 __ bind(&done); |
5824 } | 5824 } |
5825 | 5825 |
5826 | 5826 |
5827 #undef __ | 5827 #undef __ |
5828 | 5828 |
5829 } } // namespace v8::internal | 5829 } } // namespace v8::internal |
5830 | 5830 |
5831 #endif // V8_TARGET_ARCH_X64 | 5831 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |