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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 { | 39 { |
40 DoubleRegister input = d1; | 40 DoubleRegister input = d1; |
41 DoubleRegister result = d2; | 41 DoubleRegister result = d2; |
42 DoubleRegister double_scratch1 = d3; | 42 DoubleRegister double_scratch1 = d3; |
43 DoubleRegister double_scratch2 = d4; | 43 DoubleRegister double_scratch2 = d4; |
44 Register temp1 = r7; | 44 Register temp1 = r7; |
45 Register temp2 = r8; | 45 Register temp2 = r8; |
46 Register temp3 = r9; | 46 Register temp3 = r9; |
47 | 47 |
48 // Called from C | 48 // Called from C |
49 #if ABI_USES_FUNCTION_DESCRIPTORS | |
50 __ function_descriptor(); | 49 __ function_descriptor(); |
51 #endif | |
52 | 50 |
53 __ Push(temp3, temp2, temp1); | 51 __ Push(temp3, temp2, temp1); |
54 MathExpGenerator::EmitMathExp(&masm, input, result, double_scratch1, | 52 MathExpGenerator::EmitMathExp(&masm, input, result, double_scratch1, |
55 double_scratch2, temp1, temp2, temp3); | 53 double_scratch2, temp1, temp2, temp3); |
56 __ Pop(temp3, temp2, temp1); | 54 __ Pop(temp3, temp2, temp1); |
57 __ fmr(d1, result); | 55 __ fmr(d1, result); |
58 __ Ret(); | 56 __ Ret(); |
59 } | 57 } |
60 | 58 |
61 CodeDesc desc; | 59 CodeDesc desc; |
(...skipping 19 matching lines...) Expand all Loading... |
81 return &std::sqrt; | 79 return &std::sqrt; |
82 #else | 80 #else |
83 size_t actual_size; | 81 size_t actual_size; |
84 byte* buffer = | 82 byte* buffer = |
85 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); | 83 static_cast<byte*>(base::OS::Allocate(1 * KB, &actual_size, true)); |
86 if (buffer == NULL) return &std::sqrt; | 84 if (buffer == NULL) return &std::sqrt; |
87 | 85 |
88 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); | 86 MacroAssembler masm(NULL, buffer, static_cast<int>(actual_size)); |
89 | 87 |
90 // Called from C | 88 // Called from C |
91 #if ABI_USES_FUNCTION_DESCRIPTORS | |
92 __ function_descriptor(); | 89 __ function_descriptor(); |
93 #endif | |
94 | 90 |
95 __ MovFromFloatParameter(d1); | 91 __ MovFromFloatParameter(d1); |
96 __ fsqrt(d1, d1); | 92 __ fsqrt(d1, d1); |
97 __ MovToFloatResult(d1); | 93 __ MovToFloatResult(d1); |
98 __ Ret(); | 94 __ Ret(); |
99 | 95 |
100 CodeDesc desc; | 96 CodeDesc desc; |
101 masm.GetCode(&desc); | 97 masm.GetCode(&desc); |
102 #if !ABI_USES_FUNCTION_DESCRIPTORS | 98 #if !ABI_USES_FUNCTION_DESCRIPTORS |
103 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 99 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 patcher.masm()->Jump(r3); | 687 patcher.masm()->Jump(r3); |
692 for (int i = 0; i < kCodeAgingSequenceNops; i++) { | 688 for (int i = 0; i < kCodeAgingSequenceNops; i++) { |
693 patcher.masm()->nop(); | 689 patcher.masm()->nop(); |
694 } | 690 } |
695 } | 691 } |
696 } | 692 } |
697 } | 693 } |
698 } // namespace v8::internal | 694 } // namespace v8::internal |
699 | 695 |
700 #endif // V8_TARGET_ARCH_PPC | 696 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |