Commit 2d0adf8f authored by Simon Marlow's avatar Simon Marlow
Browse files

Mips registerised support

Contributed by: Thiemo Seufer <ths@networkno.de>
parent 0e372faa
......@@ -397,10 +397,6 @@
#define REG(x) __asm__("$" #x)
#define CALLER_SAVES_R1
#define CALLER_SAVES_R2
#define CALLER_SAVES_R3
#define CALLER_SAVES_R4
#define CALLER_SAVES_R5
#define CALLER_SAVES_R6
#define CALLER_SAVES_R7
......@@ -408,14 +404,14 @@
#define CALLER_SAVES_USER
#define REG_R1 9
#define REG_R2 10
#define REG_R3 11
#define REG_R4 12
#define REG_R5 13
#define REG_R6 14
#define REG_R7 15
#define REG_R8 24
#define REG_R1 16
#define REG_R2 17
#define REG_R3 18
#define REG_R4 19
#define REG_R5 12
#define REG_R6 13
#define REG_R7 14
#define REG_R8 15
#define REG_F1 f20
#define REG_F2 f22
......@@ -425,11 +421,13 @@
#define REG_D1 f28
#define REG_D2 f30
#define REG_Sp 16
#define REG_SpLim 18
#define REG_Sp 20
#define REG_SpLim 21
#define REG_Hp 22
#define REG_HpLim 23
#define REG_Hp 19
#define REG_HpLim 20
#define REG_Base 30
#endif /* mipse[lb] */
......
......@@ -241,6 +241,29 @@ but uses $$dyncall if necessary to cope, just in case you aren't.
#endif
/* -----------------------------------------------------------------------------
Tail calling on MIPS
-------------------------------------------------------------------------- */
#ifdef mips_HOST_ARCH
#if IN_STG_CODE
register void *_procedure __asm__("$25");
#endif
#define JMP_(cont) \
{ \
_procedure = (void *)(cont); \
__DISCARD__(); \
goto *_procedure; \
}
/* Don't need these for MIPS mangling */
#define FB_
#define FE_
#endif /* mips_HOST_ARCH */
/* -----------------------------------------------------------------------------
FUNBEGIN and FUNEND.
......
......@@ -899,4 +899,37 @@ StgRunIsImplementedInAssembler(void)
#endif
/* -----------------------------------------------------------------------------
MIPS architecture
-------------------------------------------------------------------------- */
#ifdef mips_HOST_ARCH
StgThreadReturnCode
StgRun(StgFunPtr f, StgRegTable *basereg)
{
register StgThreadReturnCode __v0 __asm__("$2");
__asm__ __volatile__(
" la $25, %1 \n"
" move $30, %2 \n"
" jr %1 \n"
" .align 3 \n"
" .globl " STG_RETURN " \n"
" .aent " STG_RETURN " \n"
STG_RETURN ": \n"
" move %0, $16 \n"
" move $3, $17 \n"
: "=r" (__v0),
: "r" (f), "r" (basereg)
"$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",
"$25", "$28", "$30",
"$f20", "$f22", "$f24", "$f26", "$f28", "$f30",
"memory");
return __v0;
}
#endif /* mips_HOST_ARCH */
#endif /* !USE_MINIINTERPRETER */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment