qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH 2/2] target/mips: Correct check for CABS instructions
Date: Mon, 7 Nov 2022 23:35:54 +0100	[thread overview]
Message-ID: <51a88376-98df-c328-f1ec-4dda482e9bb6@linaro.org> (raw)
In-Reply-To: <20221102165719.190378-2-jiaxun.yang@flygoat.com>

On 2/11/22 17:57, Jiaxun Yang wrote:
> Accroading to "MIPS Architecture for Programmers Volume IV-c:
> The MIPS-3D Application-Specific Extension to the MIPS64 Architecture"
> (MD00099). CABS.cond.fmt belongs to MIPS-3D ASE, and it has nothing to do
> with COP1X opcode.
> 
> Remove all unnecessary COP1X checks and check for MIPS3D availability
> in decoding code path.
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   target/mips/tcg/translate.c | 9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
> index e49d2a25a8..23e575ad95 100644
> --- a/target/mips/tcg/translate.c
> +++ b/target/mips/tcg/translate.c
> @@ -1788,16 +1788,8 @@ static inline void gen_cmp ## type ## _ ## fmt(DisasContext *ctx, int n,      \
>           check_ps(ctx);                                                        \
>           break;                                                                \
>       case FMT_D:                                                               \
> -        if (abs) {                                                            \
> -            check_cop1x(ctx);                                                 \
> -        }                                                                     \
>           check_cp1_registers(ctx, fs | ft);                                    \
>           break;                                                                \
> -    case FMT_S:                                                               \
> -        if (abs) {                                                            \
> -            check_cop1x(ctx);                                                 \
> -        }                                                                     \
> -        break;                                                                \

I'm not sure we want to remove this check on all opcodes handled by
the FOP_CONDS() macro, and for all architecture variants. Maybe we
need to special-case CABS.cond.fmt?

>       }                                                                         \
>       gen_ldcmp_fpr##bits(ctx, fp0, fs);                                        \
>       gen_ldcmp_fpr##bits(ctx, fp1, ft);                                        \
> @@ -10424,6 +10416,7 @@ static void gen_farith(DisasContext *ctx, enum fopcode op1,
>       case OPC_CMP_NGT_S:
>           check_insn_opc_removed(ctx, ISA_MIPS_R6);
>           if (ctx->opcode & (1 << 6)) {
> +            check_insn(ctx, ASE_MIPS3D);

You somehow revert commit b8aa4598e2 ("MIPS COP1X (and related)
instructions") which is in use since 15 years.

>               gen_cmpabs_s(ctx, func - 48, ft, fs, cc);
>           } else {
>               gen_cmp_s(ctx, func - 48, ft, fs, cc);



  reply	other threads:[~2022-11-07 22:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 16:57 [PATCH 1/2] target/mips: Don't check COP1X for 64 bit FP mode Jiaxun Yang
2022-11-02 16:57 ` [PATCH 2/2] target/mips: Correct check for CABS instructions Jiaxun Yang
2022-11-07 22:35   ` Philippe Mathieu-Daudé [this message]
2022-11-08 11:37     ` Jiaxun Yang
2022-11-07 22:47 ` [PATCH 1/2] target/mips: Don't check COP1X for 64 bit FP mode Philippe Mathieu-Daudé
2022-11-07 23:29   ` Philippe Mathieu-Daudé
2022-11-08 11:38     ` Jiaxun Yang
2022-11-07 23:22 ` Philippe Mathieu-Daudé

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=51a88376-98df-c328-f1ec-4dda482e9bb6@linaro.org \
    --to=philmd@linaro.org \
    --cc=jiaxun.yang@flygoat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).