#124536 - simonjhall - Fri Apr 06, 2007 6:23 pm
I've got this killer function which takes loads of CPU time (it's in floating-point too), it's recursive, and has huge stack frames. There are cases where the function goes a little nuts and runs out of stack, crashing the game.
I've tried improving it's performance by converting it to fixed-point, but the compiler seems to generate lots of temporaries which are getting stored to the stack. This means the stack frames are even larger than normal and the game crashes even easier.
I can relocate the stack (for the duration of the function) by just moving $sp to a place in main memory, but obviously the performance dips a bit. I'd ideally like to use the DTCM as much as possible, and the ARM9's CP allows you to move the address of the DTCM so can I just move it to the very end of memory? That way when it'd run out of stack it'd just spill into main memory...
However (the reason I'm posting), what happens to interrupt handlers when I do this? Do they still expect the stack to exist in the previous position? And isn't the IPC struct at the very end of main memory? Anything else I should be worried about?
_________________
Big thanks to everyone who donated for Quake2
I've tried improving it's performance by converting it to fixed-point, but the compiler seems to generate lots of temporaries which are getting stored to the stack. This means the stack frames are even larger than normal and the game crashes even easier.
I can relocate the stack (for the duration of the function) by just moving $sp to a place in main memory, but obviously the performance dips a bit. I'd ideally like to use the DTCM as much as possible, and the ARM9's CP allows you to move the address of the DTCM so can I just move it to the very end of memory? That way when it'd run out of stack it'd just spill into main memory...
However (the reason I'm posting), what happens to interrupt handlers when I do this? Do they still expect the stack to exist in the previous position? And isn't the IPC struct at the very end of main memory? Anything else I should be worried about?
_________________
Big thanks to everyone who donated for Quake2