Index: src/s390/simulator-s390.cc |
diff --git a/src/s390/simulator-s390.cc b/src/s390/simulator-s390.cc |
index bd1035710e4704c1963fc532ac922e61983c326c..264c074ad352bbdfd2b49e793f764e3642121983 100644 |
--- a/src/s390/simulator-s390.cc |
+++ b/src/s390/simulator-s390.cc |
@@ -6566,9 +6566,18 @@ EVALUATE(CLCL) { |
} |
EVALUATE(LPR) { |
- UNIMPLEMENTED(); |
- USE(instr); |
- return 0; |
+ DCHECK_OPCODE(LPR); |
+ // Load Positive (32) |
+ DECODE_RR_INSTRUCTION(r1, r2); |
+ int32_t r2_val = get_low_register<int32_t>(r2); |
+ // If negative, then negate it. |
+ r2_val = (r2_val < 0) ? -r2_val : r2_val; |
+ set_low_register(r1, r2_val); |
+ SetS390ConditionCode<int32_t>(r2_val, 0); |
+ if (r2_val == (static_cast<int32_t>(1) << 31)) { |
+ SetS390OverflowCode(true); |
+ } |
+ return length; |
} |
EVALUATE(LNR) { |
@@ -9892,9 +9901,17 @@ EVALUATE(RRXTR) { |
} |
EVALUATE(LPGR) { |
- UNIMPLEMENTED(); |
- USE(instr); |
- return 0; |
+ DCHECK_OPCODE(LPGR); |
+ // Load Positive (32) |
+ DECODE_RRE_INSTRUCTION(r1, r2); |
+ int64_t r2_val = get_register(r2); |
+ r2_val = (r2_val < 0) ? -r2_val : r2_val; // If negative, then negate it. |
+ set_register(r1, r2_val); |
+ SetS390ConditionCode<int64_t>(r2_val, 0); |
+ if (r2_val == (static_cast<int64_t>(1) << 63)) { |
+ SetS390OverflowCode(true); |
+ } |
+ return length; |
} |
EVALUATE(LNGR) { |
@@ -9993,9 +10010,15 @@ EVALUATE(LRVGR) { |
} |
EVALUATE(LPGFR) { |
- UNIMPLEMENTED(); |
- USE(instr); |
- return 0; |
+ DCHECK_OPCODE(LPGFR); |
+ // Load Positive (32) |
+ DECODE_RRE_INSTRUCTION(r1, r2); |
+ int32_t r2_val = get_low_register<int32_t>(r2); |
+ // If negative, then negate it. |
+ int64_t r1_val = static_cast<int64_t>((r2_val < 0) ? -r2_val : r2_val); |
+ set_register(r1, r1_val); |
+ SetS390ConditionCode<int64_t>(r1_val, 0); |
+ return length; |
} |
EVALUATE(LNGFR) { |