[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Tue, 2004-11-30 at 06:38 +1100, aj wrote:
> >But now, I guess a proper solution would be an mmx or the likes version,
> >which has the mask color in some extra register, or something like that.
> >Or is cached memory as fast as constants/registers?
>
>
> for a really really tight loop, like masked blit, keeping it in a register
> would be a good idea.
> it does sound like a job for MMX.
>
> look at
> /alg_4_1_16/src/i386/iblit32.s line 221
>
> movl $MASK_COLOR_32, %eax
>
> just change the
> #define MASK_COLOR_32
>
> to
>
> volatile unsigned int MASK_COLOR_32 = 0xff00ff;
>
> then in the allegro.h somewhere but
>
> extern unsigned int MASK_COLOR_32;
>
> and the user can then set which ever colour they want.
Well, someone would need to find out if MASK_COLOR_32 is always used
when the mask color is needed, or if some places use makecol(...). And
also need to check if it in all cases is written to a register outside
of a loop. I don't know too much asm, but I guess there could also be
cmpl $MASK_COLOR_32, %eax. And in that case, you can't use a variable.
But maybe that never i the case. Then, also need to check this for all
other color depths. Actually, in 8-bit we could probably leave 0, since
I assume checking against 0 will always be faster in asm code than any
other value. Well, and then, someone would need to create a patch with
the change.
I put it into todo.txt as a wishlist item.
--
Elias Pschernig