src/emu/cpu/arm7/arm7core.c
| r10129 | r10130 | |
| 243 | 243 | // - HandleALUAddFlags = HandleThumbALUAddFlags except for PC incr |
| 244 | 244 | // - HandleALUSubFlags = HandleThumbALUSubFlags except for PC incr |
| 245 | 245 | |
| 246 | #define IsNeg(i) ((i) >> 31) |
| 247 | #define IsPos(i) ((~(i)) >> 31) |
| 248 | |
| 246 | 249 | /* Set NZCV flags for ADDS / SUBS */ |
| 247 | 250 | #define HandleALUAddFlags(rd, rn, op2) \ |
| 248 | 251 | if (insn & INSN_S) \ |
| 249 | 252 | SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK)) \ |
| 250 | 253 | | (((!SIGN_BITS_DIFFER(rn, op2)) && SIGN_BITS_DIFFER(rn, rd)) << V_BIT) \ |
| 251 | | | (((~(rn)) < (op2)) << C_BIT) \ |
| 254 | | (((IsNeg(rn) & IsNeg(op2)) | (IsNeg(rn) & IsPos(rd)) | (IsNeg(op2) & IsPos(rd))) ? C_MASK : 0) \ |
| 252 | 255 | | HandleALUNZFlags(rd))); \ |
| 253 | 256 | R15 += 4; |
| 254 | 257 | |
| r10129 | r10130 | |
| 259 | 262 | | HandleALUNZFlags(rd))); \ |
| 260 | 263 | R15 += 2; |
| 261 | 264 | |
| 262 | | #define IsNeg(i) ((i) >> 31) |
| 263 | | #define IsPos(i) ((~(i)) >> 31) |
| 264 | | |
| 265 | 265 | #define HandleALUSubFlags(rd, rn, op2) \ |
| 266 | 266 | if (insn & INSN_S) \ |
| 267 | 267 | SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK)) \ |