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

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

Issue 2265073003: S390: Optimize For Mul in TurboFan codegen (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/macro-assembler-s390.cc ('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 3d11bacfdcc064897be0f0fb45265c8341249378..dd9ebcf9c637310534afddfb35284c2a6986e079 100644
--- a/src/s390/simulator-s390.cc
+++ b/src/s390/simulator-s390.cc
@@ -6584,7 +6584,6 @@ EVALUATE(MR) {
int32_t low_bits = product & 0x00000000FFFFFFFF;
set_low_register(r1, high_bits);
set_low_register(r1 + 1, low_bits);
- set_low_register(r1, r1_val);
return length;
}
@@ -6940,9 +6939,22 @@ EVALUATE(S) {
}
EVALUATE(M) {
- UNIMPLEMENTED();
- USE(instr);
- return 0;
+ DCHECK_OPCODE(M);
+ DECODE_RX_A_INSTRUCTION(x2, b2, r1, d2_val);
+ int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
+ int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
+ intptr_t addr = b2_val + x2_val + d2_val;
+ DCHECK(r1 % 2 == 0);
+ int32_t mem_val = ReadW(addr, instr);
+ int32_t r1_val = get_low_register<int32_t>(r1 + 1);
+ int64_t product =
+ static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val);
+ int32_t high_bits = product >> 32;
+ r1_val = high_bits;
+ int32_t low_bits = product & 0x00000000FFFFFFFF;
+ set_low_register(r1, high_bits);
+ set_low_register(r1 + 1, low_bits);
+ return length;
}
EVALUATE(D) {
@@ -11156,9 +11168,21 @@ EVALUATE(SY) {
}
EVALUATE(MFY) {
- UNIMPLEMENTED();
- USE(instr);
- return 0;
+ DCHECK_OPCODE(MFY);
+ DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2);
+ int64_t x2_val = (x2 == 0) ? 0 : get_register(x2);
+ int64_t b2_val = (b2 == 0) ? 0 : get_register(b2);
+ DCHECK(r1 % 2 == 0);
+ int32_t mem_val = ReadW(b2_val + x2_val + d2, instr);
+ int32_t r1_val = get_low_register<int32_t>(r1 + 1);
+ int64_t product =
+ static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val);
+ int32_t high_bits = product >> 32;
+ r1_val = high_bits;
+ int32_t low_bits = product & 0x00000000FFFFFFFF;
+ set_low_register(r1, high_bits);
+ set_low_register(r1 + 1, low_bits);
+ return length;
}
EVALUATE(ALY) {
« no previous file with comments | « src/s390/macro-assembler-s390.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698