unroll the bits in translate8to16/32

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@678 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2004-04-26 23:00:25 +00:00
parent da391278ec
commit 7e650f8a49

17
xwin.c
View File

@ -229,6 +229,15 @@ translate_colour(uint32 colour)
return make_colour(pc);
}
#define UNROLL8(stm) { stm stm stm stm stm stm stm stm }
#define REPEAT(stm) \
{ \
while (out <= end - 8 * 4) \
UNROLL8(stm) \
while (out < end) \
{ stm } \
}
static void
translate8to8(uint8 * data, uint8 * out, uint8 * end)
{
@ -241,7 +250,9 @@ translate8to16(uint8 * data, uint8 * out, uint8 * end)
{
uint16 value;
if (g_xserver_be)
if (g_arch_match)
REPEAT(*(((uint16*)out)++) = g_colmap[*(data++)];)
else if (g_xserver_be)
{
while (out < end)
{
@ -294,7 +305,9 @@ translate8to32(uint8 * data, uint8 * out, uint8 * end)
{
uint32 value;
if (g_xserver_be)
if (g_arch_match)
REPEAT(*(((uint32*)out)++) = g_colmap[*(data++)];)
else if (g_xserver_be)
{
while (out < end)
{