Chromium Code Reviews| 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 |