Merged revisions 7797-7917 via svnmerge from
[cacao.git] / src / vm / jit / powerpc64 / asmpart.S
index af871ae593ace58e176260d07a51f93bcbbdbc54..f073ab6f06983353f966fb7c08daa370d32ad931 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: asmpart.S 7678 2007-04-09 17:23:55Z twisti $
+   $Id: asmpart.S 7909 2007-05-15 10:32:16Z tbfg $
 
 */
 
        std     s0,8*8(sp)                /* save used callee saved registers     */
        std     a0,9*8(sp)                /* save method pointer for compiler     */
 
-#if defined(__DARWIN__)
-       std     itmp1,10*8(sp)            /* register r11 is callee saved         */
-#endif
        std     pv,11*8(sp)               /* save PV register                     */
 
        std     itmp3,12*8(sp)            /* registers r14-r31 are callee saved   */
        stfd    ftmp1,13*8(sp)            /* registers f14-f31 are callee saved   */
        stfd    ftmp2,14*8(sp)
 
-#if defined(__DARWIN__)
-       std     t1,15*8(r1)
-       std     t2,16*8(r1)
-       std     t3,17*8(r1)
-       std     t4,18*8(r1)
-       std     t5,19*8(r1)
-       std     t6,20*8(r1)
-       std     t7,21*8(r1)
-
-       stfd    ft0,22*8(r1)
-       stfd    ft1,23*8(r1)
-       stfd    ft2,24*8(r1)
-       stfd    ft3,25*8(r1)
-       stfd    ft4,26*8(r1)
-       stfd    ft5,27*8(r1)
-#else
-       SAVE_TEMPORARY_REGISTERS(15)      /* the offset has to be even            */
-#endif
+       SAVE_TEMPORARY_REGISTERS(15)     
 
        mr      itmp2,a1                  /* arg count                            */
        mr      itmp1,a2                  /* pointer to arg block                 */
@@ -204,31 +184,26 @@ L_register_handle_int:
        cmpwi   t6,INT_ARG_CNT            /* are we out of integer argument       */
        beq     L_register_copy           /* registers? yes, next loop            */
 
+       cmpwi   itmp3,0x0004              /* is it TYPE_ADR? */
+       beq     L_register_handle_long
+
        andi.   r0,itmp3,0x0001           /* is this a 2-word type?               */
        bne     L_register_handle_long
 
-#if defined(__DARWIN__)
-       #error "FIXME for darwin"
-#else
        lis     itmp3,L_jumptable_int@highest           /* load 64bit address   */
        ori     itmp3,itmp3,L_jumptable_int@higher
        rldicr  itmp3,itmp3,32,31
        oris    itmp3,itmp3,L_jumptable_int@h
        ori     itmp3,itmp3,L_jumptable_int@l
-#endif
        b       L_register_do_copy_longint
 
 L_register_handle_long:
 
-#if defined(__DARWIN__)
-       #error "FIXME for darwin"
-#else
        lis     itmp3,L_jumptable_long@highest          /* load 64bit address   */
        ori     itmp3,itmp3,L_jumptable_long@higher
        rldicr  itmp3,itmp3,32,31
        oris    itmp3,itmp3,L_jumptable_long@h
        ori     itmp3,itmp3,L_jumptable_long@l
-#endif
 
 L_register_do_copy_longint:
        slwi    t2,t6,3                   /* multiple of 8-bytes                  */
@@ -246,28 +221,20 @@ L_register_handle_float:
        andi.   r0,itmp3,0x0001           /* is this a 2-word type?               */
        bne     L_register_handle_double
 
-#if defined(__DARWIN__)
-       #error "FIXME for darwin"
-#else
        lis     itmp3,L_jumptable_float@highest         /* load 64bit address   */
        ori     itmp3,itmp3,L_jumptable_float@higher
        rldicr  itmp3,itmp3,32,31
        oris    itmp3,itmp3,L_jumptable_float@h
        ori     itmp3,itmp3,L_jumptable_float@l
-#endif
        b L_register_do_copy_floatdouble
 
 L_register_handle_double:
 
-#if defined(__DARWIN__)
-       #error "FIXME for darwin"
-#else
        lis     itmp3,L_jumptable_double@highest                /* load 64bit address   */
        ori     itmp3,itmp3,L_jumptable_double@higher
        rldicr  itmp3,itmp3,32,31
        oris    itmp3,itmp3,L_jumptable_double@h
        ori     itmp3,itmp3,L_jumptable_double@l
