pike.git / src / code / ppc32.h

version» Context lines:

pike.git/src/code/ppc32.h:1:   /* -  * $Id: ppc32.h,v 1.12 2002/04/08 03:08:51 marcus Exp $ +  * $Id: ppc32.h,v 1.13 2002/05/11 10:47:07 mast 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_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))
pike.git/src/code/ppc32.h:113:   #define INCR_MARK_SP_REG(n) do { \    /* addi pike_mark_sp,pike_mark_sp,n */ \    ADDI(PPC_REG_PIKE_MARK_SP, PPC_REG_PIKE_MARK_SP, n); \    ppc32_codegen_state |= PPC_CODEGEN_MARK_SP_NEEDSSTORE; \    } while(0)      #define UPDATE_PC() do { \    INT32 tmp = PIKE_PC; \    if(ppc32_codegen_state & PPC_CODEGEN_PC_ISSET) { \    INT32 diff = (tmp-ppc32_codegen_last_pc)*sizeof(PIKE_OPCODE_T); \ +  if (diff) { \    if ((-32768 <= diff) && (diff <= 32767)) { \ -  /* addi pike_pc,pike_pc,diff */ \ +  /* addi pike_pc,pike_pc,diff */ \    ADDI(PPC_REG_PIKE_PC, PPC_REG_PIKE_PC, diff); \ -  } else { \ +  } else { \    /* addis pike_pc,pike_pc,%hi(diff) */ \    ADDIS(PPC_REG_PIKE_PC, PPC_REG_PIKE_PC, (diff+32768)>>16); \    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); \ +  /* addi pike_pc,pike_pc,%lo(diff) */ \ +  ADDI(PPC_REG_PIKE_PC, PPC_REG_PIKE_PC, diff); \    } \ -  +  } \    } \    } else { \    /* bl .+4 */ \    add_to_program(0x48000005); \    /* mflr pike_pc */ \    MFSPR(PPC_REG_PIKE_PC, 8); \    /* 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)    -  + #define ADJUST_PIKE_PC(pc) do { \ +  ppc32_codegen_last_pc = pc; \ +  ppc32_codegen_state |= PPC_CODEGEN_PC_ISSET; \ +  } while (0) +    #define ins_pointer(PTR) add_to_program((INT32)(PTR))   #define read_pointer(OFF) (Pike_compiler->new_program->program[(INT32)(OFF)])   #define upd_pointer(OFF,PTR) (Pike_compiler->new_program->program[(INT32)(OFF)] = (INT32)(PTR))   #define ins_align(ALIGN)   #define ins_byte(VAL) add_to_program((INT32)(VAL))   #define ins_data(VAL) add_to_program((INT32)(VAL))      INT32 ppc32_ins_f_jump(unsigned int b);   void ppc32_update_f_jump(INT32 offset, INT32 to_offset);   INT32 ppc32_read_f_jump(INT32 offset);