diff options
Diffstat (limited to 'src/core/arm/interpreter/armsupp.cpp')
| -rw-r--r-- | src/core/arm/interpreter/armsupp.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp index 426b67831..eec34143e 100644 --- a/src/core/arm/interpreter/armsupp.cpp +++ b/src/core/arm/interpreter/armsupp.cpp | |||
| @@ -453,12 +453,14 @@ ARMul_AddOverflow (ARMul_State * state, ARMword a, ARMword b, ARMword result) | |||
| 453 | ASSIGNV (AddOverflow (a, b, result)); | 453 | ASSIGNV (AddOverflow (a, b, result)); |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | /* Assigns the Q flag if the given result is considered an overflow from the addition of a and b */ | 456 | // Returns true if the Q flag should be set as a result of overflow. |
| 457 | void ARMul_AddOverflowQ(ARMul_State* state, ARMword a, ARMword b) | 457 | bool ARMul_AddOverflowQ(ARMword a, ARMword b) |
| 458 | { | 458 | { |
| 459 | u32 result = a + b; | 459 | u32 result = a + b; |
| 460 | if (((result ^ a) & (u32)0x80000000) && ((a ^ b) & (u32)0x80000000) == 0) | 460 | if (((result ^ a) & (u32)0x80000000) && ((a ^ b) & (u32)0x80000000) == 0) |
| 461 | SETQ; | 461 | return true; |
| 462 | |||
| 463 | return false; | ||
| 462 | } | 464 | } |
| 463 | 465 | ||
| 464 | /* Assigns the C flag after an subtraction of a and b to give result. */ | 466 | /* Assigns the C flag after an subtraction of a and b to give result. */ |