All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <amarkovic@wavecomp.com>
To: "Fredrik Noring" <noring@nocrew.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Jürgen Urban" <JuergenUrban@gmx.de>,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 0/2] target/mips: Fix decoding mechanisms of R5900 M{F, T}{HI, LO}1 and DIV[U]1
Date: Mon, 5 Nov 2018 13:18:53 +0000	[thread overview]
Message-ID: <BN6PR2201MB1251AFA493032E33B49A5376C6CA0@BN6PR2201MB1251.namprd22.prod.outlook.com> (raw)
In-Reply-To: <cover.1541174426.git.noring@nocrew.org>

> From: Fredrik Noring <noring@nocrew.org>
>
> Subject: [PATCH 0/2] target/mips: Fix decoding mechanisms of R5900 M{F,T}{HI,LO}1 and DIV[U]1
> 
> This series amends the R5900 support with the following changes:
>
> ...

Hi, Fridrek,

The two patches look very good. Yes, there will be some code duplication now, but the overall MIPS code is safer, R5900 code better encapsulated - and you have more flexibility to tweak R5900 functionality.

For LL, SC, LLD and SCD instructions, there is a need to properly insulate their R5900 versions too, similar to this:

    case OPC_SC:
        if(ctx->insn_flags & INSN_R5900) {
             check_insn_opc_user_only(ctx, INSN_R5900);
        } else {
            check_insn(ctx, ISA_MIPS2);
        }
        gen_st_cond(ctx, op, rt, rs, imm);
        break;

(the code above is just a form of pseudocode illustrating the idea; I don't guarantee the correctness for build purposes, or if this is the best code organization)

Non-R5900 code (for the time being) should never invoke check_insn_opc_user_only(). *The only way* of distinguishing R5900 code paths from the other CPUs code paths should be by using  "if(ctx->insn_flags & INSN_R5900)"!

For changes in decode_opc_special_legacy(), there shouldn't be there, but there should be a separate function decode_opc_special_tx59() or so.

Thanks,
Aleksandar

  parent reply	other threads:[~2018-11-05 13:19 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
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 ` Aleksandar Markovic [this message]
2018-11-05 18:12   ` [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-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=BN6PR2201MB1251AFA493032E33B49A5376C6CA0@BN6PR2201MB1251.namprd22.prod.outlook.com \
    --to=amarkovic@wavecomp.com \
    --cc=JuergenUrban@gmx.de \
    --cc=aurelien@aurel32.net \
    --cc=f4bug@amsat.org \
    --cc=macro@linux-mips.org \
    --cc=noring@nocrew.org \
    --cc=qemu-devel@nongnu.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.