-#endif
 
 
 L_register_do_copy_floatdouble:
@@ -356,16 +323,11 @@ L_stack_handle_double:
 L_stack_copy_done:
        ld      itmp1,9*8(s0)             /* pass method pointer via tmp1         */
 
-#if defined(__DARWIN__)
-       addis   mptr,t3,ha16(L_asm_call_jit_compiler - L_asm_vm_call_method_get_pc)
-       la      mptr,lo16(L_asm_call_jit_compiler - L_asm_vm_call_method_get_pc)(mptr)
-#else
        lis     mptr,L_asm_call_jit_compiler@highest    /* load 64bit address   */
        ori     mptr,mptr,L_asm_call_jit_compiler@higher
        rldicr  mptr,mptr,32,31
        oris    mptr,mptr,L_asm_call_jit_compiler@h
        ori     mptr,mptr,L_asm_call_jit_compiler@l
-#endif
        std     mptr,7*8(s0)
        addi    mptr,s0,7*8
 
@@ -374,48 +336,25 @@ L_stack_copy_done:
        bctrl
 1:
        mflr    itmp1
-#if defined(__DARWIN__)
-       addi    pv,itmp1,lo16(.asm_vm_call_method - 1b)
-#else
+
        addi    pv,itmp1,(.asm_vm_call_method - 1b)@l
-#endif
 
 L_asm_vm_call_method_return:
        mr      sp,s0                     /* restore the function's sp            */
 
        ld      s0,8*8(sp)                /* restore used callee saved registers  */
 
-#if defined(__DARWIN__)
-       lwz     itmp1,10*4(sp)            /* register r11 is callee saved         */
-#endif
        ld      pv,11*8(sp)               /* save PV register                     */
 
        ld      itmp3,12*8(sp)
        lfd     ftmp1,13*8(sp)            /* registers f14-f31 are callee saved   */
        lfd     ftmp2,14*8(sp)
 
-#if defined(__DARWIN__)
-       lwz     t1,18*4(r1)
-       lwz     t2,19*4(r1)
-       lwz     t3,20*4(r1)
-       lwz     t4,21*4(r1)
-       lwz     t5,22*4(r1)
-       lwz     t6,23*4(r1)
-       lwz     t7,24*4(r1)
-
-       lfd     ft0,26*4(r1)
-       lfd     ft1,28*4(r1)
-       lfd     ft2,30*4(r1)
-       lfd     ft3,32*4(r1)
-       lfd     ft4,34*4(r1)
-       lfd     ft5,36*4(r1)
-#else
-       RESTORE_TEMPORARY_REGISTERS(15)   /* the offset has to be even            */
-#endif
+       RESTORE_TEMPORARY_REGISTERS(15) 
 
        ld     r0,40*8+LA_LR_OFFSET(r1)
-       mtlr    r0
-       addi    r1,r1,40*8
+       mtlr   r0
+       addi   r1,r1,40*8
        blr
 
 asm_vm_call_method_exception_handler:
@@ -644,32 +583,7 @@ L_asm_call_jit_compiler:                /* required for PIC code              */
        std     r0,LA_LR_OFFSET(sp)         /* save return address                */
        stdu    r1,-(LA_SIZE+PA_SIZE+ARG_CNT*8)(sp)
 
-#if defined(__DARWIN__)
-       stw     a0,LA_SIZE+(5+0)*8(r1)
-       stw     a1,LA_SIZE+(5+1)*8(r1)
-       stw     a2,LA_SIZE+(5+2)*8(r1)
-       stw     a3,LA_SIZE+(5+3)*8(r1)
-       stw     a4,LA_SIZE+(5+4)*8(r1)
-       stw     a5,LA_SIZE+(5+5)*8(r1)
-       stw     a6,LA_SIZE+(5+6)*8(r1)
-       stw     a7,LA_SIZE+(5+7)*8(r1)
-
-       stfd    fa0,LA_SIZE+(5+8)*8(r1)
-       stfd    fa1,LA_SIZE+(5+10)*8(r1)
-       stfd    fa2,LA_SIZE+(5+12)*8(r1)
-       stfd    fa3,LA_SIZE+(5+14)*8(r1)
-       stfd    fa4,LA_SIZE+(5+16)*8(r1)
-       stfd    fa5,LA_SIZE+(5+18)*8(r1)
-       stfd    fa6,LA_SIZE+(5+20)*8(r1)
-       stfd    fa7,LA_SIZE+(5+22)*8(r1)
-       stfd    fa8,LA_SIZE+(5+24)*8(r1)
-       stfd    fa9,LA_SIZE+(5+26)*8(r1)
-       stfd    fa10,LA_SIZE+(5+28)*8(r1)
-       stfd    fa11,LA_SIZE+(5+30)*8(r1)
-       stfd    fa12,LA_SIZE+(5+32)*8(r1)
-#else
        SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS)
