diff --git a/basis/cpu/ppc/bootstrap.factor b/basis/cpu/ppc/bootstrap.factor index 7d5e359a80..9bf88185c5 100644 --- a/basis/cpu/ppc/bootstrap.factor +++ b/basis/cpu/ppc/bootstrap.factor @@ -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 ; diff --git a/basis/cpu/ppc/ppc.factor b/basis/cpu/ppc/ppc.factor index 0857c4405c..77c4320f0c 100644 --- a/basis/cpu/ppc/ppc.factor +++ b/basis/cpu/ppc/ppc.factor @@ -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 ; diff --git a/vm/cpu-ppc.S b/vm/cpu-ppc.S index 9fadc5df4a..620bc9e991 100755 --- a/vm/cpu-ppc.S +++ b/vm/cpu-ppc.S @@ -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 diff --git a/vm/cpu-ppc.h b/vm/cpu-ppc.h index 0f10aa34aa..298e21aa7d 100755 --- a/vm/cpu-ppc.h +++ b/vm/cpu-ppc.h @@ -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);