all repos — mgba @ 6321b1f82715b82ddd7b2e9e86057efe5aab0ef3

mGBA Game Boy Advance Emulator

Fix ARM_CARRY_FROM
Jeffrey Pfau jeffrey@endrift.com
Fri, 26 Jul 2013 00:50:20 -0700
commit

6321b1f82715b82ddd7b2e9e86057efe5aab0ef3

parent

76cd71290726fa9466e6f6f5122168b43b4de6f2

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/arm/isa-inlines.hsrc/arm/isa-inlines.h

@@ -47,7 +47,7 @@

#define ARM_SIGN(I) ((I) >> 31) #define ARM_ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | (I << (32 - ROTATE))) -#define ARM_CARRY_FROM(M, N, D) ((ARM_SIGN((M) | (N))) && !(ARM_SIGN(D))) +#define ARM_CARRY_FROM(M, N, D) (((uint32_t) (M) >> 31) + ((uint32_t) (N) >> 31) > ((uint32_t) (D) >> 31)) #define ARM_BORROW_FROM(M, N, D) (((uint32_t) (M)) >= ((uint32_t) (N))) #define ARM_V_ADDITION(M, N, D) (!(ARM_SIGN((M) ^ (N))) && (ARM_SIGN((M) ^ (D))) && (ARM_SIGN((N) ^ (D)))) #define ARM_V_SUBTRACTION(M, N, D) ((ARM_SIGN((M) ^ (N))) && (ARM_SIGN((M) ^ (D))))