pike.git / src / code / ppc32.h

version» Context lines:

pike.git/src/code/ppc32.h:1:   /* -  * $Id: ppc32.h,v 1.4 2001/08/13 23:39:11 mast Exp $ +  * $Id: ppc32.h,v 1.5 2001/08/14 01:26:09 marcus Exp $    */      #define PIKE_OPCODE_T unsigned INT32      #define LOW_GET_JUMP() (PROG_COUNTER[0])   #define LOW_SKIPJUMP() (SET_PROG_COUNTER(PROG_COUNTER + 1))   #define PROG_COUNTER (((INT32 **)__builtin_frame_address(1))[2])      #define SET_REG(REG, X) do { \    INT32 val_ = X; \
pike.git/src/code/ppc32.h:19:    add_to_program(0x3c000000|(reg_<<21)|((val_ >> 16) & 0xffff)); \    if (val_ & 0xffff) { \    /* ori reg,reg,%lo(val) */ \    add_to_program(0x60000000|(reg_<<21)|(reg_<<16)|(val_ & 0xffff)); \    } \    } \    } while(0)      #define UPDATE_PC() do { \    INT32 tmp = PIKE_PC; \ -  SET_REG(11, ((INT32)(&Pike_interpreter.frame_pointer))); \ -  /* lwz 11,0(11) */ \ -  add_to_program(0x80000000|(11<<21)|(11<<16)); \ +  /* lwz 11,frame_pointer(31) */ \ +  add_to_program(0x80000000|(11<<21)|(31<<16)| \ +  OFFSETOF(Pike_interpreter, frame_pointer)); \    SET_REG(0, tmp); \    /* stw 0,pc(11) */ \    add_to_program(0x90000000|(0<<21)|(11<<16)| \    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)])   #define upd_pointer(OFF,PTR) (Pike_compiler->new_program->program[(INT32)(OFF)] = (INT32)(PTR))   #define ins_align(ALIGN)
pike.git/src/code/ppc32.h:70:   /*   struct dynamic_buffer_s;      void ppc32_encode_program(struct program *p, struct dynamic_buffer_s *buf);   void ppc32_decode_program(struct program *p);      #define ENCODE_PROGRAM(P, BUF) ppc32_encode_program(P, BUF)   #define DECODE_PROGRAM(P) ppc32_decode_program(p)   */    - #define CALL_MACHINE_CODE(pc) do { if(pc) goto *(pc); } while(0) + /* FIXME: should be autoconf test for regname syntax */ + #ifdef _AIX + #define PPC_REGNAME(n) #n + #else + #define PPC_REGNAME(n) "r"#n + #endif    -  + #define CALL_MACHINE_CODE(pc) \ +  __asm__ __volatile__( " mtctr %0\n" \ +  " mr "PPC_REGNAME(31)",%1\n" \ +  " bctr" \ +  : \ +  : "r" (pc), "r" (&Pike_interpreter) \ +  : "ctr", "lr", "cc", "memory", "r31", "r0", \ +  "r3", "r4", "r5", "r6", "r7", "r8", "r9", \ +  "r10", "r11", "r12") +