| 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/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 3634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3645 DoubleRegister result = ToDoubleRegister(instr->result()); | 3645 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3646 DoubleRegister temp = ToDoubleRegister(instr->temp()); | 3646 DoubleRegister temp = ToDoubleRegister(instr->temp()); |
| 3647 | 3647 |
| 3648 DCHECK(!input.is(result)); | 3648 DCHECK(!input.is(result)); |
| 3649 | 3649 |
| 3650 // Note that according to ECMA-262 15.8.2.13: | 3650 // Note that according to ECMA-262 15.8.2.13: |
| 3651 // Math.pow(-Infinity, 0.5) == Infinity | 3651 // Math.pow(-Infinity, 0.5) == Infinity |
| 3652 // Math.sqrt(-Infinity) == NaN | 3652 // Math.sqrt(-Infinity) == NaN |
| 3653 Label done; | 3653 Label done; |
| 3654 __ Move(temp, static_cast<double>(-V8_INFINITY)); | 3654 __ Move(temp, static_cast<double>(-V8_INFINITY)); |
| 3655 __ BranchF(USE_DELAY_SLOT, &done, NULL, eq, temp, input); | 3655 __ Neg_d(result, temp); |
| 3656 // Set up Infinity in the delay slot. | 3656 __ BranchF(&done, NULL, eq, temp, input); |
| 3657 // result is overwritten if the branch is not taken. | |
| 3658 __ neg_d(result, temp); | |
| 3659 | 3657 |
| 3660 // Add +0 to convert -0 to +0. | 3658 // Add +0 to convert -0 to +0. |
| 3661 __ add_d(result, input, kDoubleRegZero); | 3659 __ add_d(result, input, kDoubleRegZero); |
| 3662 __ sqrt_d(result, result); | 3660 __ sqrt_d(result, result); |
| 3663 __ bind(&done); | 3661 __ bind(&done); |
| 3664 } | 3662 } |
| 3665 | 3663 |
| 3666 | 3664 |
| 3667 void LCodeGen::DoPower(LPower* instr) { | 3665 void LCodeGen::DoPower(LPower* instr) { |
| 3668 Representation exponent_type = instr->hydrogen()->right()->representation(); | 3666 Representation exponent_type = instr->hydrogen()->right()->representation(); |
| (...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5746 __ ld(result, FieldMemOperand(scratch, | 5744 __ ld(result, FieldMemOperand(scratch, |
| 5747 FixedArray::kHeaderSize - kPointerSize)); | 5745 FixedArray::kHeaderSize - kPointerSize)); |
| 5748 __ bind(deferred->exit()); | 5746 __ bind(deferred->exit()); |
| 5749 __ bind(&done); | 5747 __ bind(&done); |
| 5750 } | 5748 } |
| 5751 | 5749 |
| 5752 #undef __ | 5750 #undef __ |
| 5753 | 5751 |
| 5754 } // namespace internal | 5752 } // namespace internal |
| 5755 } // namespace v8 | 5753 } // namespace v8 |
| OLD | NEW |