From fff6f5890b746fc05fa70c96ff4c4f9bf8122955 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 17 Oct 2020 21:55:14 -0700 Subject: [PATCH] ARM: Simplify V flag calculation --- include/mgba/internal/arm/isa-inlines.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mgba/internal/arm/isa-inlines.h b/include/mgba/internal/arm/isa-inlines.h index 93659b6d7..1a84aeccf 100644 --- a/include/mgba/internal/arm/isa-inlines.h +++ b/include/mgba/internal/arm/isa-inlines.h @@ -34,8 +34,8 @@ #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_BORROW_FROM_CARRY(M, N, D, C) (ARM_UXT_64(M) >= (ARM_UXT_64(N)) + (uint64_t) (C)) -#define ARM_V_ADDITION(M, N, D) (!(ARM_SIGN((M) ^ (N))) && (ARM_SIGN((M) ^ (D)))) -#define ARM_V_SUBTRACTION(M, N, D) ((ARM_SIGN((M) ^ (N))) && (ARM_SIGN((M) ^ (D)))) +#define ARM_V_ADDITION(M, N, D) (ARM_SIGN(~((M) ^ (N)) & ((M) ^ (D)))) +#define ARM_V_SUBTRACTION(M, N, D) (ARM_SIGN(((M) ^ (N)) & ((M) ^ (D)))) #define ARM_WAIT_MUL(R) \ { \