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

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

Issue 2270523002: S390: Implemente Multiply-Logical (ML) for simulator (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 | « no previous file | 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 dd9ebcf9c637310534afddfb35284c2a6986e079..91db78226b23f82fc7ee20546ccfb60a0ddd2f1a 100644
--- a/src/s390/simulator-s390.cc
+++ b/src/s390/simulator-s390.cc
@@ -11452,9 +11452,21 @@ EVALUATE(LLH) {
}
EVALUATE(ML) {
- UNIMPLEMENTED();
- USE(instr);
- return 0;
+ DCHECK_OPCODE(ML);
+ 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);
+ uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr);
+ uint32_t r1_val = get_low_register<uint32_t>(r1 + 1);
+ uint64_t product =
+ static_cast<uint64_t>(r1_val) * static_cast<uint64_t>(mem_val);
+ uint32_t high_bits = product >> 32;
+ r1_val = high_bits;
+ uint32_t low_bits = product & 0x00000000FFFFFFFF;
+ set_low_register(r1, high_bits);
+ set_low_register(r1 + 1, low_bits);
+ return length;
}
EVALUATE(DL) {
« 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