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

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: Removed SetS390OverflowCode from ALR and ALCR 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..aaab896a0c6cbc714bb42d8322bb6d0730c29819 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,27 @@ class Simulator {
if (condition_reg_ == 0) condition_reg_ = unordered;
}
+ // Used by arithmetic operations that use carry.
+ template <typename T>
JoranSiu 2016/03/31 13:27:57 Not sure if this needs to be a template function,
bcleung 2016/03/31 19:12:39 This function will be used with unsigned int input
+ 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;
+ }
+
+ // We get down here only for floating point
JoranSiu 2016/03/31 13:27:57 Are there any floating point operations that would
bcleung 2016/03/31 19:12:39 According to principles of operation, no floating-
+ // comparisons and the values are unordered
+ // i.e. NaN
+ if (condition_reg_ == 0) condition_reg_ = unordered;
+ }
+
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