From: "Markus F.X.J. Oberhumer"
Subject: SDL CVS patches below you will find some small patches against the current SDL CVS. It adresses these things: 1) Use "&" instead of "%" in some cases. For negative signed integers (x % 8) is not always (x & 7), and the compiler can produce slightly faster code when using "&" here. 2) Some const issues. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4092
This commit is contained in:
parent
b4001bd1ff
commit
6369aeaaa5
8 changed files with 53 additions and 49 deletions
|
@ -384,7 +384,7 @@ do { \
|
|||
/* 8-times unrolled loop */
|
||||
#define DUFFS_LOOP8(pixel_copy_increment, width) \
|
||||
{ int n = (width+7)/8; \
|
||||
switch (width % 8) { \
|
||||
switch (width & 7) { \
|
||||
case 0: do { pixel_copy_increment; \
|
||||
case 7: pixel_copy_increment; \
|
||||
case 6: pixel_copy_increment; \
|
||||
|
@ -400,7 +400,7 @@ do { \
|
|||
/* 4-times unrolled loop */
|
||||
#define DUFFS_LOOP4(pixel_copy_increment, width) \
|
||||
{ int n = (width+3)/4; \
|
||||
switch (width % 4) { \
|
||||
switch (width & 3) { \
|
||||
case 0: do { pixel_copy_increment; \
|
||||
case 3: pixel_copy_increment; \
|
||||
case 2: pixel_copy_increment; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue