OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 3756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3767 } else if (exponent_type.IsInteger32()) { | 3767 } else if (exponent_type.IsInteger32()) { |
3768 MathPowStub stub(isolate(), MathPowStub::INTEGER); | 3768 MathPowStub stub(isolate(), MathPowStub::INTEGER); |
3769 __ CallStub(&stub); | 3769 __ CallStub(&stub); |
3770 } else { | 3770 } else { |
3771 DCHECK(exponent_type.IsDouble()); | 3771 DCHECK(exponent_type.IsDouble()); |
3772 MathPowStub stub(isolate(), MathPowStub::DOUBLE); | 3772 MathPowStub stub(isolate(), MathPowStub::DOUBLE); |
3773 __ CallStub(&stub); | 3773 __ CallStub(&stub); |
3774 } | 3774 } |
3775 } | 3775 } |
3776 | 3776 |
3777 | |
3778 void LCodeGen::DoMathExp(LMathExp* instr) { | 3777 void LCodeGen::DoMathExp(LMathExp* instr) { |
3779 DoubleRegister input = ToDoubleRegister(instr->value()); | 3778 __ PrepareCallCFunction(0, 1, scratch0()); |
3780 DoubleRegister result = ToDoubleRegister(instr->result()); | 3779 __ MovToFloatParameter(ToDoubleRegister(instr->value())); |
3781 DoubleRegister double_scratch1 = ToDoubleRegister(instr->double_temp()); | 3780 __ CallCFunction(ExternalReference::ieee754_exp_function(isolate()), 0, 1); |
3782 DoubleRegister double_scratch2 = double_scratch0(); | 3781 __ MovFromFloatResult(ToDoubleRegister(instr->result())); |
3783 Register temp1 = ToRegister(instr->temp1()); | |
3784 Register temp2 = ToRegister(instr->temp2()); | |
3785 | |
3786 MathExpGenerator::EmitMathExp(masm(), input, result, double_scratch1, | |
3787 double_scratch2, temp1, temp2, scratch0()); | |
3788 } | 3782 } |
3789 | 3783 |
3790 | |
3791 void LCodeGen::DoMathLog(LMathLog* instr) { | 3784 void LCodeGen::DoMathLog(LMathLog* instr) { |
3792 __ PrepareCallCFunction(0, 1, scratch0()); | 3785 __ PrepareCallCFunction(0, 1, scratch0()); |
3793 __ MovToFloatParameter(ToDoubleRegister(instr->value())); | 3786 __ MovToFloatParameter(ToDoubleRegister(instr->value())); |
3794 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 0, 1); | 3787 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 0, 1); |
3795 __ MovFromFloatResult(ToDoubleRegister(instr->result())); | 3788 __ MovFromFloatResult(ToDoubleRegister(instr->result())); |
3796 } | 3789 } |
3797 | 3790 |
3798 | |
3799 void LCodeGen::DoMathClz32(LMathClz32* instr) { | 3791 void LCodeGen::DoMathClz32(LMathClz32* instr) { |
3800 Register input = ToRegister(instr->value()); | 3792 Register input = ToRegister(instr->value()); |
3801 Register result = ToRegister(instr->result()); | 3793 Register result = ToRegister(instr->result()); |
3802 __ cntlzw_(result, input); | 3794 __ cntlzw_(result, input); |
3803 } | 3795 } |
3804 | 3796 |
3805 void LCodeGen::PrepareForTailCall(const ParameterCount& actual, | 3797 void LCodeGen::PrepareForTailCall(const ParameterCount& actual, |
3806 Register scratch1, Register scratch2, | 3798 Register scratch1, Register scratch2, |
3807 Register scratch3) { | 3799 Register scratch3) { |
3808 #if DEBUG | 3800 #if DEBUG |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5810 __ LoadP(result, | 5802 __ LoadP(result, |
5811 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5803 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5812 __ bind(deferred->exit()); | 5804 __ bind(deferred->exit()); |
5813 __ bind(&done); | 5805 __ bind(&done); |
5814 } | 5806 } |
5815 | 5807 |
5816 #undef __ | 5808 #undef __ |
5817 | 5809 |
5818 } // namespace internal | 5810 } // namespace internal |
5819 } // namespace v8 | 5811 } // namespace v8 |
OLD | NEW |