Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 2053893003: [builtins] Introduce proper base::ieee754::log. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: BUILD.gn Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 frame_access_state()->GetFrameOffset(i.InputInt32(0)); 610 frame_access_state()->GetFrameOffset(i.InputInt32(0));
611 Register base; 611 Register base;
612 if (offset.from_stack_pointer()) { 612 if (offset.from_stack_pointer()) {
613 base = esp; 613 base = esp;
614 } else { 614 } else {
615 base = ebp; 615 base = ebp;
616 } 616 }
617 __ lea(i.OutputRegister(), Operand(base, offset.offset())); 617 __ lea(i.OutputRegister(), Operand(base, offset.offset()));
618 break; 618 break;
619 } 619 }
620 case kIeee754Float64Log: {
621 // Pass one double as argument on the stack.
622 __ PrepareCallCFunction(2, eax);
623 __ movsd(Operand(esp, 0 * kDoubleSize), i.InputDoubleRegister(0));
624 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 2);
625 // Return value is in st(0) on ia32.
626 // Store it into the result register.
627 __ sub(esp, Immediate(kDoubleSize));
628 __ fstp_d(Operand(esp, 0));
629 __ movsd(i.OutputDoubleRegister(), Operand(esp, 0));
630 __ add(esp, Immediate(kDoubleSize));
631 break;
632 }
620 case kIA32Add: 633 case kIA32Add:
621 if (HasImmediateInput(instr, 1)) { 634 if (HasImmediateInput(instr, 1)) {
622 __ add(i.InputOperand(0), i.InputImmediate(1)); 635 __ add(i.InputOperand(0), i.InputImmediate(1));
623 } else { 636 } else {
624 __ add(i.InputRegister(0), i.InputOperand(1)); 637 __ add(i.InputRegister(0), i.InputOperand(1));
625 } 638 }
626 break; 639 break;
627 case kIA32And: 640 case kIA32And:
628 if (HasImmediateInput(instr, 1)) { 641 if (HasImmediateInput(instr, 1)) {
629 __ and_(i.InputOperand(0), i.InputImmediate(1)); 642 __ and_(i.InputOperand(0), i.InputImmediate(1));
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 break; 826 break;
814 case kIA32Lzcnt: 827 case kIA32Lzcnt:
815 __ Lzcnt(i.OutputRegister(), i.InputOperand(0)); 828 __ Lzcnt(i.OutputRegister(), i.InputOperand(0));
816 break; 829 break;
817 case kIA32Tzcnt: 830 case kIA32Tzcnt:
818 __ Tzcnt(i.OutputRegister(), i.InputOperand(0)); 831 __ Tzcnt(i.OutputRegister(), i.InputOperand(0));
819 break; 832 break;
820 case kIA32Popcnt: 833 case kIA32Popcnt:
821 __ Popcnt(i.OutputRegister(), i.InputOperand(0)); 834 __ Popcnt(i.OutputRegister(), i.InputOperand(0));
822 break; 835 break;
823 case kX87Float64Log:
824 __ sub(esp, Immediate(kDoubleSize));
825 __ movsd(Operand(esp, 0), i.InputDoubleRegister(0));
826 __ fldln2();
827 __ fld_d(Operand(esp, 0));
828 __ fyl2x();
829 __ fstp_d(Operand(esp, 0));
830 __ movsd(i.OutputDoubleRegister(), Operand(esp, 0));
831 __ add(esp, Immediate(kDoubleSize));
832 break;
833 case kSSEFloat32Cmp: 836 case kSSEFloat32Cmp:
834 __ ucomiss(i.InputDoubleRegister(0), i.InputOperand(1)); 837 __ ucomiss(i.InputDoubleRegister(0), i.InputOperand(1));
835 break; 838 break;
836 case kSSEFloat32Add: 839 case kSSEFloat32Add:
837 __ addss(i.InputDoubleRegister(0), i.InputOperand(1)); 840 __ addss(i.InputDoubleRegister(0), i.InputOperand(1));
838 break; 841 break;
839 case kSSEFloat32Sub: 842 case kSSEFloat32Sub:
840 __ subss(i.InputDoubleRegister(0), i.InputOperand(1)); 843 __ subss(i.InputDoubleRegister(0), i.InputOperand(1));
841 break; 844 break;
842 case kSSEFloat32Mul: 845 case kSSEFloat32Mul:
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1975 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1973 __ Nop(padding_size); 1976 __ Nop(padding_size);
1974 } 1977 }
1975 } 1978 }
1976 1979
1977 #undef __ 1980 #undef __
1978 1981
1979 } // namespace compiler 1982 } // namespace compiler
1980 } // namespace internal 1983 } // namespace internal
1981 } // namespace v8 1984 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/ia32/instruction-codes-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698