|
| From: | Fredrik Noring |
| Subject: | Re: [Qemu-devel] [PATCH 1/2] target/mips: Fix decoding mechanism of R5900 MFLO1, MFHI1, MTLO1 and MTHI1 |
| Date: | Sun, 4 Nov 2018 14:12:36 +0100 |
| User-agent: | Mutt/1.10.1 (2018-07-13) |
Thank you for your reviews, Philippe and Richard,
> > + switch (opc) {
> > + case TX79_MMI_MFHI1:
> > +#if defined(TARGET_MIPS64)
> > + tcg_gen_ext32s_tl(cpu_gpr[reg], cpu_HI[1]);
> > +#else
> > + tcg_gen_mov_tl(cpu_gpr[reg], cpu_HI[1]);
> > +#endif
>
> You do not need this ifdef. This is already done in tcg/tcg-op.h:
>
> $ grep tcg_gen_ext32s_tl tcg/tcg-op.h
> #define tcg_gen_ext32s_tl tcg_gen_ext32s_i64
> #define tcg_gen_ext32s_tl tcg_gen_mov_i32
It appears the correct function is tcg_gen_mov_tl because the TX79 manual
says
MFHI: GPR[rd]63..0 <- HI63..0
MFLO: GPR[rd]63..0 <- LO63..0
MTHI: HI63..0 <- GPR[rs]63..0
MTLO: LO63..0 <- GPR[rs]63..0
MFHI1: GPR[rd]63..0 <- HI127..64
MFLO1: GPR[rd]63..0 <- LO127..64
MTHI1: HI127..64 <- GPR[rs]63..0
MTLO1: LO127..64 <- GPR[rs]63..0
so the GPR is copied to/from in full in all cases. This is slightly
different to how acc = 1 is handled in gen_HILO.
Fredrik
| [Prev in Thread] | Current Thread | [Next in Thread] |