improve DUFFS_LOOP_124

- use sar (shr?) instead of dec/sub
- use sar (shr?) instead of (optimized) idiv
- check against zero only at one place
- use pixel_copy_increment4 only once
This commit is contained in:
pionere 2022-12-11 11:02:04 +01:00
parent bb6abd7b03
commit 0b5c769594

View file

@ -535,22 +535,15 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface);
int n = width; \
if (n & 1) { \
pixel_copy_increment1; \
n -= 1; \
} \
if (n & 2) { \
n >>= 1; \
if (n & 1) { \
pixel_copy_increment2; \
n -= 2; \
} \
if (n & 4) { \
n >>= 1; \
while (n > 0) { \
pixel_copy_increment4; \
n -= 4; \
} \
if (n) { \
n /= 8; \
do { \
pixel_copy_increment4; \
pixel_copy_increment4; \
} while (--n > 0); \
n--; \
} \
}