Branch: Tag:

2002-05-11

2002-05-11 10:47:07 by Martin Stjernholm <mast@lysator.liu.se>

Use ADJUST_PIKE_PC to make relative updates of Pike_fp->pc work. (Not
tested.)

Rev: src/code/ppc32.h:1.13

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) \
120:    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 */ \
148:    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))