diff options
| author | bunnei <bunneidev@gmail.com> | 2014-12-23 10:41:01 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2014-12-23 10:41:01 -0500 |
| commit | a7893adf20d7ae647f35e8020206d1cf307e3b96 (patch) | |
| tree | aac22d36e45e0efea688297e28361ddd94148a7a /src/core/arm/interpreter/armsupp.cpp | |
| parent | d31a94f06b5d595e6dceafdd6a76a76455dd5ed6 (diff) | |
| parent | 20fc5f2a35782693af15b1f02de85c8d48c58cd0 (diff) | |
Merge pull request #336 from lioncash/datqflag
armemu: Correctly set the Q flag for a bunch of ops.
Diffstat (limited to 'src/core/arm/interpreter/armsupp.cpp')
| -rw-r--r-- | src/core/arm/interpreter/armsupp.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp index b31c0ea24..6774f8a74 100644 --- a/src/core/arm/interpreter/armsupp.cpp +++ b/src/core/arm/interpreter/armsupp.cpp @@ -444,6 +444,14 @@ ARMul_AddOverflow (ARMul_State * state, ARMword a, ARMword b, ARMword result) ASSIGNV (AddOverflow (a, b, result)); } +/* Assigns the Q flag if the given result is considered an overflow from the addition of a and b */ +void ARMul_AddOverflowQ(ARMul_State* state, ARMword a, ARMword b) +{ + u32 result = a + b; + if (((result ^ a) & (u32)0x80000000) && ((a ^ b) & (u32)0x80000000) == 0) + SETQ; +} + /* Assigns the C flag after an subtraction of a and b to give result. */ void |
