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

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

Issue 1778893005: [wasm] Int64Lowering of Int64Sub on ia32 and arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-add
Patch Set: Created 4 years, 9 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 } 698 }
699 __ adc(i.InputRegister(1), Operand(i.InputRegister(3))); 699 __ adc(i.InputRegister(1), Operand(i.InputRegister(3)));
700 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { 700 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) {
701 __ Move(i.OutputRegister(1), i.InputRegister(1)); 701 __ Move(i.OutputRegister(1), i.InputRegister(1));
702 } 702 }
703 if (use_temp) { 703 if (use_temp) {
704 __ Move(i.OutputRegister(0), i.TempRegister(0)); 704 __ Move(i.OutputRegister(0), i.TempRegister(0));
705 } 705 }
706 break; 706 break;
707 } 707 }
708 case kIA32SubPair: {
709 // i.OutputRegister(0) == i.InputRegister(0) ... left low word.
710 // i.InputRegister(1) ... left high word.
711 // i.InputRegister(2) ... right low word.
712 // i.InputRegister(3) ... right high word.
713 bool use_temp = false;
714 if (i.OutputRegister(0).code() == i.InputRegister(1).code() ||
715 i.OutputRegister(0).code() == i.InputRegister(3).code()) {
716 // We cannot write to the output register directly, because it would
717 // overwrite an input for adc. We have to use the temp register.
718 use_temp = true;
719 __ Move(i.TempRegister(0), i.InputRegister(0));
720 __ sub(i.TempRegister(0), i.InputRegister(2));
721 } else {
722 __ sub(i.OutputRegister(0), i.InputRegister(2));
723 }
724 __ sbb(i.InputRegister(1), Operand(i.InputRegister(3)));
725 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) {
726 __ Move(i.OutputRegister(1), i.InputRegister(1));
727 }
728 if (use_temp) {
729 __ Move(i.OutputRegister(0), i.TempRegister(0));
730 }
731 break;
732 }
708 case kIA32ShlPair: 733 case kIA32ShlPair:
709 if (HasImmediateInput(instr, 2)) { 734 if (HasImmediateInput(instr, 2)) {
710 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); 735 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2));
711 } else { 736 } else {
712 // Shift has been loaded into CL by the register allocator. 737 // Shift has been loaded into CL by the register allocator.
713 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); 738 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0));
714 } 739 }
715 break; 740 break;
716 case kIA32ShrPair: 741 case kIA32ShrPair:
717 if (HasImmediateInput(instr, 2)) { 742 if (HasImmediateInput(instr, 2)) {
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 1877 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
1853 __ Nop(padding_size); 1878 __ Nop(padding_size);
1854 } 1879 }
1855 } 1880 }
1856 1881
1857 #undef __ 1882 #undef __
1858 1883
1859 } // namespace compiler 1884 } // namespace compiler
1860 } // namespace internal 1885 } // namespace internal
1861 } // namespace v8 1886 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698