diff options
Diffstat (limited to 'src/core/arm/interpreter')
| -rw-r--r-- | src/core/arm/interpreter/armsupp.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/core/arm/interpreter/armsupp.cpp b/src/core/arm/interpreter/armsupp.cpp index eec34143e..68ac2a0ce 100644 --- a/src/core/arm/interpreter/armsupp.cpp +++ b/src/core/arm/interpreter/armsupp.cpp | |||
| @@ -418,22 +418,18 @@ ARMul_NegZero (ARMul_State * state, ARMword result) | |||
| 418 | } | 418 | } |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | /* Compute whether an addition of A and B, giving RESULT, overflowed. */ | 421 | // Compute whether an addition of A and B, giving RESULT, overflowed. |
| 422 | 422 | bool AddOverflow(ARMword a, ARMword b, ARMword result) | |
| 423 | int | ||
| 424 | AddOverflow (ARMword a, ARMword b, ARMword result) | ||
| 425 | { | 423 | { |
| 426 | return ((NEG (a) && NEG (b) && POS (result)) | 424 | return ((NEG(a) && NEG(b) && POS(result)) || |
| 427 | || (POS (a) && POS (b) && NEG (result))); | 425 | (POS(a) && POS(b) && NEG(result))); |
| 428 | } | 426 | } |
| 429 | 427 | ||
| 430 | /* Compute whether a subtraction of A and B, giving RESULT, overflowed. */ | 428 | // Compute whether a subtraction of A and B, giving RESULT, overflowed. |
| 431 | 429 | bool SubOverflow(ARMword a, ARMword b, ARMword result) | |
| 432 | int | ||
| 433 | SubOverflow (ARMword a, ARMword b, ARMword result) | ||
| 434 | { | 430 | { |
| 435 | return ((NEG (a) && POS (b) && POS (result)) | 431 | return ((NEG(a) && POS(b) && POS(result)) || |
| 436 | || (POS (a) && NEG (b) && NEG (result))); | 432 | (POS(a) && NEG(b) && NEG(result))); |
| 437 | } | 433 | } |
| 438 | 434 | ||
| 439 | /* Assigns the C flag after an addition of a and b to give result. */ | 435 | /* Assigns the C flag after an addition of a and b to give result. */ |