mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
ARMv6: fix SIMD add/sub carry flags (Vincent Palatin).
After a quick code review, it seems to be a bad cut-n-paste between 16-bit and 8-bit UADD/USUB, indeed UADD8/USUB8 tries to set GE bits by pair instead of one at a time. Besides, the addition operations (UADD8/UADD16) set GE bits to "NOT carry" instead of "carry" (probably once again due to a copy of the substraction code which sets flags to "NOT borrow") git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4900 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7997d92f2c
commit
a87aa10b85
1 changed files with 4 additions and 4 deletions
|
@ -2059,7 +2059,7 @@ static inline uint8_t sub8_usat(uint8_t a, uint8_t b)
|
|||
uint32_t sum; \
|
||||
sum = (uint32_t)(uint16_t)(a) + (uint32_t)(uint16_t)(b); \
|
||||
RESULT(sum, n, 16); \
|
||||
if ((sum >> 16) == 0) \
|
||||
if ((sum >> 16) == 1) \
|
||||
ge |= 3 << (n * 2); \
|
||||
} while(0)
|
||||
|
||||
|
@ -2067,8 +2067,8 @@ static inline uint8_t sub8_usat(uint8_t a, uint8_t b)
|
|||
uint32_t sum; \
|
||||
sum = (uint32_t)(uint8_t)(a) + (uint32_t)(uint8_t)(b); \
|
||||
RESULT(sum, n, 8); \
|
||||
if ((sum >> 8) == 0) \
|
||||
ge |= 3 << (n * 2); \
|
||||
if ((sum >> 8) == 1) \
|
||||
ge |= 1 << n; \
|
||||
} while(0)
|
||||
|
||||
#define SUB16(a, b, n) do { \
|
||||
|
@ -2084,7 +2084,7 @@ static inline uint8_t sub8_usat(uint8_t a, uint8_t b)
|
|||
sum = (uint32_t)(uint8_t)(a) - (uint32_t)(uint8_t)(b); \
|
||||
RESULT(sum, n, 8); \
|
||||
if ((sum >> 8) == 0) \
|
||||
ge |= 3 << (n * 2); \
|
||||
ge |= 1 << n; \
|
||||
} while(0)
|
||||
|
||||
#define PFX u
|
||||
|
|
Loading…
Reference in a new issue