Re: [AD] x color conversion again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> After examining a bit the code, I found the possible reason for that
> "reserve for one push" comment; it's a fake push/pop pair in the 16->24
> i386 converter. Attached is a new version of the patch which should fix
> the issue. It's untested though, so it'd be nice if someone with a gfx
> card supporting 24 bpp modes could test it...
@@ -2344,7 +2356,7 @@
/* 100% Pentium pairable loop */
/* 22 cycles = 20 cycles/4 pixels + 1 cycle stack + 1 cycle loop */
next_block_16_to_24_no_mmx:
- movl %ecx, -16(%esp) /* fake pushl %ecx
*/
+ movl %ecx, (%esp) /* fake pushl %ecx
*/
xorl %ebx, %ebx
xorl %eax, %eax
movb 7(%esi), %bl /* bl = high byte pixel4
*/
I think the patch is wrong because the %edx value pushed on the stack is
overwritten.
The original code was:
pushl %edx
_align_
/* 100% Pentium pairable loop */
/* 22 cycles = 20 cycles/4 pixels + 1 cycle stack + 1 cycle loop */
next_block_16_to_24_no_mmx:
movl %ecx, -16(%esp) /* fake pushl %ecx
*/
This worked because, while MYLOCAL3 was -16(%esp), the "push" means that the
value was actually written at -20(%esp), which was free.
So I think the correct solution is to get rid of the "push" and use another
spill slot. Which means that 2 spill slots would be needed for the 24-bit
code, thus forcing the frame to be 32 bytes large.
--
Eric Botcazou