-#endif
 
        mr      a0,itmp1
        mr      a1,mptr
@@ -679,32 +593,7 @@ L_asm_call_jit_compiler:                /* required for PIC code              */
        ori     r0,r0,0                     /* nop needed after jump to function desc. */
        mr      pv,v0                       /* move address to pv register        */
 
-#if defined(__DARWIN__)
-       lwz     a0,LA_SIZE+(+5+0)*8(r1)
-       lwz     a1,LA_SIZE+(+5+1)*8(r1)
-       lwz     a2,LA_SIZE+(+5+2)*8(r1)
-       lwz     a3,LA_SIZE+(+5+3)*8(r1)
-       lwz     a4,LA_SIZE+(+5+4)*8(r1)
-       lwz     a5,LA_SIZE+(+5+5)*8(r1)
-       lwz     a6,LA_SIZE+(+5+6)*8(r1)
-       lwz     a7,LA_SIZE+(+5+7)*8(r1)
-
-       lfd     fa0,LA_SIZE+(+5+8)*8(r1)
-       lfd     fa1,LA_SIZE+(+5+10)*8(r1)
-       lfd     fa2,LA_SIZE+(+5+12)*8(r1)
-       lfd     fa3,LA_SIZE+(+5+14)*8(r1)
-       lfd     fa4,LA_SIZE+(+5+16)*8(r1)
-       lfd     fa5,LA_SIZE+(+5+18)*8(r1)
-       lfd     fa6,LA_SIZE+(+5+20)*8(r1)
-       lfd     fa7,LA_SIZE+(+5+22)*8(r1)
-       lfd     fa8,LA_SIZE+(+5+24)*8(r1)
-       lfd     fa9,LA_SIZE+(+5+26)*8(r1)
-       lfd     fa10,LA_SIZE+(+5+28)*8(r1)
-       lfd     fa11,LA_SIZE+(+5+30)*8(r1)
-       lfd     fa12,LA_SIZE+(+5+32)*8(r1)
-#else
        RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS)
-#endif
 
        ld     itmp1,(LA_SIZE + PA_SIZE + ARG_CNT*8)+LA_LR_OFFSET(sp)
        mtlr   itmp1
@@ -770,11 +659,8 @@ asm_handle_exception:
 L_asm_handle_exception:                 /* required for PIC code              */
        addi    sp,sp,-(ARG_CNT+TMP_CNT)*8  /* create maybe-leaf stackframe       */
 
-#if defined(__DARWIN__)
-#else
        SAVE_ARGUMENT_REGISTERS(0)          /* we save arg and temp registers in  */
        SAVE_TEMPORARY_REGISTERS(ARG_CNT)   /* case this is a leaf method         */
-#endif
 
        addi    sp,sp,-(LA_SIZE+PA_SIZE+(4+6)*8)        /* allocate stack                     */
        std     xptr,LA_SIZE+PA_SIZE+(4+0)*8(sp)        /* save exception pointer             */
@@ -807,11 +693,8 @@ L_asm_handle_exception_continue:
        mr.     t0,t0
        beq     L_asm_handle_exception_no_leaf
 
-#if defined(__DARWIN__)
-#else
        RESTORE_ARGUMENT_REGISTERS(0)       /* if this is a leaf method, we have  */
        RESTORE_TEMPORARY_REGISTERS(ARG_CNT)/* to restore arg and temp registers  */
-#endif
 
        addi    sp,sp,(ARG_CNT+TMP_CNT)*8   /* remove maybe-leaf stackframe       */
 
@@ -851,11 +734,7 @@ L_asm_handle_exception_no_ra_restore:
        bl      ex_int1
 ex_int1:
        mflr    t3                          /* t3 = current pc                    */
-#if defined(__DARWIN__)
-       addi    t2,t2,lo16(ex_int2-ex_int1)
-#else
        addi    t3,t3,(ex_int2-ex_int1)@l
-#endif
        slwi    t2,t2,2                     /* t2 = register count * 4            */
        subf    t3,t2,t3                    /* t3 = IntSave - t2                  */
        mtctr   t3
@@ -877,11 +756,7 @@ ex_int2:
        bl      ex_flt1
 ex_flt1:
        mflr    t3
-#if defined(__DARWIN__)
-       addi    t2,t2,lo16(ex_flt2-ex_flt1)
-#else
        addi    t3,t3,(ex_flt2-ex_flt1)@l
-#endif
        slwi    t2,t2,2                     /* t2 = register count * 4            */
        subf    t3,t2,t3                    /* t3 = FltSave - t2                  */
        mtctr   t3
@@ -913,12 +788,12 @@ ex_flt2:
 
 asm_abstractmethoderror:
        mflr    r0
-       stw     r0,LA_LR_OFFSET(sp)
-       stwu    sp,-LA_SIZE_ALIGNED(sp)     /* preserve linkage area              */
+       std     r0,LA_LR_OFFSET(sp)
+       stdu    sp,-LA_SIZE_ALIGNED(sp)     /* preserve linkage area              */
        addi    a0,sp,LA_SIZE_ALIGNED       /* pass java sp                       */
        mr      a1,r0                       /* pass exception address             */
        bl      exceptions_asm_new_abstractmethoderror
-       lwz     r0,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
+       l     r0,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
        mtlr    r0                          /* restore return address             */
        addi    sp,sp,LA_SIZE_ALIGNED
 
@@ -948,49 +823,8 @@ asm_patcher_wrapper:
                                      /* keep stack 16-bytes aligned: 6+1+37 = 44 */
        stdu    sp,-(LA_SIZE+PA_SIZE+ARG_CNT*8+TMP_CNT*8+4*8)(sp)
 
-#if defined(__DARWIN__)
-       stw     a0,LA_SIZE+(5+0)*8(r1)      /* save argument registers            */
-       stw     a1,LA_SIZE+(5+1)*8(r1)      /* preserve linkage area (24 bytes)   */
-       stw     a2,LA_SIZE+(5+2)*8(r1)      /* and 4 bytes for 4 argument         */
-       stw     a3,LA_SIZE+(5+3)*8(r1)
-       stw     a4,LA_SIZE+(5+4)*8(r1)
-       stw     a5,LA_SIZE+(5+5)*8(r1)
-       stw     a6,LA_SIZE+(5+6)*8(r1)
-       stw     a7,LA_SIZE+(5+7)*8(r1)
-
-       stfd    fa0,LA_SIZE+(5+8)*8(sp)
-       stfd    fa1,LA_SIZE+(5+10)*8(sp)
-       stfd    fa2,LA_SIZE+(5+12)*8(sp)
-       stfd    fa3,LA_SIZE+(5+14)*8(sp)
-       stfd    fa4,LA_SIZE+(5+16)*8(sp)
-       stfd    fa5,LA_SIZE+(5+18)*8(sp)
-       stfd    fa6,LA_SIZE+(5+20)*8(sp)
-       stfd    fa7,LA_SIZE+(5+22)*8(sp)
-       stfd    fa8,LA_SIZE+(5+24)*8(sp)
-       stfd    fa9,LA_SIZE+(5+26)*8(sp)
-       stfd    fa10,LA_SIZE+(5+28)*8(sp)
-       stfd    fa11,LA_SIZE+(5+30)*8(sp)
-       stfd    fa12,LA_SIZE+(5+32)*8(sp)       /* XXX */
-
-       stw     t0,LA_SIZE+(+5+33)*8(r1)
-       stw     t1,LA_SIZE+(+5+34)*8(r1)
-       stw     t2,LA_SIZE+(+5+35)*8(r1)
-       stw     t3,LA_SIZE+(+5+36)*8(r1)
-       stw     t4,LA_SIZE+(+5+37)*8(r1)
-       stw     t5,LA_SIZE+(+5+38)*8(r1)
-       stw     t6,LA_SIZE+(+5+39)*8(r1)
-       stw     t7,LA_SIZE+(+5+40)*8(r1)
-
-       stfd    ft0,LA_SIZE+(+5+42)*8(r1)
-       stfd    ft1,LA_SIZE+(+5+44)*8(r1)
-       stfd    ft2,LA_SIZE+(+5+46)*8(r1)
-       stfd    ft3,LA_SIZE+(+5+48)*8(r1)
-       stfd    ft4,LA_SIZE+(+5+50)*8(r1)
-       stfd    ft5,LA_SIZE+(+5+52)*8(r1)
-#else
        SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS) /* save 8 int/8 float arguments   */
        SAVE_TEMPORARY_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS+ARG_CNT)
