Tweak PPC register usage; gcc doesn't like it when you mess with r31 for some reason

db4
Slava Pestov 2008-11-06 03:36:46 -06:00
parent 6f432811f5
commit 7741096bff
4 changed files with 17 additions and 23 deletions

View File

@ -11,8 +11,8 @@ big-endian on
4 jit-code-format set
: ds-reg 30 ;
: rs-reg 31 ;
: ds-reg 29 ;
: rs-reg 30 ;
: factor-area-size ( -- n ) 4 bootstrap-cells ;

View File

@ -19,10 +19,10 @@ namespaces compiler.codegen.fixup ;
IN: cpu.ppc
! PowerPC register assignments:
! r2-r28: integer vregs
! r29: integer scratch
! r30: data stack
! r31: retain stack
! r2-r27: integer vregs
! r28: integer scratch
! r29: data stack
! r30: retain stack
! f0-f29: float vregs
! f30, f31: float scratch
@ -40,13 +40,13 @@ IN: cpu.ppc
M: ppc machine-registers
{
{ int-regs T{ range f 2 27 1 } }
{ int-regs T{ range f 2 26 1 } }
{ double-float-regs T{ range f 0 28 1 } }
} ;
: scratch-reg 29 ; inline
: fp-scratch-reg-1 30 ; inline
: fp-scratch-reg-2 31 ; inline
: scratch-reg 28 ; inline
: fp-scratch-reg-1 29 ; inline
: fp-scratch-reg-2 30 ; inline
M: ppc two-operand? f ;

View File

@ -60,8 +60,8 @@ DEF(void,c_to_factor,(CELL quot)):
PROLOGUE
SAVE_INT(r13,0) /* save GPRs */
/* don't save ds pointer */
/* don't save rs pointer */
SAVE_INT(r14,1)
SAVE_INT(r15,2)
SAVE_INT(r16,3)
SAVE_INT(r17,4)
SAVE_INT(r18,5)
@ -75,9 +75,6 @@ DEF(void,c_to_factor,(CELL quot)):
SAVE_INT(r26,13)
SAVE_INT(r27,14)
SAVE_INT(r28,15)
SAVE_INT(r29,16)
SAVE_INT(r30,17)
SAVE_INT(r31,18)
SAVE_FP(f14,20) /* save FPRs */
SAVE_FP(f15,22)
@ -125,10 +122,7 @@ DEF(void,c_to_factor,(CELL quot)):
RESTORE_FP(f15,22)
RESTORE_FP(f14,20) /* save FPRs */
RESTORE_INT(r31,18) /* restore GPRs */
RESTORE_INT(r30,17)
RESTORE_INT(r29,16)
RESTORE_INT(r28,15)
RESTORE_INT(r28,15) /* restore GPRs */
RESTORE_INT(r27,14)
RESTORE_INT(r26,13)
RESTORE_INT(r25,12)
@ -141,8 +135,8 @@ DEF(void,c_to_factor,(CELL quot)):
RESTORE_INT(r18,5)
RESTORE_INT(r17,4)
RESTORE_INT(r16,3)
/* don't restore rs pointer */
/* don't restore ds pointer */
RESTORE_INT(r15,2)
RESTORE_INT(r14,1)
RESTORE_INT(r13,0)
EPILOGUE

View File

@ -1,8 +1,8 @@
#define FACTOR_CPU_STRING "ppc"
#define F_FASTCALL
register CELL ds asm("r30");
register CELL rs asm("r31");
register CELL ds asm("r29");
register CELL rs asm("r30");
void c_to_factor(CELL quot);
void undefined(CELL word);