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

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

Issue 1835973003: S390: Impl Left/Right Logical/Arith Shift Pair (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update srda and srdl disasm format Created 4 years, 9 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 75ed0fd2c6b742a18329f1e697e5213f536c96d9..2aebdd8f930808e4243c5451c106e6325d5aa5af 100644
--- a/src/s390/simulator-s390.cc
+++ b/src/s390/simulator-s390.cc
@@ -2191,6 +2191,25 @@ bool Simulator::DecodeFourByte(Instruction* instr) {
set_low_register(r1, alu_out);
break;
}
+ case SLDL: {
+ RSInstruction* rsInstr = reinterpret_cast<RSInstruction*>(instr);
+ int r1 = rsInstr->R1Value();
+ int b2 = rsInstr->B2Value();
+ intptr_t d2 = rsInstr->D2Value();
+ // only takes rightmost 6bits
+ int64_t b2_val = b2 == 0 ? 0 : get_register(b2);
+ int shiftBits = (b2_val + d2) & 0x3F;
+
+ DCHECK(r1 % 2 == 0);
+ uint32_t r1_val = get_low_register<uint32_t>(r1);
+ uint32_t r1_next_val = get_low_register<uint32_t>(r1 + 1);
+ uint64_t alu_out = (static_cast<uint64_t>(r1_val) << 32) |
+ (static_cast<uint64_t>(r1_next_val));
+ alu_out <<= shiftBits;
+ set_low_register(r1 + 1, static_cast<uint32_t>(alu_out));
+ set_low_register(r1, static_cast<uint32_t>(alu_out >> 32));
+ break;
+ }
case SLA:
case SRA: {
RSInstruction* rsInstr = reinterpret_cast<RSInstruction*>(instr);
« 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