all repos — mgba @ 853bcec0c2437d1e942cd2431b8c540302cb59eb

mGBA Game Boy Advance Emulator

ARM: Use a more robust ROR idiom
Jeffrey Pfau jeffrey@endrift.com
Mon, 17 Nov 2014 01:10:17 -0800
commit

853bcec0c2437d1e942cd2431b8c540302cb59eb

parent

9e400e86da63f038e0acb2a8402beefda4fa42f6

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

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

@@ -22,7 +22,8 @@ #define ARM_COND_LE (cpu->cpsr.z || !cpu->cpsr.n != !cpu->cpsr.v)

#define ARM_COND_AL 1 #define ARM_SIGN(I) ((I) >> 31) -#define ARM_ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | ((I) << (32 - ROTATE))) +#define ARM_ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | ((uint32_t) (I) << ((-ROTATE) & 31))) + #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)))