pike.git / src / code / ppc32.h

version» Context lines:

pike.git/src/code/ppc32.h:1:   /* -  * $Id: ppc32.h,v 1.6 2001/08/15 17:44:05 marcus Exp $ +  * $Id: ppc32.h,v 1.7 2001/08/16 00:28:30 marcus Exp $    */      #define PIKE_OPCODE_T unsigned INT32      #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) \
pike.git/src/code/ppc32.h:42:    if (val_ & 0xffff) { \    /* ori reg,reg,%lo(val) */ \    ORI(reg_, reg_, val_); \    } \    } \    } while(0)      #define PPC_REG_ARG1 3   #define PPC_REG_ARG2 4    +  + #define PPC_REG_PIKE_MARK_SP 8   #define PPC_REG_PIKE_FP 9   #define PPC_REG_PIKE_SP 10      #define PPC_REG_PIKE_INTERP 31      extern int ppc32_codegen_state;   void ppc32_flush_code_generator_state(void);   #define FLUSH_CODE_GENERATOR_STATE ppc32_flush_code_generator_state      #define PPC_CODEGEN_FP_ISSET 1   #define PPC_CODEGEN_SP_ISSET 2   #define PPC_CODEGEN_SP_NEEDSSTORE 4 -  + #define PPC_CODEGEN_MARK_SP_ISSET 8 + #define PPC_CODEGEN_MARK_SP_NEEDSSTORE 16      #define LOAD_FP_REG() do { \    if(!(ppc32_codegen_state & PPC_CODEGEN_FP_ISSET)) { \    /* lwz pike_fp,frame_pointer(pike_interpreter) */ \    LWZ(PPC_REG_PIKE_FP, PPC_REG_PIKE_INTERP, \    OFFSETOF(Pike_interpreter, frame_pointer)); \    ppc32_codegen_state |= PPC_CODEGEN_FP_ISSET; \    } \    } while(0)      #define LOAD_SP_REG() do { \    if(!(ppc32_codegen_state & PPC_CODEGEN_SP_ISSET)) { \    /* lwz pike_sp,stack_pointer(pike_interpreter) */ \    LWZ(PPC_REG_PIKE_SP, PPC_REG_PIKE_INTERP, \    OFFSETOF(Pike_interpreter, stack_pointer)); \    ppc32_codegen_state |= PPC_CODEGEN_SP_ISSET; \    } \    } while(0)    -  + #define LOAD_MARK_SP_REG() do { \ +  if(!(ppc32_codegen_state & PPC_CODEGEN_MARK_SP_ISSET)) { \ +  /* lwz pike_mark_sp,mark_stack_pointer(pike_interpreter) */ \ +  LWZ(PPC_REG_PIKE_MARK_SP, PPC_REG_PIKE_INTERP, \ +  OFFSETOF(Pike_interpreter, mark_stack_pointer)); \ +  ppc32_codegen_state |= PPC_CODEGEN_MARK_SP_ISSET; \ +  } \ +  } while(0) +    #define INCR_SP_REG(n) do { \    /* addi pike_sp,pike_sp,n */ \    ADDI(PPC_REG_PIKE_SP, PPC_REG_PIKE_SP, n); \    ppc32_codegen_state |= PPC_CODEGEN_SP_NEEDSSTORE; \    } while(0)    -  + #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; \    LOAD_FP_REG(); \    SET_REG(0, tmp); \    /* stw r0,pc(pike_fp) */ \    STW(0, PPC_REG_PIKE_FP, OFFSETOF(pike_frame, pc)); \    } while(0)      #define ins_pointer(PTR) add_to_program((INT32)(PTR))   #define read_pointer(OFF) (Pike_compiler->new_program->program[(INT32)(OFF)])