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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 785 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
786 Register base; | 786 Register base; |
787 if (offset.from_stack_pointer()) { | 787 if (offset.from_stack_pointer()) { |
788 base = __ StackPointer(); | 788 base = __ StackPointer(); |
789 } else { | 789 } else { |
790 base = fp; | 790 base = fp; |
791 } | 791 } |
792 __ Add(i.OutputRegister(0), base, Operand(offset.offset())); | 792 __ Add(i.OutputRegister(0), base, Operand(offset.offset())); |
793 break; | 793 break; |
794 } | 794 } |
| 795 case kIeee754Float64Log: { |
| 796 FrameScope scope(masm(), StackFrame::MANUAL); |
| 797 DCHECK(d0.is(i.InputDoubleRegister(0))); |
| 798 DCHECK(d0.is(i.OutputDoubleRegister())); |
| 799 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 0, |
| 800 1); |
| 801 break; |
| 802 } |
795 case kArm64Float32RoundDown: | 803 case kArm64Float32RoundDown: |
796 __ Frintm(i.OutputFloat32Register(), i.InputFloat32Register(0)); | 804 __ Frintm(i.OutputFloat32Register(), i.InputFloat32Register(0)); |
797 break; | 805 break; |
798 case kArm64Float64RoundDown: | 806 case kArm64Float64RoundDown: |
799 __ Frintm(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); | 807 __ Frintm(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); |
800 break; | 808 break; |
801 case kArm64Float32RoundUp: | 809 case kArm64Float32RoundUp: |
802 __ Frintp(i.OutputFloat32Register(), i.InputFloat32Register(0)); | 810 __ Frintp(i.OutputFloat32Register(), i.InputFloat32Register(0)); |
803 break; | 811 break; |
804 case kArm64Float64RoundUp: | 812 case kArm64Float64RoundUp: |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 break; | 1251 break; |
1244 case kArm64Float64Min: | 1252 case kArm64Float64Min: |
1245 // (a < b) ? a : b | 1253 // (a < b) ? a : b |
1246 __ Fcmp(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | 1254 __ Fcmp(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
1247 __ Fcsel(i.OutputDoubleRegister(), i.InputDoubleRegister(0), | 1255 __ Fcsel(i.OutputDoubleRegister(), i.InputDoubleRegister(0), |
1248 i.InputDoubleRegister(1), lo); | 1256 i.InputDoubleRegister(1), lo); |
1249 break; | 1257 break; |
1250 case kArm64Float64Abs: | 1258 case kArm64Float64Abs: |
1251 __ Fabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); | 1259 __ Fabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); |
1252 break; | 1260 break; |
1253 case kArm64Float64Log: { | |
1254 // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc | |
1255 FrameScope scope(masm(), StackFrame::MANUAL); | |
1256 DCHECK(d0.is(i.InputDoubleRegister(0))); | |
1257 DCHECK(d0.is(i.OutputDoubleRegister())); | |
1258 // TODO(dcarney): make sure this saves all relevant registers. | |
1259 __ CallCFunction(ExternalReference::math_log_double_function(isolate()), | |
1260 0, 1); | |
1261 break; | |
1262 } | |
1263 case kArm64Float64Neg: | 1261 case kArm64Float64Neg: |
1264 __ Fneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); | 1262 __ Fneg(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); |
1265 break; | 1263 break; |
1266 case kArm64Float64Sqrt: | 1264 case kArm64Float64Sqrt: |
1267 __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); | 1265 __ Fsqrt(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); |
1268 break; | 1266 break; |
1269 case kArm64Float32ToFloat64: | 1267 case kArm64Float32ToFloat64: |
1270 __ Fcvt(i.OutputDoubleRegister(), i.InputDoubleRegister(0).S()); | 1268 __ Fcvt(i.OutputDoubleRegister(), i.InputDoubleRegister(0).S()); |
1271 break; | 1269 break; |
1272 case kArm64Float64ToFloat32: | 1270 case kArm64Float64ToFloat32: |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 padding_size -= kInstructionSize; | 1933 padding_size -= kInstructionSize; |
1936 } | 1934 } |
1937 } | 1935 } |
1938 } | 1936 } |
1939 | 1937 |
1940 #undef __ | 1938 #undef __ |
1941 | 1939 |
1942 } // namespace compiler | 1940 } // namespace compiler |
1943 } // namespace internal | 1941 } // namespace internal |
1944 } // namespace v8 | 1942 } // namespace v8 |
OLD | NEW |