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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
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 3694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3705 XMMRegister output_reg = ToDoubleRegister(instr->result()); | 3705 XMMRegister output_reg = ToDoubleRegister(instr->result()); |
3706 __ Cvtsd2ss(output_reg, input_reg); | 3706 __ Cvtsd2ss(output_reg, input_reg); |
3707 __ Cvtss2sd(output_reg, output_reg); | 3707 __ Cvtss2sd(output_reg, output_reg); |
3708 } | 3708 } |
3709 | 3709 |
3710 | 3710 |
3711 void LCodeGen::DoMathSqrt(LMathSqrt* instr) { | 3711 void LCodeGen::DoMathSqrt(LMathSqrt* instr) { |
3712 XMMRegister output = ToDoubleRegister(instr->result()); | 3712 XMMRegister output = ToDoubleRegister(instr->result()); |
3713 if (instr->value()->IsDoubleRegister()) { | 3713 if (instr->value()->IsDoubleRegister()) { |
3714 XMMRegister input = ToDoubleRegister(instr->value()); | 3714 XMMRegister input = ToDoubleRegister(instr->value()); |
3715 __ sqrtsd(output, input); | 3715 __ Sqrtsd(output, input); |
3716 } else { | 3716 } else { |
3717 Operand input = ToOperand(instr->value()); | 3717 Operand input = ToOperand(instr->value()); |
3718 __ sqrtsd(output, input); | 3718 __ Sqrtsd(output, input); |
3719 } | 3719 } |
3720 } | 3720 } |
3721 | 3721 |
3722 | 3722 |
3723 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { | 3723 void LCodeGen::DoMathPowHalf(LMathPowHalf* instr) { |
3724 XMMRegister xmm_scratch = double_scratch0(); | 3724 XMMRegister xmm_scratch = double_scratch0(); |
3725 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3725 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
3726 DCHECK(ToDoubleRegister(instr->result()).is(input_reg)); | 3726 DCHECK(ToDoubleRegister(instr->result()).is(input_reg)); |
3727 | 3727 |
3728 // Note that according to ECMA-262 15.8.2.13: | 3728 // Note that according to ECMA-262 15.8.2.13: |
(...skipping 11 matching lines...) Expand all Loading... |
3740 __ j(carry, &sqrt, Label::kNear); | 3740 __ j(carry, &sqrt, Label::kNear); |
3741 // If input is -Infinity, return Infinity. | 3741 // If input is -Infinity, return Infinity. |
3742 __ Xorpd(input_reg, input_reg); | 3742 __ Xorpd(input_reg, input_reg); |
3743 __ subsd(input_reg, xmm_scratch); | 3743 __ subsd(input_reg, xmm_scratch); |
3744 __ jmp(&done, Label::kNear); | 3744 __ jmp(&done, Label::kNear); |
3745 | 3745 |
3746 // Square root. | 3746 // Square root. |
3747 __ bind(&sqrt); | 3747 __ bind(&sqrt); |
3748 __ Xorpd(xmm_scratch, xmm_scratch); | 3748 __ Xorpd(xmm_scratch, xmm_scratch); |
3749 __ addsd(input_reg, xmm_scratch); // Convert -0 to +0. | 3749 __ addsd(input_reg, xmm_scratch); // Convert -0 to +0. |
3750 __ sqrtsd(input_reg, input_reg); | 3750 __ Sqrtsd(input_reg, input_reg); |
3751 __ bind(&done); | 3751 __ bind(&done); |
3752 } | 3752 } |
3753 | 3753 |
3754 | 3754 |
3755 void LCodeGen::DoPower(LPower* instr) { | 3755 void LCodeGen::DoPower(LPower* instr) { |
3756 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3756 Representation exponent_type = instr->hydrogen()->right()->representation(); |
3757 // Having marked this as a call, we can use any registers. | 3757 // Having marked this as a call, we can use any registers. |
3758 // Just make sure that the input/output registers are the expected ones. | 3758 // Just make sure that the input/output registers are the expected ones. |
3759 | 3759 |
3760 Register tagged_exponent = MathPowTaggedDescriptor::exponent(); | 3760 Register tagged_exponent = MathPowTaggedDescriptor::exponent(); |
(...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5869 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5869 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5870 } | 5870 } |
5871 | 5871 |
5872 | 5872 |
5873 #undef __ | 5873 #undef __ |
5874 | 5874 |
5875 } // namespace internal | 5875 } // namespace internal |
5876 } // namespace v8 | 5876 } // namespace v8 |
5877 | 5877 |
5878 #endif // V8_TARGET_ARCH_X64 | 5878 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |