Commit 6dfcaafe authored by bryleun's avatar bryleun Committed by Commit bot

S390: Implemented SLBR in s390 simulator.

This CL implements the SLBR, subtract logical 32-bit int with borrow, instruction in the s390 simulator.

R=michael_dawson@ca.ibm.com,jyan@ca.ibm.com,mbrandy@us.ibm.com,joransiu@ca.ibm.com,

BUG=

Review URL: https://codereview.chromium.org/1850163004

Cr-Commit-Position: refs/heads/master@{#35211}
parent bdfe29af
......@@ -3039,6 +3039,27 @@ bool Simulator::DecodeFourByteArithmetic(Instruction* instr) {
SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF);
break;
}
case SLBR: {
RREInstruction* rrinst = reinterpret_cast<RREInstruction*>(instr);
int r1 = rrinst->R1Value();
int r2 = rrinst->R2Value();
uint32_t r1_val = get_low_register<uint32_t>(r1);
uint32_t r2_val = get_low_register<uint32_t>(r2);
uint32_t alu_out = 0;
bool isOF = false;
alu_out = r1_val - r2_val;
bool isOF_original = CheckOverflowForUIntSub(r1_val, r2_val);
if (TestConditionCode((Condition)2) || TestConditionCode((Condition)3)) {
alu_out = alu_out - 1;
isOF = isOF_original || CheckOverflowForUIntSub(alu_out, 1);
} else {
isOF = isOF_original;
}
set_low_register(r1, alu_out);
SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF);
break;
}
default: { return DecodeFourByteFloatingPoint(instr); }
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment