pike.git / src / code / ppc32.h

version» Context lines:

pike.git/src/code/ppc32.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: ppc32.h,v 1.17 2002/10/11 01:39:39 nilsson Exp $ + || $Id: ppc32.h,v 1.18 2002/10/23 14:58:26 marcus Exp $   */      #define PPC_INSTR_B_FORM(OPCD,BO,BI,BD,AA,LK) \    add_to_program(((OPCD)<<26)|((BO)<<21)|((BI)<<16)| \    (((BD)&0x3fff)<<2)|((AA)<<1)|(LK))   #define PPC_INSTR_D_FORM(OPCD,S,A,d) \    add_to_program(((OPCD)<<26)|((S)<<21)|((A)<<16)|((d)&0xffff)) -  + #define PPC_INSTR_I_FORM(OPCD,LI,AA,LK) \ +  add_to_program(((OPCD)<<26)|((LI)&0x03fffffc)|((AA)<<1)|(LK))   #define PPC_INSTR_M_FORM(OPCD,S,A,SH,MB,ME,Rc) \    add_to_program(((OPCD)<<26)|((S)<<21)|((A)<<16)|((SH)<<11)| \    ((MB)<<6)|((ME)<<1)|(Rc)) -  + #define PPC_INSTR_XL_FORM(OPCD,BO,BI,CRBB,XO,LK) \ +  add_to_program(((OPCD)<<26)|((BO)<<21)|((BI)<<16)|((CRBB)<<11)| \ +  ((XO)<<1)|(LK))   #define PPC_INSTR_XFX_FORM(OPCD,S,SPR,XO) \    add_to_program(((OPCD)<<26)|((S)<<21)|((SPR)<<11)|((XO)<<1))      #define BC(BO,BI,BD) PPC_INSTR_B_FORM(16,BO,BI,BD,0,0)      #define CMPLI(crfD,A,UIMM) PPC_INSTR_D_FORM(10,crfD,A,UIMM)   #define ADDIC(D,A,SIMM) PPC_INSTR_D_FORM(12,D,A,SIMM)   #define ADDI(D,A,SIMM) PPC_INSTR_D_FORM(14,D,A,SIMM)   #define ADDIS(D,A,SIMM) PPC_INSTR_D_FORM(15,D,A,SIMM)   #define ORI(A,S,UIMM) PPC_INSTR_D_FORM(24,S,A,UIMM)   #define LWZ(D,A,d) PPC_INSTR_D_FORM(32,D,A,d)   #define STW(S,A,d) PPC_INSTR_D_FORM(36,S,A,d)   #define LHA(D,A,d) PPC_INSTR_D_FORM(42,D,A,d)      #define RLWINM(S,A,SH,MB,ME) PPC_INSTR_M_FORM(21,S,A,SH,MB,ME,0)      #define MFSPR(D,SPR) PPC_INSTR_XFX_FORM(31,D,(((SPR)&0x1f)<<5)|(((SPR)&0x3e0)>>5),339)   #define MTSPR(D,SPR) PPC_INSTR_XFX_FORM(31,D,(((SPR)&0x1f)<<5)|(((SPR)&0x3e0)>>5),467)    -  + #define BCLRL(BO,BI) PPC_INSTR_XL_FORM(19,BO,BI,0,16,1) + #define B(LI) PPC_INSTR_I_FORM(18,LI,0,0) + #define BL(LI) PPC_INSTR_I_FORM(18,LI,0,1) + #define BLA(LI) PPC_INSTR_I_FORM(18,LI,1,1) +    #define LOW_GET_JUMP() (PROG_COUNTER[0])   #define LOW_SKIPJUMP() (SET_PROG_COUNTER(PROG_COUNTER + 1))   #ifdef __linux   /* SVR4 ABI */   #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[1])   #else   /* PowerOpen ABI */   #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[2])   #endif   
pike.git/src/code/ppc32.h:51:    } else { \    /* addis reg,0,%hi(val) */ \    ADDIS(reg_, 0, val_ >> 16); \    if (val_ & 0xffff) { \    /* ori reg,reg,%lo(val) */ \    ORI(reg_, reg_, val_); \    } \    } \    } while(0)    + #define PPC_SPREG_LR 8 +    #define PPC_REG_RET 0      #define PPC_REG_ARG1 3   #define PPC_REG_ARG2 4   #define PPC_REG_ARG3 5      #define PPC_REG_PIKE_PC 7   #define PPC_REG_PIKE_MARK_SP 8   #define PPC_REG_PIKE_FP 9   #define PPC_REG_PIKE_SP 10
pike.git/src/code/ppc32.h:135:    if ((diff &= 0xffff) > 32767) \    diff -= 65536; \    if (diff) { \    /* addi pike_pc,pike_pc,%lo(diff) */ \    ADDI(PPC_REG_PIKE_PC, PPC_REG_PIKE_PC, diff); \    } \    } \    } \    } else { \    /* bl .+4 */ \ -  add_to_program(0x48000005); \ +  BL(4); \    /* mflr pike_pc */ \ -  MFSPR(PPC_REG_PIKE_PC, 8); \ +  MFSPR(PPC_REG_PIKE_PC, PPC_SPREG_LR); \    /* addi pike_pc,pike_pc,-4 */ \    ADDI(PPC_REG_PIKE_PC, PPC_REG_PIKE_PC, -sizeof(PIKE_OPCODE_T)); \    } \    ppc32_codegen_last_pc = tmp; \    ppc32_codegen_state |= PPC_CODEGEN_PC_ISSET; \    LOAD_FP_REG(); \    /* stw pike_pc,pc(pike_fp) */ \    STW(PPC_REG_PIKE_PC, PPC_REG_PIKE_FP, OFFSETOF(pike_frame, pc)); \    } while(0)