| 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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
| 10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 667 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
| 668 Register base; | 668 Register base; |
| 669 if (offset.from_stack_pointer()) { | 669 if (offset.from_stack_pointer()) { |
| 670 base = sp; | 670 base = sp; |
| 671 } else { | 671 } else { |
| 672 base = fp; | 672 base = fp; |
| 673 } | 673 } |
| 674 __ add(i.OutputRegister(0), base, Operand(offset.offset())); | 674 __ add(i.OutputRegister(0), base, Operand(offset.offset())); |
| 675 break; | 675 break; |
| 676 } | 676 } |
| 677 case kIeee754Float64Log: { |
| 678 // TODO(bmeurer): We should really get rid of this special instruction, |
| 679 // and generate a CallAddress instruction instead. |
| 680 FrameScope scope(masm(), StackFrame::MANUAL); |
| 681 __ PrepareCallCFunction(0, 1, kScratchReg); |
| 682 __ MovToFloatParameter(i.InputFloat64Register(0)); |
| 683 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 0, |
| 684 1); |
| 685 // Move the result in the double result register. |
| 686 __ MovFromFloatResult(i.OutputFloat64Register()); |
| 687 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 688 break; |
| 689 } |
| 677 case kArmAdd: | 690 case kArmAdd: |
| 678 __ add(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), | 691 __ add(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), |
| 679 i.OutputSBit()); | 692 i.OutputSBit()); |
| 680 break; | 693 break; |
| 681 case kArmAnd: | 694 case kArmAnd: |
| 682 __ and_(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), | 695 __ and_(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), |
| 683 i.OutputSBit()); | 696 i.OutputSBit()); |
| 684 break; | 697 break; |
| 685 case kArmBic: | 698 case kArmBic: |
| 686 __ bic(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), | 699 __ bic(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 __ PrepareCallCFunction(0, 2, kScratchReg); | 1004 __ PrepareCallCFunction(0, 2, kScratchReg); |
| 992 __ MovToFloatParameters(i.InputFloat64Register(0), | 1005 __ MovToFloatParameters(i.InputFloat64Register(0), |
| 993 i.InputFloat64Register(1)); | 1006 i.InputFloat64Register(1)); |
| 994 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), | 1007 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), |
| 995 0, 2); | 1008 0, 2); |
| 996 // Move the result in the double result register. | 1009 // Move the result in the double result register. |
| 997 __ MovFromFloatResult(i.OutputFloat64Register()); | 1010 __ MovFromFloatResult(i.OutputFloat64Register()); |
| 998 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 1011 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 999 break; | 1012 break; |
| 1000 } | 1013 } |
| 1001 case kArmVlogF64: { | |
| 1002 // TODO(bmeurer): We should really get rid of this special instruction, | |
| 1003 // and generate a CallAddress instruction instead. | |
| 1004 FrameScope scope(masm(), StackFrame::MANUAL); | |
| 1005 __ PrepareCallCFunction(0, 1, kScratchReg); | |
| 1006 __ MovToFloatParameter(i.InputFloat64Register(0)); | |
| 1007 __ CallCFunction(ExternalReference::math_log_double_function(isolate()), | |
| 1008 0, 1); | |
| 1009 // Move the result in the double result register. | |
| 1010 __ MovFromFloatResult(i.OutputFloat64Register()); | |
| 1011 DCHECK_EQ(LeaveCC, i.OutputSBit()); | |
| 1012 break; | |
| 1013 } | |
| 1014 case kArmVsqrtF64: | 1014 case kArmVsqrtF64: |
| 1015 __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 1015 __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
| 1016 break; | 1016 break; |
| 1017 case kArmVabsF64: | 1017 case kArmVabsF64: |
| 1018 __ vabs(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 1018 __ vabs(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
| 1019 break; | 1019 break; |
| 1020 case kArmVnegF64: | 1020 case kArmVnegF64: |
| 1021 __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0)); | 1021 __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0)); |
| 1022 break; | 1022 break; |
| 1023 case kArmVrintmF32: | 1023 case kArmVrintmF32: |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 padding_size -= v8::internal::Assembler::kInstrSize; | 1770 padding_size -= v8::internal::Assembler::kInstrSize; |
| 1771 } | 1771 } |
| 1772 } | 1772 } |
| 1773 } | 1773 } |
| 1774 | 1774 |
| 1775 #undef __ | 1775 #undef __ |
| 1776 | 1776 |
| 1777 } // namespace compiler | 1777 } // namespace compiler |
| 1778 } // namespace internal | 1778 } // namespace internal |
| 1779 } // namespace v8 | 1779 } // namespace v8 |
| OLD | NEW |