-#endif
 
        std     itmp1,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+1*8(sp)
        std     itmp2,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+2*8(sp)
@@ -1002,49 +836,9 @@ asm_patcher_wrapper:
        bl      patcher_wrapper
        std     v0,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+4*8(sp)     /* save return value                  */
 
-#if defined(__DARWIN__)
-       lwz     a0,LA_SIZE+(5+0)*8(r1)
-       lwz     a1,LA_SIZE+(5+1)*8(r1)
-       lwz     a2,LA_SIZE+(5+2)*8(r1)
-       lwz     a3,LA_SIZE+(5+3)*8(r1)
-       lwz     a4,LA_SIZE+(5+4)*8(r1)
-       lwz     a5,LA_SIZE+(5+5)*8(r1)
-       lwz     a6,LA_SIZE+(5+6)*8(r1)
-       lwz     a7,LA_SIZE+(5+7)*8(r1)
-
-       lfd     fa0,LA_SIZE+(5+8)*8(sp)
-       lfd     fa1,LA_SIZE+(5+10)*8(sp)
-       lfd     fa2,LA_SIZE+(5+12)*8(sp)
-       lfd     fa3,LA_SIZE+(5+14)*8(sp)
-       lfd     fa4,LA_SIZE+(5+16)*8(sp)
-       lfd     fa5,LA_SIZE+(5+18)*8(sp)
-       lfd     fa6,LA_SIZE+(5+20)*8(sp)
-       lfd     fa7,LA_SIZE+(5+22)*8(sp)
-       lfd     fa8,LA_SIZE+(5+24)*8(sp)
-       lfd     fa9,LA_SIZE+(5+26)*8(sp)
-       lfd     fa10,LA_SIZE+(5+28)*8(sp)
-       lfd     fa11,LA_SIZE+(5+30)*8(sp)
-       lfd     fa12,LA_SIZE+(5+32)*8(sp)
-
-       lwz     t0,LA_SIZE+(+5+33)*8(r1)
-       lwz     t1,LA_SIZE+(+5+34)*8(r1)
-       lwz     t2,LA_SIZE+(+5+35)*8(r1)
-       lwz     t3,LA_SIZE+(+5+36)*8(r1)
-       lwz     t4,LA_SIZE+(+5+37)*8(r1)
-       lwz     t5,LA_SIZE+(+5+38)*8(r1)
-       lwz     t6,LA_SIZE+(+5+39)*8(r1)
-       lwz     t7,LA_SIZE+(+5+40)*8(r1)
-
-       lfd     ft0,LA_SIZE+(+5+42)*8(r1)
-       lfd     ft1,LA_SIZE+(+5+44)*8(r1)
-       lfd     ft2,LA_SIZE+(+5+46)*8(r1)
-       lfd     ft3,LA_SIZE+(+5+48)*8(r1)
-       lfd     ft4,LA_SIZE+(+5+50)*8(r1)
-       lfd     ft5,LA_SIZE+(+5+52)*8(r1)
-#else
+
        RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS) /* restore 8 int/8 float args  */
        RESTORE_TEMPORARY_REGISTERS(LA_SIZE_IN_POINTERS+PA_SIZE_IN_POINTERS+ARG_CNT)
-#endif
 
        ld     itmp1,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+1*8(sp)
        ld     itmp2,LA_SIZE+PA_SIZE+(ARG_CNT+TMP_CNT)*8+2*8(sp)
@@ -1103,38 +897,38 @@ asm_replacement_out:
        mflr    r16
 
        /* save registers in execution state */
