OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3748 ExternalReference::address_of_minus_one_half(); | 3748 ExternalReference::address_of_minus_one_half(); |
3749 bool minus_zero_check = | 3749 bool minus_zero_check = |
3750 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); | 3750 instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero); |
3751 | 3751 |
3752 __ movdbl(xmm_scratch, Operand::StaticVariable(one_half)); | 3752 __ movdbl(xmm_scratch, Operand::StaticVariable(one_half)); |
3753 | 3753 |
3754 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) { | 3754 if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) { |
3755 CpuFeatures::Scope scope(SSE4_1); | 3755 CpuFeatures::Scope scope(SSE4_1); |
3756 | 3756 |
3757 __ addsd(xmm_scratch, input_reg); | 3757 __ addsd(xmm_scratch, input_reg); |
3758 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); | 3758 __ roundsd(xmm_scratch, xmm_scratch, Assembler::kRoundDown); |
3759 __ cvttsd2si(output_reg, Operand(xmm_scratch)); | 3759 __ cvttsd2si(output_reg, Operand(xmm_scratch)); |
3760 // Overflow is signalled with minint. | 3760 // Overflow is signalled with minint. |
3761 __ cmp(output_reg, 0x80000000u); | 3761 __ cmp(output_reg, 0x80000000u); |
3762 __ RecordComment("D2I conversion overflow"); | 3762 __ RecordComment("D2I conversion overflow"); |
3763 DeoptimizeIf(equal, instr->environment()); | 3763 DeoptimizeIf(equal, instr->environment()); |
3764 } else { | 3764 } else { |
3765 Label done, round_to_zero, below_one_half, do_not_compensate; | 3765 Label done, round_to_zero, below_one_half, do_not_compensate; |
3766 __ ucomisd(xmm_scratch, input_reg); | 3766 __ ucomisd(xmm_scratch, input_reg); |
3767 __ j(above, &below_one_half); | 3767 __ j(above, &below_one_half); |
3768 | 3768 |
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6248 FixedArray::kHeaderSize - kPointerSize)); | 6248 FixedArray::kHeaderSize - kPointerSize)); |
6249 __ bind(&done); | 6249 __ bind(&done); |
6250 } | 6250 } |
6251 | 6251 |
6252 | 6252 |
6253 #undef __ | 6253 #undef __ |
6254 | 6254 |
6255 } } // namespace v8::internal | 6255 } } // namespace v8::internal |
6256 | 6256 |
6257 #endif // V8_TARGET_ARCH_IA32 | 6257 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |