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

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

Issue 1846673003: S390: Implemented ALCR in S390 simulator. (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Replaced check for condition_reg_ == 0 with assert that fails if condition_reg_ == 0. 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 | « no previous file | src/s390/simulator-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/simulator-s390.h
diff --git a/src/s390/simulator-s390.h b/src/s390/simulator-s390.h
index 8fee5145e66cbacc61ee49693d874646891c6b38..ae3dd5820944ced1a8cd8b56e89e0091f467ceb3 100644
--- a/src/s390/simulator-s390.h
+++ b/src/s390/simulator-s390.h
@@ -309,6 +309,7 @@ class Simulator {
bool DecodeTwoByte(Instruction* instr);
bool DecodeFourByte(Instruction* instr);
bool DecodeFourByteArithmetic(Instruction* instr);
+ bool DecodeFourByteArithmetic64Bit(Instruction* instr);
bool DecodeFourByteFloatingPoint(Instruction* instr);
void DecodeFourByteFloatingPointIntConversion(Instruction* instr);
void DecodeFourByteFloatingPointRound(Instruction* instr);
@@ -395,6 +396,23 @@ class Simulator {
if (condition_reg_ == 0) condition_reg_ = unordered;
}
+ // Used by arithmetic operations that use carry.
+ template <typename T>
+ void SetS390ConditionCodeCarry(T result, bool overflow) {
+ condition_reg_ = 0;
+ bool zero_result = (result == static_cast<T>(0));
+ if (zero_result && !overflow) {
+ condition_reg_ |= 8;
+ } else if (!zero_result && !overflow) {
+ condition_reg_ |= 4;
+ } else if (zero_result && overflow) {
+ condition_reg_ |= 2;
+ } else if (!zero_result && overflow) {
+ condition_reg_ |= 1;
+ }
+ if (condition_reg_ == 0) UNREACHABLE();
+ }
+
bool isNaN(double value) { return (value != value); }
// Set the condition code for bitwise operations
« no previous file with comments | « no previous file | src/s390/simulator-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698