I have this program containing some matrix math functions for the DSP that I'm working on. I want to be able to load the whole thing into DSP memory once and run the individual snippets that I need. How do I calculate the offset I need to point jag_dsp_go() to in order to call an individual snippet?
I want to be able to do:
#define DSP_FUNCTION_LOAD(X) jag_dsp_load(D_RAM, X, X ## _end - X );
#define DSP_FUNCTION_GO(X) jag_dsp_go((uint32_t *)X, 0);
/* here's what I need to figure out, this
I did a few tricks to save on space when I was writing my sound engine, granted 8KB is more than 4KB so not as tight But might be some avenues to explore.
If you have a lot of MOVEI instructions, have a think for ways to reduce their number, a regular JRISC instruction is 16bit, but a movei is 48bit due to the address. If you are setting up pointers to RAM it MIGHT be possible to get there using a single movei and then addq and shifts to add on offsets. Fair amount of faff but can save