pike.git / src / code / ppc32.h

version» Context lines:

pike.git/src/code/ppc32.h:12:   #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 PPC_INSTR_XO_FORM(OPCD,D,A,B,OE,XO,Rc) \ +  add_to_program(((OPCD)<<26)|((D)<<21)|((A)<<16)|((B)<<11)|((OE)<<10)|((XO)<<1)|(Rc))      #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 CMPI(crfD,A,UIMM) PPC_INSTR_D_FORM(11,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 STWU(S,A,d) PPC_INSTR_D_FORM(37,S,A,d)   #define LHA(D,A,d) PPC_INSTR_D_FORM(42,D,A,d) -  + #define STH(S,A,d) PPC_INSTR_D_FORM(44,S,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 BCLR(BO,BI) PPC_INSTR_XL_FORM(19,BO,BI,0,16,0)   #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 SUBF(D,A,B) PPC_INSTR_XO_FORM(31,D,A,B,0,40,0) + #define DIVWU(D,A,B) PPC_INSTR_XO_FORM(31,D,A,B,0,459,0) +    #define LOW_GET_JUMP() ((INT32)PROG_COUNTER[JUMP_EPILOGUE_SIZE])   #define LOW_SKIPJUMP() (SET_PROG_COUNTER(PROG_COUNTER + JUMP_EPILOGUE_SIZE + 1))      #define SET_REG(REG, X) do { \    INT32 val_ = X; \    INT32 reg_ = REG; \    if ((-32768 <= val_) && (val_ <= 32767)) { \    /* addi reg,0,val */ \    ADDI(reg_, 0, val_); \    } else { \
pike.git/src/code/ppc32.h:228: Inside #if defined(PIKE_CPU_REG_PREFIX)
     #ifdef PIKE_CPU_REG_PREFIX   #define PPC_REGNAME(n) PIKE_CPU_REG_PREFIX #n   #else   #define PPC_REGNAME(n) #n   #endif      #define CALL_MACHINE_CODE(pc) \    __asm__ __volatile__( " mtctr %0\n" \    " mr "PPC_REGNAME(29)",%1\n" \ -  " bctr" \ +  " bctrl" \    : \    : "r" (pc), "r" (Pike_interpreter_pointer) \    : "ctr", "lr", "cc", "memory", "r29", "r0", \    "r3", "r4", "r5", "r6", "r7", "r8", "r9", \    "r10", "r11", "r12")      #define OPCODE_INLINE_BRANCH   #define OPCODE_RETURN_JUMPADDR -  + #define OPCODE_INLINE_RETURN      #ifdef OPCODE_RETURN_JUMPADDR      /* Don't need an lvalue in this case. */   #define PROG_COUNTER ((PIKE_OPCODE_T *)__builtin_return_address(0))      #define JUMP_EPILOGUE_SIZE 2   #define JUMP_SET_TO_PC_AT_NEXT(PC) \    ((PC) = PROG_COUNTER + JUMP_EPILOGUE_SIZE)   
pike.git/src/code/ppc32.h:262:   #else   /* PowerOpen ABI */   #define PROG_COUNTER (((PIKE_OPCODE_T **)__builtin_frame_address(1))[2])   #endif      #define JUMP_EPILOGUE_SIZE 0      #endif /* !OPCODE_RETURN_JUMPADDR */       - #ifdef PIKE_DEBUG + #ifdef OPCODE_INLINE_RETURN +  + /* Size of the prologue added by INS_ENTRY() (in PIKE_OPCODE_T's). */ + #define ENTRY_PROLOGUE_SIZE 3 +  + void ppc32_ins_entry(void); + #define INS_ENTRY() ppc32_ins_entry() +  + #endif /* OPCODE_INLINE_RETURN */ +  +    void ppc32_disassemble_code(void *addr, size_t bytes);   #define DISASSEMBLE_CODE(ADDR, BYTES) ppc32_disassemble_code(ADDR, BYTES) - #endif +