Re: [AD] - MMX Linear clear

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


>> If I ever get around to do the same for blit(), would I need to change 
>> something else for Allegro to use my function ?
>
>Blitting is a problem, because it is used for displaying the mouse cursor, 
>which means it has to be interrupt safe, and you can't use MMX (or indeed 
>any FPU code) in an interrupt context.

Yes, it should be possible, if just FSTENV is called right before the
FP/MMX code, and FLDENV right after. FLDENV will restore the FPU state to
its previous state, so it will be possible to do anything between those
instructions (a good start would be to reset the FPU, which probably is
done with FINIT or EMMS).

The FSTENV/FLDENV pair might already be included in the interrupt handler,
in that case all you need to do is to insert a FPU reset instruction (which
btw isn't needed with MMX).

My sources of information on these instructions are very limited, so I can
not guarantee that I am telling the truth.

Erik




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