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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } while (0) | 400 } while (0) |
401 | 401 |
402 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ | 402 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr) \ |
403 do { \ | 403 do { \ |
404 __ dmb(ISH); \ | 404 __ dmb(ISH); \ |
405 __ asm_instr(i.InputRegister(2), \ | 405 __ asm_instr(i.InputRegister(2), \ |
406 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ | 406 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ |
407 __ dmb(ISH); \ | 407 __ dmb(ISH); \ |
408 } while (0) | 408 } while (0) |
409 | 409 |
| 410 #define ASSEMBLE_IEEE754_BINOP(name) \ |
| 411 do { \ |
| 412 /* TODO(bmeurer): We should really get rid of this special instruction, */ \ |
| 413 /* and generate a CallAddress instruction instead. */ \ |
| 414 FrameScope scope(masm(), StackFrame::MANUAL); \ |
| 415 __ PrepareCallCFunction(0, 2, kScratchReg); \ |
| 416 __ MovToFloatParameters(i.InputFloat64Register(0), \ |
| 417 i.InputFloat64Register(1)); \ |
| 418 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
| 419 0, 2); \ |
| 420 /* Move the result in the double result register. */ \ |
| 421 __ MovFromFloatResult(i.OutputFloat64Register()); \ |
| 422 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ |
| 423 } while (0) |
| 424 |
410 #define ASSEMBLE_IEEE754_UNOP(name) \ | 425 #define ASSEMBLE_IEEE754_UNOP(name) \ |
411 do { \ | 426 do { \ |
412 /* TODO(bmeurer): We should really get rid of this special instruction, */ \ | 427 /* TODO(bmeurer): We should really get rid of this special instruction, */ \ |
413 /* and generate a CallAddress instruction instead. */ \ | 428 /* and generate a CallAddress instruction instead. */ \ |
414 FrameScope scope(masm(), StackFrame::MANUAL); \ | 429 FrameScope scope(masm(), StackFrame::MANUAL); \ |
415 __ PrepareCallCFunction(0, 1, kScratchReg); \ | 430 __ PrepareCallCFunction(0, 1, kScratchReg); \ |
416 __ MovToFloatParameter(i.InputFloat64Register(0)); \ | 431 __ MovToFloatParameter(i.InputFloat64Register(0)); \ |
417 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ | 432 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \ |
418 0, 1); \ | 433 0, 1); \ |
419 /* Move the result in the double result register. */ \ | 434 /* Move the result in the double result register. */ \ |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 696 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
682 Register base; | 697 Register base; |
683 if (offset.from_stack_pointer()) { | 698 if (offset.from_stack_pointer()) { |
684 base = sp; | 699 base = sp; |
685 } else { | 700 } else { |
686 base = fp; | 701 base = fp; |
687 } | 702 } |
688 __ add(i.OutputRegister(0), base, Operand(offset.offset())); | 703 __ add(i.OutputRegister(0), base, Operand(offset.offset())); |
689 break; | 704 break; |
690 } | 705 } |
| 706 case kIeee754Float64Atan: |
| 707 ASSEMBLE_IEEE754_UNOP(atan); |
| 708 break; |
| 709 case kIeee754Float64Atan2: |
| 710 ASSEMBLE_IEEE754_BINOP(atan2); |
| 711 break; |
691 case kIeee754Float64Log: | 712 case kIeee754Float64Log: |
692 ASSEMBLE_IEEE754_UNOP(log); | 713 ASSEMBLE_IEEE754_UNOP(log); |
693 break; | 714 break; |
694 case kIeee754Float64Log1p: | 715 case kIeee754Float64Log1p: |
695 ASSEMBLE_IEEE754_UNOP(log1p); | 716 ASSEMBLE_IEEE754_UNOP(log1p); |
696 break; | 717 break; |
697 case kArmAdd: | 718 case kArmAdd: |
698 __ add(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), | 719 __ add(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1), |
699 i.OutputSBit()); | 720 i.OutputSBit()); |
700 break; | 721 break; |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1777 padding_size -= v8::internal::Assembler::kInstrSize; | 1798 padding_size -= v8::internal::Assembler::kInstrSize; |
1778 } | 1799 } |
1779 } | 1800 } |
1780 } | 1801 } |
1781 | 1802 |
1782 #undef __ | 1803 #undef __ |
1783 | 1804 |
1784 } // namespace compiler | 1805 } // namespace compiler |
1785 } // namespace internal | 1806 } // namespace internal |
1786 } // namespace v8 | 1807 } // namespace v8 |
OLD | NEW |