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

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

Issue 1947263006: Version 5.1.281.30 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: Created 4 years, 7 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 | « include/v8-version.h ('k') | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 break; 806 break;
807 case kS390_OrComplement: 807 case kS390_OrComplement:
808 __ NotP(i.InputRegister(1)); 808 __ NotP(i.InputRegister(1));
809 __ OrP(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); 809 __ OrP(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
810 break; 810 break;
811 case kS390_Xor: 811 case kS390_Xor:
812 ASSEMBLE_BINOP(XorP, XorP); 812 ASSEMBLE_BINOP(XorP, XorP);
813 break; 813 break;
814 case kS390_ShiftLeft32: 814 case kS390_ShiftLeft32:
815 if (HasRegisterInput(instr, 1)) { 815 if (HasRegisterInput(instr, 1)) {
816 if (i.OutputRegister().is(i.InputRegister(1))) { 816 if (i.OutputRegister().is(i.InputRegister(1)) &&
817 !CpuFeatures::IsSupported(DISTINCT_OPS)) {
817 __ LoadRR(kScratchReg, i.InputRegister(1)); 818 __ LoadRR(kScratchReg, i.InputRegister(1));
818 __ ShiftLeft(i.OutputRegister(), i.InputRegister(0), kScratchReg); 819 __ ShiftLeft(i.OutputRegister(), i.InputRegister(0), kScratchReg);
819 } else { 820 } else {
820 ASSEMBLE_BINOP(ShiftLeft, ShiftLeft); 821 ASSEMBLE_BINOP(ShiftLeft, ShiftLeft);
821 } 822 }
822 } else { 823 } else {
823 ASSEMBLE_BINOP(ShiftLeft, ShiftLeft); 824 ASSEMBLE_BINOP(ShiftLeft, ShiftLeft);
824 } 825 }
825 #if V8_TARGET_ARCH_S390X 826 __ LoadlW(i.OutputRegister(0), i.OutputRegister(0));
826 __ lgfr(i.OutputRegister(0), i.OutputRegister(0));
827 #endif
828 break; 827 break;
829 #if V8_TARGET_ARCH_S390X 828 #if V8_TARGET_ARCH_S390X
830 case kS390_ShiftLeft64: 829 case kS390_ShiftLeft64:
831 ASSEMBLE_BINOP(sllg, sllg); 830 ASSEMBLE_BINOP(sllg, sllg);
832 break; 831 break;
833 #endif 832 #endif
834 case kS390_ShiftRight32: 833 case kS390_ShiftRight32:
835 if (HasRegisterInput(instr, 1)) { 834 if (HasRegisterInput(instr, 1)) {
836 if (i.OutputRegister().is(i.InputRegister(1))) { 835 if (i.OutputRegister().is(i.InputRegister(1)) &&
836 !CpuFeatures::IsSupported(DISTINCT_OPS)) {
837 __ LoadRR(kScratchReg, i.InputRegister(1)); 837 __ LoadRR(kScratchReg, i.InputRegister(1));
838 __ ShiftRight(i.OutputRegister(), i.InputRegister(0), kScratchReg); 838 __ ShiftRight(i.OutputRegister(), i.InputRegister(0), kScratchReg);
839 } else { 839 } else {
840 ASSEMBLE_BINOP(ShiftRight, ShiftRight); 840 ASSEMBLE_BINOP(ShiftRight, ShiftRight);
841 } 841 }
842 } else { 842 } else {
843 ASSEMBLE_BINOP(ShiftRight, ShiftRight); 843 ASSEMBLE_BINOP(ShiftRight, ShiftRight);
844 } 844 }
845 #if V8_TARGET_ARCH_S390X 845 __ LoadlW(i.OutputRegister(0), i.OutputRegister(0));
846 __ lgfr(i.OutputRegister(0), i.OutputRegister(0));
847 #endif
848 break; 846 break;
849 #if V8_TARGET_ARCH_S390X 847 #if V8_TARGET_ARCH_S390X
850 case kS390_ShiftRight64: 848 case kS390_ShiftRight64:
851 ASSEMBLE_BINOP(srlg, srlg); 849 ASSEMBLE_BINOP(srlg, srlg);
852 break; 850 break;
853 #endif 851 #endif
854 case kS390_ShiftRightArith32: 852 case kS390_ShiftRightArith32:
855 if (HasRegisterInput(instr, 1)) { 853 if (HasRegisterInput(instr, 1)) {
856 if (i.OutputRegister().is(i.InputRegister(1))) { 854 if (i.OutputRegister().is(i.InputRegister(1)) &&
855 !CpuFeatures::IsSupported(DISTINCT_OPS)) {
857 __ LoadRR(kScratchReg, i.InputRegister(1)); 856 __ LoadRR(kScratchReg, i.InputRegister(1));
858 __ ShiftRightArith(i.OutputRegister(), i.InputRegister(0), 857 __ ShiftRightArith(i.OutputRegister(), i.InputRegister(0),
859 kScratchReg); 858 kScratchReg);
860 } else { 859 } else {
861 ASSEMBLE_BINOP(ShiftRightArith, ShiftRightArith); 860 ASSEMBLE_BINOP(ShiftRightArith, ShiftRightArith);
862 } 861 }
863 } else { 862 } else {
864 ASSEMBLE_BINOP(ShiftRightArith, ShiftRightArith); 863 ASSEMBLE_BINOP(ShiftRightArith, ShiftRightArith);
865 } 864 }
865 __ LoadlW(i.OutputRegister(), i.OutputRegister());
866 break; 866 break;
867 #if V8_TARGET_ARCH_S390X 867 #if V8_TARGET_ARCH_S390X
868 case kS390_ShiftRightArith64: 868 case kS390_ShiftRightArith64:
869 ASSEMBLE_BINOP(srag, srag); 869 ASSEMBLE_BINOP(srag, srag);
870 break; 870 break;
871 #endif 871 #endif
872 #if !V8_TARGET_ARCH_S390X 872 #if !V8_TARGET_ARCH_S390X
873 case kS390_AddPair: 873 case kS390_AddPair:
874 // i.InputRegister(0) ... left low word. 874 // i.InputRegister(0) ... left low word.
875 // i.InputRegister(1) ... left high word. 875 // i.InputRegister(1) ... left high word.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 break; 1091 break;
1092 case kS390_Mul32: 1092 case kS390_Mul32:
1093 #if V8_TARGET_ARCH_S390X 1093 #if V8_TARGET_ARCH_S390X
1094 case kS390_Mul64: 1094 case kS390_Mul64:
1095 #endif 1095 #endif
1096 __ Mul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); 1096 __ Mul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
1097 break; 1097 break;
1098 case kS390_MulHigh32: 1098 case kS390_MulHigh32:
1099 __ LoadRR(r1, i.InputRegister(0)); 1099 __ LoadRR(r1, i.InputRegister(0));
1100 __ mr_z(r0, i.InputRegister(1)); 1100 __ mr_z(r0, i.InputRegister(1));
1101 __ LoadRR(i.OutputRegister(), r0); 1101 __ LoadW(i.OutputRegister(), r0);
1102 break; 1102 break;
1103 case kS390_MulHighU32: 1103 case kS390_MulHighU32:
1104 __ LoadRR(r1, i.InputRegister(0)); 1104 __ LoadRR(r1, i.InputRegister(0));
1105 __ mlr(r0, i.InputRegister(1)); 1105 __ mlr(r0, i.InputRegister(1));
1106 __ LoadRR(i.OutputRegister(), r0); 1106 __ LoadlW(i.OutputRegister(), r0);
1107 break; 1107 break;
1108 case kS390_MulFloat: 1108 case kS390_MulFloat:
1109 // Ensure we don't clobber right 1109 // Ensure we don't clobber right
1110 if (i.OutputDoubleRegister().is(i.InputDoubleRegister(1))) { 1110 if (i.OutputDoubleRegister().is(i.InputDoubleRegister(1))) {
1111 ASSEMBLE_FLOAT_UNOP(meebr); 1111 ASSEMBLE_FLOAT_UNOP(meebr);
1112 } else { 1112 } else {
1113 if (!i.OutputDoubleRegister().is(i.InputDoubleRegister(0))) 1113 if (!i.OutputDoubleRegister().is(i.InputDoubleRegister(0)))
1114 __ ldr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 1114 __ ldr(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
1115 __ meebr(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); 1115 __ meebr(i.OutputDoubleRegister(), i.InputDoubleRegister(1));
1116 } 1116 }
(...skipping 12 matching lines...) Expand all
1129 case kS390_Div64: 1129 case kS390_Div64:
1130 __ LoadRR(r1, i.InputRegister(0)); 1130 __ LoadRR(r1, i.InputRegister(0));
1131 __ dsgr(r0, i.InputRegister(1)); // R1: Dividend 1131 __ dsgr(r0, i.InputRegister(1)); // R1: Dividend
1132 __ ltgr(i.OutputRegister(), r1); // Copy R1: Quotient to output 1132 __ ltgr(i.OutputRegister(), r1); // Copy R1: Quotient to output
1133 break; 1133 break;
1134 #endif 1134 #endif
1135 case kS390_Div32: 1135 case kS390_Div32:
1136 __ LoadRR(r0, i.InputRegister(0)); 1136 __ LoadRR(r0, i.InputRegister(0));
1137 __ srda(r0, Operand(32)); 1137 __ srda(r0, Operand(32));
1138 __ dr(r0, i.InputRegister(1)); 1138 __ dr(r0, i.InputRegister(1));
1139 __ ltr(i.OutputRegister(), r1); 1139 __ LoadAndTestP_ExtendSrc(i.OutputRegister(),
1140 r1); // Copy R1: Quotient to output
1140 break; 1141 break;
1141 #if V8_TARGET_ARCH_S390X 1142 #if V8_TARGET_ARCH_S390X
1142 case kS390_DivU64: 1143 case kS390_DivU64:
1143 __ LoadRR(r1, i.InputRegister(0)); 1144 __ LoadRR(r1, i.InputRegister(0));
1144 __ LoadImmP(r0, Operand::Zero()); 1145 __ LoadImmP(r0, Operand::Zero());
1145 __ dlgr(r0, i.InputRegister(1)); // R0:R1: Dividend 1146 __ dlgr(r0, i.InputRegister(1)); // R0:R1: Dividend
1146 __ ltgr(i.OutputRegister(), r1); // Copy R1: Quotient to output 1147 __ ltgr(i.OutputRegister(), r1); // Copy R1: Quotient to output
1147 break; 1148 break;
1148 #endif 1149 #endif
1149 case kS390_DivU32: 1150 case kS390_DivU32:
1150 __ LoadRR(r0, i.InputRegister(0)); 1151 __ LoadRR(r0, i.InputRegister(0));
1151 __ srdl(r0, Operand(32)); 1152 __ srdl(r0, Operand(32));
1152 __ dlr(r0, i.InputRegister(1)); // R0:R1: Dividend 1153 __ dlr(r0, i.InputRegister(1)); // R0:R1: Dividend
1153 __ ltr(i.OutputRegister(), r1); // Copy R1: Quotient to output 1154 __ LoadlW(i.OutputRegister(), r1); // Copy R1: Quotient to output
1155 __ LoadAndTestP_ExtendSrc(r1, r1);
1154 break; 1156 break;
1155 1157
1156 case kS390_DivFloat: 1158 case kS390_DivFloat:
1157 // InputDoubleRegister(1)=InputDoubleRegister(0)/InputDoubleRegister(1) 1159 // InputDoubleRegister(1)=InputDoubleRegister(0)/InputDoubleRegister(1)
1158 if (i.OutputDoubleRegister().is(i.InputDoubleRegister(1))) { 1160 if (i.OutputDoubleRegister().is(i.InputDoubleRegister(1))) {
1159 __ ldr(kScratchDoubleReg, i.InputDoubleRegister(1)); 1161 __ ldr(kScratchDoubleReg, i.InputDoubleRegister(1));
1160 __ ldr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); 1162 __ ldr(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
1161 __ debr(i.OutputDoubleRegister(), kScratchDoubleReg); 1163 __ debr(i.OutputDoubleRegister(), kScratchDoubleReg);
1162 } else { 1164 } else {
1163 if (!i.OutputDoubleRegister().is(i.InputDoubleRegister(0))) 1165 if (!i.OutputDoubleRegister().is(i.InputDoubleRegister(0)))
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 break; 1287 break;
1286 case kS390_CmpDouble: 1288 case kS390_CmpDouble:
1287 __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); 1289 __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
1288 break; 1290 break;
1289 case kS390_Tst32: 1291 case kS390_Tst32:
1290 if (HasRegisterInput(instr, 1)) { 1292 if (HasRegisterInput(instr, 1)) {
1291 __ AndP(r0, i.InputRegister(0), i.InputRegister(1)); 1293 __ AndP(r0, i.InputRegister(0), i.InputRegister(1));
1292 } else { 1294 } else {
1293 __ AndP(r0, i.InputRegister(0), i.InputImmediate(1)); 1295 __ AndP(r0, i.InputRegister(0), i.InputImmediate(1));
1294 } 1296 }
1295 #if V8_TARGET_ARCH_S390X 1297 __ LoadAndTestP_ExtendSrc(r0, r0);
1296 // TODO(john.yan): use ltgfr here.
1297 __ lgfr(r0, r0);
1298 __ LoadAndTestP(r0, r0);
1299 #endif
1300 break; 1298 break;
1301 #if V8_TARGET_ARCH_S390X 1299 #if V8_TARGET_ARCH_S390X
1302 case kS390_Tst64: 1300 case kS390_Tst64:
1303 if (HasRegisterInput(instr, 1)) { 1301 if (HasRegisterInput(instr, 1)) {
1304 __ AndP(r0, i.InputRegister(0), i.InputRegister(1)); 1302 __ AndP(r0, i.InputRegister(0), i.InputRegister(1));
1305 } else { 1303 } else {
1306 __ AndP(r0, i.InputRegister(0), i.InputImmediate(1)); 1304 __ AndP(r0, i.InputRegister(0), i.InputImmediate(1));
1307 } 1305 }
1308 break; 1306 break;
1309 #endif 1307 #endif
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 padding_size -= 2; 2075 padding_size -= 2;
2078 } 2076 }
2079 } 2077 }
2080 } 2078 }
2081 2079
2082 #undef __ 2080 #undef __
2083 2081
2084 } // namespace compiler 2082 } // namespace compiler
2085 } // namespace internal 2083 } // namespace internal
2086 } // namespace v8 2084 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698