All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Petar Jovanovic <petar.jovanovic@rt-rk.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	petar.jovanovic@imgtec.com
Subject: Re: [Qemu-trivial] [PATCH] target-mips: add missing check_dspr2 for multiply instructions
Date: Thu, 09 May 2013 12:32:59 +0400	[thread overview]
Message-ID: <518B5F3B.9050308@msgid.tls.msk.ru> (raw)
In-Reply-To: <1368022144-60111-1-git-send-email-petar.jovanovic@rt-rk.com>

08.05.2013 18:09, Petar Jovanovic wrote:
> From: Petar Jovanovic <petar.jovanovic@imgtec.com>
> 
> The emulator needs to check in hflags if DSP unit has been turned off before
> it generates code for MUL_PH, MUL_S_PH, MULQ_S_W, and MULQ_RS_W.
> 
> Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
> ---
>  target-mips/translate.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index b7f8203..0a53203 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -13400,6 +13400,7 @@ static void gen_mipsdsp_multiply(DisasContext *ctx, uint32_t op1, uint32_t op2,
>      /* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have
>       * the same mask and op1. */
>      case OPC_MULT_G_2E:
> +        check_dspr2(ctx);
>          switch (op2) {
>          case  OPC_MUL_PH:
>              gen_helper_mul_ph(cpu_gpr[ret], v1_t, v2_t, cpu_env);
> 

FWIW.  While the patch has been applied by Aurelien, I've a small
comment about the "trivialness" of patches, having in mind this
example.  This appears to be a "trivial" patch by the look of it,
that is, it is just one-liner adding a simple instruction.  But
nevertheless, it is NOT suitable for qemu-trivial, because it
need to be verified by the subsystem maintainer who understand
all the possible implications.  The patch changes core logic
which may have unexpected consequences in unexpected places,
it may lead to wrong code generation and bugs, and other "fun"
side effects.  In that way it is not "trivial", and really
need to be sent to subsystem maintainers (and to qemu-devel@),
not to the trivial patch queue.

From not-so-trivial stuff I can consider, for example, fixes in
command line processing which do not break backward compatibility
(if it wasn't outright bug like a misspelt option name), -- but
even there, it might be a good idea to discuss it on qemu-devel
anyway.

In other words, if you know some subsystem and to you some thing
looks really trivial, it isn't necessary the same for someone
who does not have the same knowlege about that subsystem.. ;)

Thank you!

/mjt


WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Petar Jovanovic <petar.jovanovic@rt-rk.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	petar.jovanovic@imgtec.com
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] target-mips: add missing check_dspr2 for multiply instructions
Date: Thu, 09 May 2013 12:32:59 +0400	[thread overview]
Message-ID: <518B5F3B.9050308@msgid.tls.msk.ru> (raw)
In-Reply-To: <1368022144-60111-1-git-send-email-petar.jovanovic@rt-rk.com>

08.05.2013 18:09, Petar Jovanovic wrote:
> From: Petar Jovanovic <petar.jovanovic@imgtec.com>
> 
> The emulator needs to check in hflags if DSP unit has been turned off before
> it generates code for MUL_PH, MUL_S_PH, MULQ_S_W, and MULQ_RS_W.
> 
> Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
> ---
>  target-mips/translate.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/target-mips/translate.c b/target-mips/translate.c
> index b7f8203..0a53203 100644
> --- a/target-mips/translate.c
> +++ b/target-mips/translate.c
> @@ -13400,6 +13400,7 @@ static void gen_mipsdsp_multiply(DisasContext *ctx, uint32_t op1, uint32_t op2,
>      /* OPC_MULT_G_2E, OPC_ADDUH_QB_DSP, OPC_MUL_PH_DSP have
>       * the same mask and op1. */
>      case OPC_MULT_G_2E:
> +        check_dspr2(ctx);
>          switch (op2) {
>          case  OPC_MUL_PH:
>              gen_helper_mul_ph(cpu_gpr[ret], v1_t, v2_t, cpu_env);
> 

FWIW.  While the patch has been applied by Aurelien, I've a small
comment about the "trivialness" of patches, having in mind this
example.  This appears to be a "trivial" patch by the look of it,
that is, it is just one-liner adding a simple instruction.  But
nevertheless, it is NOT suitable for qemu-trivial, because it
need to be verified by the subsystem maintainer who understand
all the possible implications.  The patch changes core logic
which may have unexpected consequences in unexpected places,
it may lead to wrong code generation and bugs, and other "fun"
side effects.  In that way it is not "trivial", and really
need to be sent to subsystem maintainers (and to qemu-devel@),
not to the trivial patch queue.

>From not-so-trivial stuff I can consider, for example, fixes in
command line processing which do not break backward compatibility
(if it wasn't outright bug like a misspelt option name), -- but
even there, it might be a good idea to discuss it on qemu-devel
anyway.

In other words, if you know some subsystem and to you some thing
looks really trivial, it isn't necessary the same for someone
who does not have the same knowlege about that subsystem.. ;)

Thank you!

/mjt

  parent reply	other threads:[~2013-05-09  8:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08 14:09 [Qemu-trivial] [PATCH] target-mips: add missing check_dspr2 for multiply instructions Petar Jovanovic
2013-05-08 14:09 ` [Qemu-devel] " Petar Jovanovic
2013-05-08 16:25 ` [Qemu-trivial] " Aurelien Jarno
2013-05-08 16:25   ` [Qemu-devel] " Aurelien Jarno
2013-05-09  8:32 ` Michael Tokarev [this message]
2013-05-09  8:32   ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

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=518B5F3B.9050308@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=petar.jovanovic@imgtec.com \
    --cc=petar.jovanovic@rt-rk.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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.