-       stw     r0 ,( 0*8+offes_intregs)(sp)
-       stw     r1 ,( 1*8+offes_intregs)(sp)
-       stw     r2 ,( 2*8+offes_intregs)(sp)
-       stw     r3 ,( 3*8+offes_intregs)(sp)
-       stw     r4 ,( 4*8+offes_intregs)(sp)
-       stw     r5 ,( 5*8+offes_intregs)(sp)
-       stw     r6 ,( 6*8+offes_intregs)(sp)
-       stw     r7 ,( 7*8+offes_intregs)(sp)
-       stw     r8 ,( 8*8+offes_intregs)(sp)
-       stw     r9 ,( 9*8+offes_intregs)(sp)
-       stw     r10,(10*8+offes_intregs)(sp)
-       stw     r11,(11*8+offes_intregs)(sp)
-       stw     r12,(12*8+offes_intregs)(sp)
-       stw     r13,(13*8+offes_intregs)(sp)
-       stw     r14,(14*8+offes_intregs)(sp)
-       stw     r15,(15*8+offes_intregs)(sp)
-       stw     r16,(16*8+offes_intregs)(sp) /* link register */
-       stw     r17,(17*8+offes_intregs)(sp)
-       stw     r18,(18*8+offes_intregs)(sp)
-       stw     r19,(19*8+offes_intregs)(sp)
-       stw     r20,(20*8+offes_intregs)(sp)
-       stw     r21,(21*8+offes_intregs)(sp)
-       stw     r22,(22*8+offes_intregs)(sp)
-       stw     r23,(23*8+offes_intregs)(sp)
-       stw     r24,(24*8+offes_intregs)(sp)
-       stw     r25,(25*8+offes_intregs)(sp)
-       stw     r26,(26*8+offes_intregs)(sp)
-       stw     r27,(27*8+offes_intregs)(sp)
-       stw     r28,(28*8+offes_intregs)(sp)
-       stw     r29,(29*8+offes_intregs)(sp)
-       stw     r30,(30*8+offes_intregs)(sp)
-       stw     r31,(31*8+offes_intregs)(sp)
+       std     r0 ,( 0*8+offes_intregs)(sp)
+       std     r1 ,( 1*8+offes_intregs)(sp)
+       std     r2 ,( 2*8+offes_intregs)(sp)
+       std     r3 ,( 3*8+offes_intregs)(sp)
+       std     r4 ,( 4*8+offes_intregs)(sp)
+       std     r5 ,( 5*8+offes_intregs)(sp)
+       std     r6 ,( 6*8+offes_intregs)(sp)
+       std     r7 ,( 7*8+offes_intregs)(sp)
+       std     r8 ,( 8*8+offes_intregs)(sp)
+       std     r9 ,( 9*8+offes_intregs)(sp)
+       std     r10,(10*8+offes_intregs)(sp)
+       std     r11,(11*8+offes_intregs)(sp)
+       std     r12,(12*8+offes_intregs)(sp)
+       std     r13,(13*8+offes_intregs)(sp)
+       std     r14,(14*8+offes_intregs)(sp)
+       std     r15,(15*8+offes_intregs)(sp)
+       std     r16,(16*8+offes_intregs)(sp) /* link register */
+       std     r17,(17*8+offes_intregs)(sp)
+       std     r18,(18*8+offes_intregs)(sp)
+       std     r19,(19*8+offes_intregs)(sp)
+       std     r20,(20*8+offes_intregs)(sp)
+       std     r21,(21*8+offes_intregs)(sp)
+       std     r22,(22*8+offes_intregs)(sp)
+       std     r23,(23*8+offes_intregs)(sp)
+       std     r24,(24*8+offes_intregs)(sp)
+       std     r25,(25*8+offes_intregs)(sp)
+       std     r26,(26*8+offes_intregs)(sp)
+       std     r27,(27*8+offes_intregs)(sp)
+       std     r28,(28*8+offes_intregs)(sp)
+       std     r29,(29*8+offes_intregs)(sp)
+       std     r30,(30*8+offes_intregs)(sp)
+       std     r31,(31*8+offes_intregs)(sp)
        
        stfd    fr0 ,( 0*8+offes_fltregs)(sp)
        stfd    fr1 ,( 1*8+offes_fltregs)(sp)
@@ -1200,42 +994,42 @@ asm_replacement_out:
        /* a0 == executionstate *es */
 
        /* set new sp and pv */
-       lwz     sp,(offes_sp)(a0)
-       lwz     pv,(offes_pv)(a0)
+       ld     sp,(offes_sp)(a0)
+       ld     pv,(offes_pv)(a0)
        
        /* copy registers from execution state */
-       lwz     r0 ,( 0*8+offes_intregs)(a0)
+       ld     r0 ,( 0*8+offes_intregs)(a0)
        /* r1 is sp                       */
        /* r2 is reserved                 */
        /* a0 is loaded below             */
