Re: [AD] Clear MMX bug! -> Repair

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


JOSE ANTONIO LUQUE <skylord@xxxxxxxxxx> writes:
> I did some test and bug is in clear_mmx 8 and 16 bits. I attach the 
> diff file for better pacth.

Many thanks.

> Why you store clear value in 4*4 pixels? Why not 4 pixels only? And 
> your code will be small, and you won't have to do end line code.

It would certainly be nice to cut down the size of the clear routines if 
you can see a way to do that. They are quite large and complex at the 
moment, especially in comparison to your blit() implementation.

> If before use blit for mouse handler we save fpu word manually in asm 
> and after we restore(with specified instructions), mouse will be able 
> to use the new mmx blit? this is 50% faster for short bitmaps.

True, but saving the FPU state is terribly slow, so I don't think it 
actually gains much (plus drawing the mouse isn't really a very 
speed-critical operation :-)

The problem with doing any more flexible FPU state saving system is where 
to do it. We can't put it in the interrupt wrapper code, because then 
we'd have to be saving the state for every single interrupt that goes 
off, which is way too much overhead. But we can't put it inside the blit 
function, because that doesn't know whether it is being called inside an 
interrupt or not. And it doesn't really fit inside the mouse drawing 
code, either, because that is all generic C code that doesn't know 
anything about i386 implementations in particular. So to make this work 
would require a bunch of flags to tell different parts of the code what 
needs to be saved, which seems too complex to me. Just disabling MMX 
inside the mouse code is perhaps slightly less than optimal, but at least 
it it simple and robust...



-- 
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/