In my program I have two MMX registers that are constantly used. I'd like to use the FPU without saving the MMX registers and calling emms. The FPU operation is simple and only needs two free registers. This method works if the two MMX registers are MM0 and MM1 :



; MMX code
; ...
; FPU needed
finit
pxor MM2, MM2 ; set all the tags word to valid
ffree st(7)
ffree st(6)
; fpu code
fldpi
fldpi
fstp
fstp
; MMX code continues


Has anybody used this method ? Is it reliable ? Thanks in advance for the answers.
Posted on 2004-01-03 11:33:24 by Dr. Manhattan