-       lwz     r4 ,( 4*8+offes_intregs)(a0)
-       lwz     r5 ,( 5*8+offes_intregs)(a0)
-       lwz     r6 ,( 6*8+offes_intregs)(a0)
-       lwz     r7 ,( 7*8+offes_intregs)(a0)
-       lwz     r8 ,( 8*8+offes_intregs)(a0)
-       lwz     r9 ,( 9*8+offes_intregs)(a0)
-       lwz     r10,(10*8+offes_intregs)(a0)
-       lwz     r11,(11*8+offes_intregs)(a0)
-       lwz     r12,(12*8+offes_intregs)(a0)
+       ld     r4 ,( 4*8+offes_intregs)(a0)
+       ld     r5 ,( 5*8+offes_intregs)(a0)
+       ld     r6 ,( 6*8+offes_intregs)(a0)
+       ld     r7 ,( 7*8+offes_intregs)(a0)
+       ld     r8 ,( 8*8+offes_intregs)(a0)
+       ld     r9 ,( 9*8+offes_intregs)(a0)
+       ld     r10,(10*8+offes_intregs)(a0)
+       ld     r11,(11*8+offes_intregs)(a0)
+       ld     r12,(12*8+offes_intregs)(a0)
        /* r13 is pv                      */
-       lwz     r14,(14*8+offes_intregs)(a0)
-       lwz     r15,(15*8+offes_intregs)(a0)
-       lwz     r16,(16*8+offes_intregs)(a0) /* link register */
-       lwz     r17,(17*8+offes_intregs)(a0)
-       lwz     r18,(18*8+offes_intregs)(a0)
-       lwz     r19,(19*8+offes_intregs)(a0)
-       lwz     r20,(20*8+offes_intregs)(a0)
-       lwz     r21,(21*8+offes_intregs)(a0)
-       lwz     r22,(22*8+offes_intregs)(a0)
-       lwz     r23,(23*8+offes_intregs)(a0)
-       lwz     r24,(24*8+offes_intregs)(a0)
-       lwz     r25,(25*8+offes_intregs)(a0)
-       lwz     r26,(26*8+offes_intregs)(a0)
-       lwz     r27,(27*8+offes_intregs)(a0)
-       lwz     r28,(28*8+offes_intregs)(a0)
-       lwz     r29,(29*8+offes_intregs)(a0)
-       lwz     r30,(30*8+offes_intregs)(a0)
-       lwz     r31,(31*8+offes_intregs)(a0)
+       ld     r14,(14*8+offes_intregs)(a0)
+       ld     r15,(15*8+offes_intregs)(a0)
+       ld     r16,(16*8+offes_intregs)(a0) /* link register */
+       ld     r17,(17*8+offes_intregs)(a0)
+       ld     r18,(18*8+offes_intregs)(a0)
+       ld     r19,(19*8+offes_intregs)(a0)
+       ld     r20,(20*8+offes_intregs)(a0)
+       ld     r21,(21*8+offes_intregs)(a0)
+       ld     r22,(22*8+offes_intregs)(a0)
+       ld     r23,(23*8+offes_intregs)(a0)
+       ld     r24,(24*8+offes_intregs)(a0)
+       ld     r25,(25*8+offes_intregs)(a0)
+       ld     r26,(26*8+offes_intregs)(a0)
+       ld     r27,(27*8+offes_intregs)(a0)
+       ld     r28,(28*8+offes_intregs)(a0)
+       ld     r29,(29*8+offes_intregs)(a0)
+       ld     r30,(30*8+offes_intregs)(a0)
+       ld     r31,(31*8+offes_intregs)(a0)
        
        lfd     fr0 ,( 0*8+offes_fltregs)(a0)
        lfd     fr1 ,( 1*8+offes_fltregs)(a0)
@@ -1276,11 +1070,11 @@ asm_replacement_out:
        
        /* load new pc */
 
-       lwz     itmp3,offes_pc(a0)
+       ld     itmp3,offes_pc(a0)
 
        /* load a0 */
        
-       lwz     a0,(3*8+offes_intregs)(a0)
+       ld     a0,(3*8+offes_intregs)(a0)
 
        /* jump to new code */
 
@@ -1366,190 +1160,6 @@ asm_criticalsections:
 #endif
        .quad 0
 
