mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
sh2: optimisations in drc
This commit is contained in:
parent
39c5ec3f4c
commit
904fb98e6c
2 changed files with 72 additions and 51 deletions
|
@ -17,18 +17,18 @@ void drc_cmn_cleanup(void);
|
|||
// binary search approach, since we don't have CLZ on ARM920T
|
||||
#define FOR_ALL_BITS_SET_DO(mask, bit, code) { \
|
||||
u32 __mask = mask; \
|
||||
for (bit = 31; bit >= 0 && mask; bit--, __mask <<= 1) { \
|
||||
if (!(__mask & (0xffff << 16))) \
|
||||
bit -= 16, __mask <<= 16; \
|
||||
if (!(__mask & (0xff << 24))) \
|
||||
bit -= 8, __mask <<= 8; \
|
||||
if (!(__mask & (0xf << 28))) \
|
||||
bit -= 4, __mask <<= 4; \
|
||||
if (!(__mask & (0x3 << 30))) \
|
||||
bit -= 2, __mask <<= 2; \
|
||||
if (!(__mask & (0x1 << 31))) \
|
||||
bit -= 1, __mask <<= 1; \
|
||||
if (__mask & (0x1 << 31)) { \
|
||||
for (bit = 0; bit < 32 && mask; bit++, __mask >>= 1) { \
|
||||
if (!(__mask & 0xffff)) \
|
||||
bit += 16,__mask >>= 16; \
|
||||
if (!(__mask & 0xff)) \
|
||||
bit += 8, __mask >>= 8; \
|
||||
if (!(__mask & 0xf)) \
|
||||
bit += 4, __mask >>= 4; \
|
||||
if (!(__mask & 0x3)) \
|
||||
bit += 2, __mask >>= 2; \
|
||||
if (!(__mask & 0x1)) \
|
||||
bit += 1, __mask >>= 1; \
|
||||
if (__mask & 0x1) { \
|
||||
code; \
|
||||
} \
|
||||
} \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue