Re: [GXemul-devel] GXemul 0.4 target PPC
Status: Alpha
Brought to you by:
gavare
From: Anders G. <ga...@gm...> - 2008-07-16 17:02:26
|
Ons 2008-07-16 klockan 09:12 +0200 skrev claude vittoria: > Hi, > > I implement Float instructions in PPC target with softfloat. > > I m looking for an advice. > > Each float instruction, need to test if FPU is enable. Thus I > need the reel PC to launch fpu exception. > In ic->args, I can only give 3 parameters (Rd, Ra, Rb). I don't > want to provide the word in args and to decode it in the > instruction. > > I try to use this code. > > int low_pc = ((size_t)cpu->cd.DYNTRANS_ARCH.next_ic - > (size_t)cpu->cd.DYNTRANS_ARCH.cur_ic_page) > sizeof(struct DYNTRANS_IC); > cpu->pc &= ~((DYNTRANS_IC_ENTRIES_PER_PAGE-1) << > DYNTRANS_INSTR_ALIGNMENT_SHIFT); > cpu->pc += (low_pc << DYNTRANS_INSTR_ALIGNMENT_SHIFT); There is already a macro for this, CHECK_FOR_FPU_EXCEPTION, in cpu_ppc_instr.c. See e.g. the implementation of the fctiwz or fneg instructions for example on how it is used. .. > I get the pc+4 where is the instruction. It seems fine. > > But I see your implementation of mtmsr and I don't understand why you > don't use the code, above, when the instruction is executed. > I don't find argument... mtmsr is not a good example to copy, because it contains a special hack. fneg is better. > Other question > If I want to give a fourth argument in ic (arch ## _instr_call), I > need to reduce the number of translated instructions ? I don't test > this modification because I don't see all impacts... If you really need to expand the number of arguments, then edit PPC_N_IC_ARGS in src/include/cpu_ppc.h. Anders |