Hi,
can someone suggest how to modify the sw interrupt handler if I want to use SPE instructions inside an ISR?
I am coding with S32DS for an MPC5777C; The auto-generated file intc_sw_handlers.s states: "If SPE instructions are used, the stack frame must include the accumulator, and prologue and epilogue must be modified."
Thanks,
Marco
Original Attachment has been moved to: intc_sw_handlers.S.zip
Hi, if you see example I have shared here, I have modified mentioned file to enable SPE:
https://community.nxp.com/docs/DOC-328290
Note that used compiler was GHS thus there may be some differences.
Hi David,
I see that these three lines re-enabe the SPE:
mfmsr r0 # As function prologs/epilogs may contain
e_or2is r0, 0x0200 # SPE instruction, enable SPE, as MSR
mtmsr r0 # register is cleared at this point
However the accumulator is not being saved in the stack, as the header in intc_sw_handlers.s states it should be, Is that not necessary?
I tried with this to save it:
evxor r3, r3, r3 ;# Clear R3
evmwumiaa r3, r3, r3 ;# read SPE accumulator value
se_stw r3, 0x04 (r1) ;# Save SPE accumulator
and this to restore it:
se_lwz r3, 0x04 (r1) ;# read SPE accumulator
evmra r3, r3 ;# restore SPE accumulator
but then if I use an instruction from mlib in the interrupt everything crashes.
I made a simple project that shows this, can you have a look?
Another question: how do I set up the error handler for IVOR32? Because I can not see what is the exception that crashes the program.
Thanks,
Marco