while its easy to set up the stack in dcache with CodeWarrier (Edit - Project Settings - Linker - MIPS Linker Panel - Stack Address = 0x1f8003ff), its not that easy with GCC ( at least I haven't found any switch to set the stack-address)
I did it with following code (maybe completely awkward):
// Stack in D-Cache for GNU
volatile unsigned long stack=0x1f8003f0;
volatile unsigned long stack_bak;
void main2(void)
{
// your main-code
}
void main(void)
{
__asm__ volatile ("usw $29,stack_bak");
__asm__ volatile ("lw $29,stack");
main2();
__asm__ volatile ("lw $29,stack_bak");
}
setting stack to dcache got me something like 400% performance-boost with CodeWarrier, but
it seems that GCC optimises code such, that you get not much profit, maybe its better you
use the dcache different than setting stack completely in dcache - don't know - but its
worth to try it :-)