dalton
Member |
Hi,
does anybody know if there are any special constraints when using fpu code in interrupts?
Most fpu commands seem to run fine, but some appears to crash my system; like fscale, fsincos, and fmovecr when I use them in my interrupt code. I have my own interrupt routine written into the vblank vector, and I use fmovem.x along with fsave/frestore to keep the fpu state intact.
My system is A1200 with Blizzard 1260, running oxypatcher.
/Dalton
|
Angry Retired Bastard
Member |
I'd assume this is because the instructions in question are not natively supported by the 68060 FPU (as opposed to in the 68881/2) and therefore are implemented as SW fallbacks depending on exceptions. As a result you're getting issues because your FPU code is triggering new exceptions while servicing the vblank interrupt. No idea how to get around it though...
If this is indeed the case then I'd expect all the following instructions (copied from Erik H. Bakke's old FPU guide) to give you this issue (on 040/060): FACOS,FASIN,FATAN,FATANH,FCOS,FCOSH,FETOX,FETOXM1, FGETEXP,FGETMAN,FINT,FINTRZ,FLOG10,FLOG2,FLOGN, FLOGNP1,FSIN,FSINCOS,FSINH,FTAN,FTANH,FTENTOX, FTWOTOX FMOD,FREM,FSCAL,FSGLDIV,FSGLMUL FMOVECR
|
Blueberry
Member |
According to the 68060 manual, FINT, FINTRZ, FSGLDIV and FSGLMUL are supported. But apart from those, the list looks right.
If it is acceptable for your demo to be dependent on an FPU instruction patcher (OxyPatcher, MuRedox), you can try putting your code using these instructions in a subroutine and make sure it is called (and all problematic instructions executed) at least once from non-interrupt code before it is called from interrupt code. This way, all the exception-causing instructions will likely have been replaced by direct calls to emulation code.
|