-
-#if defined(__DARWIN__)
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_builtin_throw_exception$stub:
-       .indirect_symbol _builtin_throw_exception
-       mflr r0
-       bcl 20,31,L00$_builtin_throw_exception
-L00$_builtin_throw_exception:
-       mflr r11
-       addis r11,r11,ha16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)
-       mtlr r0
-       lwzu r12,lo16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_builtin_throw_exception$lazy_ptr:
-       .indirect_symbol _builtin_throw_exception
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_exceptions_handle_exception$stub:
-       .indirect_symbol _exceptions_handle_exception
-       mflr r0
-       bcl 20,31,L00$_exceptions_handle_exception
-L00$_exceptions_handle_exception:
-       mflr r11
-       addis r11,r11,ha16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)
-       mtlr r0
-       lwzu r12,lo16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_exceptions_handle_exception$lazy_ptr:
-       .indirect_symbol _exceptions_handle_exception
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_stacktrace_create_extern_stackframeinfo$stub:
-       .indirect_symbol _stacktrace_create_extern_stackframeinfo
-       mflr r0
-       bcl 20,31,L00$_stacktrace_create_extern_stackframeinfo
-L00$_stacktrace_create_extern_stackframeinfo:
-       mflr r11
-       addis r11,r11,ha16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)
-       mtlr r0
-       lwzu r12,lo16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_stacktrace_create_extern_stackframeinfo$lazy_ptr:
-       .indirect_symbol _stacktrace_create_extern_stackframeinfo
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_jit_asm_compile$stub:
-       .indirect_symbol _jit_asm_compile
-       mflr r0
-       bcl 20,31,L00$_jit_asm_compile
-L00$_jit_asm_compile:
-       mflr r11
-       addis r11,r11,ha16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)
-       mtlr r0
-       lwzu r12,lo16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_jit_asm_compile$lazy_ptr:
-       .indirect_symbol _jit_asm_compile
-       .long dyld_stub_binding_helper
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_stacktrace_remove_stackframeinfo$stub:
-       .indirect_symbol _stacktrace_remove_stackframeinfo
-       mflr r0
-       bcl 20,31,L00$_stacktrace_remove_stackframeinfo
-L00$_stacktrace_remove_stackframeinfo:
-       mflr r11
-       addis r11,r11,ha16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)
-       mtlr r0
-       lwzu r12,lo16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_stacktrace_remove_stackframeinfo$lazy_ptr:
-       .indirect_symbol _stacktrace_remove_stackframeinfo
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_exceptions_get_and_clear_exception$stub:
-       .indirect_symbol _exceptions_get_and_clear_exception
-       mflr r0
-       bcl 20,31,L00$_exceptions_get_and_clear_exception
-L00$_exceptions_get_and_clear_exception:
-       mflr r11
-       addis r11,r11,ha16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)
-       mtlr r0
-       lwzu r12,lo16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_exceptions_get_and_clear_exception$lazy_ptr:
-       .indirect_symbol _exceptions_get_and_clear_exception
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_exceptions_asm_new_abstractmethoderror$stub:
-       .indirect_symbol _exceptions_asm_new_abstractmethoderror
-       mflr r0
-       bcl 20,31,L00$_exceptions_asm_new_abstractmethoderror
-L00$_exceptions_asm_new_abstractmethoderror:
-       mflr r11
-       addis r11,r11,ha16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)
-       mtlr r0
-       lwzu r12,lo16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_exceptions_asm_new_abstractmethoderror$lazy_ptr:
-       .indirect_symbol _exceptions_asm_new_abstractmethoderror
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_patcher_wrapper$stub:
-       .indirect_symbol _patcher_wrapper
-       mflr r0
-       bcl 20,31,L00$_patcher_wrapper
-L00$_patcher_wrapper:
-       mflr r11
-       addis r11,r11,ha16(L_patcher_wrapper$lazy_ptr - L00$_patcher_wrapper)
-       mtlr r0
-       lwzu r12,lo16(L_patcher_wrapper$lazy_ptr - L00$_patcher_wrapper)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_patcher_wrapper$lazy_ptr:
-       .indirect_symbol _patcher_wrapper
-       .long dyld_stub_binding_helper
-
-
-.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
-       .align 2
-L_replace_me$stub:
-       .indirect_symbol _replace_me
-       mflr r0
-       bcl 20,31,L00$_replace_me
-L00$_replace_me:
-       mflr r11
-       addis r11,r11,ha16(L_replace_me$lazy_ptr - L00$_replace_me)
-       mtlr r0
-       lwzu r12,lo16(L_replace_me$lazy_ptr - L00$_replace_me)(r11)
-       mtctr r12
-       bctr
-.data
-.lazy_symbol_pointer
-L_replace_me$lazy_ptr:
-       .indirect_symbol _replace_me
-       .long dyld_stub_binding_helper
-
-#endif /* defined(__DARWIN__) */
-
-
 /* disable exec-stacks ********************************************************/
 
 #if defined(__linux__) && defined(__ELF__)