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

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

Issue 2645233002: X87: [wasm] Fix codegen issue for i64.add and i64.sub on ia32. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compilation-info.h" 7 #include "src/compilation-info.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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 if (i.OutputRegister(0).code() == i.InputRegister(1).code() || 987 if (i.OutputRegister(0).code() == i.InputRegister(1).code() ||
988 i.OutputRegister(0).code() == i.InputRegister(3).code()) { 988 i.OutputRegister(0).code() == i.InputRegister(3).code()) {
989 // We cannot write to the output register directly, because it would 989 // We cannot write to the output register directly, because it would
990 // overwrite an input for adc. We have to use the temp register. 990 // overwrite an input for adc. We have to use the temp register.
991 use_temp = true; 991 use_temp = true;
992 __ Move(i.TempRegister(0), i.InputRegister(0)); 992 __ Move(i.TempRegister(0), i.InputRegister(0));
993 __ add(i.TempRegister(0), i.InputRegister(2)); 993 __ add(i.TempRegister(0), i.InputRegister(2));
994 } else { 994 } else {
995 __ add(i.OutputRegister(0), i.InputRegister(2)); 995 __ add(i.OutputRegister(0), i.InputRegister(2));
996 } 996 }
997 __ adc(i.InputRegister(1), Operand(i.InputRegister(3)));
998 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { 997 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) {
999 __ Move(i.OutputRegister(1), i.InputRegister(1)); 998 __ Move(i.OutputRegister(1), i.InputRegister(1));
1000 } 999 }
1000 __ adc(i.OutputRegister(1), Operand(i.InputRegister(3)));
1001 if (use_temp) { 1001 if (use_temp) {
1002 __ Move(i.OutputRegister(0), i.TempRegister(0)); 1002 __ Move(i.OutputRegister(0), i.TempRegister(0));
1003 } 1003 }
1004 break; 1004 break;
1005 } 1005 }
1006 case kX87SubPair: { 1006 case kX87SubPair: {
1007 // i.OutputRegister(0) == i.InputRegister(0) ... left low word. 1007 // i.OutputRegister(0) == i.InputRegister(0) ... left low word.
1008 // i.InputRegister(1) ... left high word. 1008 // i.InputRegister(1) ... left high word.
1009 // i.InputRegister(2) ... right low word. 1009 // i.InputRegister(2) ... right low word.
1010 // i.InputRegister(3) ... right high word. 1010 // i.InputRegister(3) ... right high word.
1011 bool use_temp = false; 1011 bool use_temp = false;
1012 if (i.OutputRegister(0).code() == i.InputRegister(1).code() || 1012 if (i.OutputRegister(0).code() == i.InputRegister(1).code() ||
1013 i.OutputRegister(0).code() == i.InputRegister(3).code()) { 1013 i.OutputRegister(0).code() == i.InputRegister(3).code()) {
1014 // We cannot write to the output register directly, because it would 1014 // We cannot write to the output register directly, because it would
1015 // overwrite an input for adc. We have to use the temp register. 1015 // overwrite an input for adc. We have to use the temp register.
1016 use_temp = true; 1016 use_temp = true;
1017 __ Move(i.TempRegister(0), i.InputRegister(0)); 1017 __ Move(i.TempRegister(0), i.InputRegister(0));
1018 __ sub(i.TempRegister(0), i.InputRegister(2)); 1018 __ sub(i.TempRegister(0), i.InputRegister(2));
1019 } else { 1019 } else {
1020 __ sub(i.OutputRegister(0), i.InputRegister(2)); 1020 __ sub(i.OutputRegister(0), i.InputRegister(2));
1021 } 1021 }
1022 __ sbb(i.InputRegister(1), Operand(i.InputRegister(3)));
1023 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { 1022 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) {
1024 __ Move(i.OutputRegister(1), i.InputRegister(1)); 1023 __ Move(i.OutputRegister(1), i.InputRegister(1));
1025 } 1024 }
1025 __ sbb(i.OutputRegister(1), Operand(i.InputRegister(3)));
1026 if (use_temp) { 1026 if (use_temp) {
1027 __ Move(i.OutputRegister(0), i.TempRegister(0)); 1027 __ Move(i.OutputRegister(0), i.TempRegister(0));
1028 } 1028 }
1029 break; 1029 break;
1030 } 1030 }
1031 case kX87MulPair: { 1031 case kX87MulPair: {
1032 __ imul(i.OutputRegister(1), i.InputOperand(0)); 1032 __ imul(i.OutputRegister(1), i.InputOperand(0));
1033 __ mov(i.TempRegister(0), i.InputOperand(1)); 1033 __ mov(i.TempRegister(0), i.InputOperand(1));
1034 __ imul(i.TempRegister(0), i.InputOperand(2)); 1034 __ imul(i.TempRegister(0), i.InputOperand(2));
1035 __ add(i.OutputRegister(1), i.TempRegister(0)); 1035 __ add(i.OutputRegister(1), i.TempRegister(0));
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2736 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2737 __ Nop(padding_size); 2737 __ Nop(padding_size);
2738 } 2738 }
2739 } 2739 }
2740 2740
2741 #undef __ 2741 #undef __
2742 2742
2743 } // namespace compiler 2743 } // namespace compiler
2744 } // namespace internal 2744 } // namespace internal
2745 } // namespace v8 2745 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698