All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fredrik Noring <noring@nocrew.org>
To: "Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Aleksandar Markovic" <amarkovic@wavecomp.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	"Jürgen Urban" <JuergenUrban@gmx.de>,
	qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <20181104131236.GA30862@sx9> (raw)
In-Reply-To: <1001e61e-b6c0-1a41-9e9f-e2fd5a51f7b5@linaro.org>

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

  reply	other threads:[~2018-11-04 13:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 16:07 [Qemu-devel] [PATCH 0/2] target/mips: Fix decoding mechanisms of R5900 M{F, T}{HI, LO}1 and DIV[U]1 Fredrik Noring
2018-11-02 16:08 ` [Qemu-devel] [PATCH 1/2] target/mips: Fix decoding mechanism of R5900 MFLO1, MFHI1, MTLO1 and MTHI1 Fredrik Noring
2018-11-02 18:10   ` Philippe Mathieu-Daudé
2018-11-04 10:15   ` Richard Henderson
2018-11-04 13:12     ` Fredrik Noring [this message]
2018-11-04 15:09       ` Maciej W. Rozycki
2018-11-05 15:40         ` Fredrik Noring
2018-11-05 16:06           ` Maciej W. Rozycki
2018-11-02 16:08 ` [Qemu-devel] [PATCH 2/2] target/mips: Fix decoding mechanism of R5900 DIV1 and DIVU1 Fredrik Noring
2018-11-02 18:15   ` Philippe Mathieu-Daudé
2018-11-05 13:18 ` [Qemu-devel] [PATCH 0/2] target/mips: Fix decoding mechanisms of R5900 M{F, T}{HI, LO}1 and DIV[U]1 Aleksandar Markovic
2018-11-05 18:12   ` Fredrik Noring
2018-11-05 18:58     ` Aleksandar Markovic
2018-11-07 19:17       ` Fredrik Noring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181104131236.GA30862@sx9 \
    --to=noring@nocrew.org \
    --cc=JuergenUrban@gmx.de \
    --cc=amarkovic@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=f4bug@amsat.org \
    --cc=macro@linux-mips.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.