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

Unified Diff: src/s390/simulator-s390.cc

Issue 2795803003: s390: exploit new mul in TF (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/s390/simulator-s390.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/simulator-s390.cc
diff --git a/src/s390/simulator-s390.cc b/src/s390/simulator-s390.cc
index b669dcb20701c8bebd1fe3e7dfd5cda3574aa094..b0fa0917ad7ecad6a12657f9976d39f1aaba8a05 100644
--- a/src/s390/simulator-s390.cc
+++ b/src/s390/simulator-s390.cc
@@ -1300,6 +1300,7 @@ void Simulator::EvalTableInit() {
EvalTable[BCTG] = &Simulator::Evaluate_BCTG;
EvalTable[STY] = &Simulator::Evaluate_STY;
EvalTable[MSY] = &Simulator::Evaluate_MSY;
+ EvalTable[MSC] = &Simulator::Evaluate_MSC;
EvalTable[NY] = &Simulator::Evaluate_NY;
EvalTable[CLY] = &Simulator::Evaluate_CLY;
EvalTable[OY] = &Simulator::Evaluate_OY;
@@ -8157,6 +8158,25 @@ EVALUATE(MSY) {
return length;
}
+EVALUATE(MSC) {
+ DCHECK_OPCODE(MSC);
+ DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
+ int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
+ int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
+ intptr_t d2_val = d2;
+ int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr);
+ int32_t r1_val = get_low_register<int32_t>(r1);
+ int64_t result64 =
+ static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val);
+ int32_t result32 = static_cast<int32_t>(result64);
+ bool isOF = (static_cast<int64_t>(result32) != result64);
+ SetS390ConditionCode<int32_t>(result32, 0);
+ SetS390OverflowCode(isOF);
+ set_low_register(r1, result32);
+ set_low_register(r1, mem_val * r1_val);
+ return length;
+}
+
EVALUATE(NY) {
DCHECK_OPCODE(NY);
DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
« no previous file with comments | « src/s390/simulator-s390.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698