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

Side by Side Diff: src/s390/simulator-s390.cc

Issue 2691893002: s390: use new mul instruction (Closed)
Patch Set: fix comment Created 3 years, 10 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 | « src/s390/simulator-s390.h ('k') | test/cctest/test-assembler-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 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 <stdarg.h> 5 #include <stdarg.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <cmath> 7 #include <cmath>
8 8
9 #if V8_TARGET_ARCH_S390 9 #if V8_TARGET_ARCH_S390
10 10
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 EvalTable[SAL] = &Simulator::Evaluate_SAL; 978 EvalTable[SAL] = &Simulator::Evaluate_SAL;
979 EvalTable[RSCH] = &Simulator::Evaluate_RSCH; 979 EvalTable[RSCH] = &Simulator::Evaluate_RSCH;
980 EvalTable[STCRW] = &Simulator::Evaluate_STCRW; 980 EvalTable[STCRW] = &Simulator::Evaluate_STCRW;
981 EvalTable[STCPS] = &Simulator::Evaluate_STCPS; 981 EvalTable[STCPS] = &Simulator::Evaluate_STCPS;
982 EvalTable[RCHP] = &Simulator::Evaluate_RCHP; 982 EvalTable[RCHP] = &Simulator::Evaluate_RCHP;
983 EvalTable[SCHM] = &Simulator::Evaluate_SCHM; 983 EvalTable[SCHM] = &Simulator::Evaluate_SCHM;
984 EvalTable[CKSM] = &Simulator::Evaluate_CKSM; 984 EvalTable[CKSM] = &Simulator::Evaluate_CKSM;
985 EvalTable[SAR] = &Simulator::Evaluate_SAR; 985 EvalTable[SAR] = &Simulator::Evaluate_SAR;
986 EvalTable[EAR] = &Simulator::Evaluate_EAR; 986 EvalTable[EAR] = &Simulator::Evaluate_EAR;
987 EvalTable[MSR] = &Simulator::Evaluate_MSR; 987 EvalTable[MSR] = &Simulator::Evaluate_MSR;
988 EvalTable[MSRKC] = &Simulator::Evaluate_MSRKC;
988 EvalTable[MVST] = &Simulator::Evaluate_MVST; 989 EvalTable[MVST] = &Simulator::Evaluate_MVST;
989 EvalTable[CUSE] = &Simulator::Evaluate_CUSE; 990 EvalTable[CUSE] = &Simulator::Evaluate_CUSE;
990 EvalTable[SRST] = &Simulator::Evaluate_SRST; 991 EvalTable[SRST] = &Simulator::Evaluate_SRST;
991 EvalTable[XSCH] = &Simulator::Evaluate_XSCH; 992 EvalTable[XSCH] = &Simulator::Evaluate_XSCH;
992 EvalTable[STCKE] = &Simulator::Evaluate_STCKE; 993 EvalTable[STCKE] = &Simulator::Evaluate_STCKE;
993 EvalTable[STCKF] = &Simulator::Evaluate_STCKF; 994 EvalTable[STCKF] = &Simulator::Evaluate_STCKF;
994 EvalTable[SRNM] = &Simulator::Evaluate_SRNM; 995 EvalTable[SRNM] = &Simulator::Evaluate_SRNM;
995 EvalTable[STFPC] = &Simulator::Evaluate_STFPC; 996 EvalTable[STFPC] = &Simulator::Evaluate_STFPC;
996 EvalTable[LFPC] = &Simulator::Evaluate_LFPC; 997 EvalTable[LFPC] = &Simulator::Evaluate_LFPC;
997 EvalTable[TRE] = &Simulator::Evaluate_TRE; 998 EvalTable[TRE] = &Simulator::Evaluate_TRE;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 EvalTable[LTGR] = &Simulator::Evaluate_LTGR; 1152 EvalTable[LTGR] = &Simulator::Evaluate_LTGR;
1152 EvalTable[LCGR] = &Simulator::Evaluate_LCGR; 1153 EvalTable[LCGR] = &Simulator::Evaluate_LCGR;
1153 EvalTable[LGR] = &Simulator::Evaluate_LGR; 1154 EvalTable[LGR] = &Simulator::Evaluate_LGR;
1154 EvalTable[LGBR] = &Simulator::Evaluate_LGBR; 1155 EvalTable[LGBR] = &Simulator::Evaluate_LGBR;
1155 EvalTable[LGHR] = &Simulator::Evaluate_LGHR; 1156 EvalTable[LGHR] = &Simulator::Evaluate_LGHR;
1156 EvalTable[AGR] = &Simulator::Evaluate_AGR; 1157 EvalTable[AGR] = &Simulator::Evaluate_AGR;
1157 EvalTable[SGR] = &Simulator::Evaluate_SGR; 1158 EvalTable[SGR] = &Simulator::Evaluate_SGR;
1158 EvalTable[ALGR] = &Simulator::Evaluate_ALGR; 1159 EvalTable[ALGR] = &Simulator::Evaluate_ALGR;
1159 EvalTable[SLGR] = &Simulator::Evaluate_SLGR; 1160 EvalTable[SLGR] = &Simulator::Evaluate_SLGR;
1160 EvalTable[MSGR] = &Simulator::Evaluate_MSGR; 1161 EvalTable[MSGR] = &Simulator::Evaluate_MSGR;
1162 EvalTable[MSGRKC] = &Simulator::Evaluate_MSGRKC;
1161 EvalTable[DSGR] = &Simulator::Evaluate_DSGR; 1163 EvalTable[DSGR] = &Simulator::Evaluate_DSGR;
1162 EvalTable[LRVGR] = &Simulator::Evaluate_LRVGR; 1164 EvalTable[LRVGR] = &Simulator::Evaluate_LRVGR;
1163 EvalTable[LPGFR] = &Simulator::Evaluate_LPGFR; 1165 EvalTable[LPGFR] = &Simulator::Evaluate_LPGFR;
1164 EvalTable[LNGFR] = &Simulator::Evaluate_LNGFR; 1166 EvalTable[LNGFR] = &Simulator::Evaluate_LNGFR;
1165 EvalTable[LTGFR] = &Simulator::Evaluate_LTGFR; 1167 EvalTable[LTGFR] = &Simulator::Evaluate_LTGFR;
1166 EvalTable[LCGFR] = &Simulator::Evaluate_LCGFR; 1168 EvalTable[LCGFR] = &Simulator::Evaluate_LCGFR;
1167 EvalTable[LGFR] = &Simulator::Evaluate_LGFR; 1169 EvalTable[LGFR] = &Simulator::Evaluate_LGFR;
1168 EvalTable[LLGFR] = &Simulator::Evaluate_LLGFR; 1170 EvalTable[LLGFR] = &Simulator::Evaluate_LLGFR;
1169 EvalTable[LLGTR] = &Simulator::Evaluate_LLGTR; 1171 EvalTable[LLGTR] = &Simulator::Evaluate_LLGTR;
1170 EvalTable[AGFR] = &Simulator::Evaluate_AGFR; 1172 EvalTable[AGFR] = &Simulator::Evaluate_AGFR;
(...skipping 7293 matching lines...) Expand 10 before | Expand all | Expand 10 after
8464 8466
8465 EVALUATE(MSR) { 8467 EVALUATE(MSR) {
8466 DCHECK_OPCODE(MSR); 8468 DCHECK_OPCODE(MSR);
8467 DECODE_RRE_INSTRUCTION(r1, r2); 8469 DECODE_RRE_INSTRUCTION(r1, r2);
8468 int32_t r1_val = get_low_register<int32_t>(r1); 8470 int32_t r1_val = get_low_register<int32_t>(r1);
8469 int32_t r2_val = get_low_register<int32_t>(r2); 8471 int32_t r2_val = get_low_register<int32_t>(r2);
8470 set_low_register(r1, r1_val * r2_val); 8472 set_low_register(r1, r1_val * r2_val);
8471 return length; 8473 return length;
8472 } 8474 }
8473 8475
8476 EVALUATE(MSRKC) {
8477 DCHECK_OPCODE(MSRKC);
8478 DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
8479 int32_t r2_val = get_low_register<int32_t>(r2);
8480 int32_t r3_val = get_low_register<int32_t>(r3);
8481 int64_t result64 =
8482 static_cast<int64_t>(r2_val) * static_cast<int64_t>(r3_val);
8483 int32_t result32 = static_cast<int32_t>(result64);
8484 bool isOF = (static_cast<int64_t>(result32) != result64);
8485 SetS390ConditionCode<int32_t>(result32, 0);
8486 SetS390OverflowCode(isOF);
8487 set_low_register(r1, result32);
8488 return length;
8489 }
8490
8474 EVALUATE(MVST) { 8491 EVALUATE(MVST) {
8475 UNIMPLEMENTED(); 8492 UNIMPLEMENTED();
8476 USE(instr); 8493 USE(instr);
8477 return 0; 8494 return 0;
8478 } 8495 }
8479 8496
8480 EVALUATE(CUSE) { 8497 EVALUATE(CUSE) {
8481 UNIMPLEMENTED(); 8498 UNIMPLEMENTED();
8482 USE(instr); 8499 USE(instr);
8483 return 0; 8500 return 0;
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
9989 10006
9990 EVALUATE(MSGR) { 10007 EVALUATE(MSGR) {
9991 DCHECK_OPCODE(MSGR); 10008 DCHECK_OPCODE(MSGR);
9992 DECODE_RRE_INSTRUCTION(r1, r2); 10009 DECODE_RRE_INSTRUCTION(r1, r2);
9993 int64_t r1_val = get_register(r1); 10010 int64_t r1_val = get_register(r1);
9994 int64_t r2_val = get_register(r2); 10011 int64_t r2_val = get_register(r2);
9995 set_register(r1, r1_val * r2_val); 10012 set_register(r1, r1_val * r2_val);
9996 return length; 10013 return length;
9997 } 10014 }
9998 10015
10016 EVALUATE(MSGRKC) {
10017 DCHECK_OPCODE(MSGRKC);
10018 DECODE_RRF_A_INSTRUCTION(r1, r2, r3);
10019 int64_t r2_val = get_register(r2);
10020 int64_t r3_val = get_register(r3);
10021 volatile int64_t result64 = r2_val * r3_val;
10022 bool isOF = ((r2_val == -1 && result64 == (static_cast<int64_t>(1L) << 63)) ||
10023 (r2_val != 0 && result64 / r2_val != r3_val));
10024 SetS390ConditionCode<int64_t>(result64, 0);
10025 SetS390OverflowCode(isOF);
10026 set_register(r1, result64);
10027 return length;
10028 }
10029
9999 EVALUATE(DSGR) { 10030 EVALUATE(DSGR) {
10000 DCHECK_OPCODE(DSGR); 10031 DCHECK_OPCODE(DSGR);
10001 DECODE_RRE_INSTRUCTION(r1, r2); 10032 DECODE_RRE_INSTRUCTION(r1, r2);
10002 10033
10003 DCHECK(r1 % 2 == 0); 10034 DCHECK(r1 % 2 == 0);
10004 10035
10005 int64_t dividend = get_register(r1 + 1); 10036 int64_t dividend = get_register(r1 + 1);
10006 int64_t divisor = get_register(r2); 10037 int64_t divisor = get_register(r2);
10007 set_register(r1, dividend % divisor); 10038 set_register(r1, dividend % divisor);
10008 set_register(r1 + 1, dividend / divisor); 10039 set_register(r1 + 1, dividend / divisor);
(...skipping 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after
12815 return 0; 12846 return 0;
12816 } 12847 }
12817 12848
12818 #undef EVALUATE 12849 #undef EVALUATE
12819 12850
12820 } // namespace internal 12851 } // namespace internal
12821 } // namespace v8 12852 } // namespace v8
12822 12853
12823 #endif // USE_SIMULATOR 12854 #endif // USE_SIMULATOR
12824 #endif // V8_TARGET_ARCH_S390 12855 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/s390/simulator-s390.h ('k') | test/cctest/test-assembler-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698