All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fredrik Noring <noring@nocrew.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Aleksandar Markovic" <amarkovic@wavecomp.com>,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"Jürgen Urban" <JuergenUrban@gmx.de>
Subject: Re: [Qemu-devel] [PATCH] target/mips: Support Toshiba specific three-operand MADD and MADDU
Date: Mon, 15 Oct 2018 17:36:10 +0200	[thread overview]
Message-ID: <20181015153610.GA2364@sx9> (raw)
In-Reply-To: <CAAdtpL5xQYwyR0VxqAhA3dW9ec2KW07n-GKrMCt=UjQqwsuYHQ@mail.gmail.com>

Hi Philippe,

> That's true it is not reachable, it lacks the INSN_R3900 definition,
> used by the R3900 mips_def_t.
> 
> I'll stop bothering with this until the code is reachable (my branch posted).

I would be happy if your patch could be merged soon. Adding the following
five lines to it would make both MADD and MADDU immediately reachable and
testable, at least for the R5900 to begin with:

--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -22768,6 +22768,11 @@ static void decode_opc_special2_legacy(CPUMIPSState *env, DisasContext *ctx)
     switch (op1) {
     case OPC_MADD: /* Multiply and add/sub */
     case OPC_MADDU:
+        if (ctx->insn_flags & INSN_R5900) {
+            gen_mul_txx9(ctx, op1, 0, rd, rs, rt);
+            break;
+        }
+        /* Fallthrough */
     case OPC_MSUB:
     case OPC_MSUBU:
         check_insn(ctx, ISA_MIPS32);

> To be able to use the 64-bit result we need to use tcg_gen_mul_i64().

tcg_gen_muls2_i32 produces a 64-bit result in two 32-bit registers, and
tcg_gen_add2_i32 seems to correspond to adding such registers. And then
tcg_gen_ext_i32_tl could be used to extend the results to 64 bits. Look
at the cases for MULT and MULTU, since they are very similar.

Fredrik

  parent reply	other threads:[~2018-10-15 15:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-14 14:29 [Qemu-devel] [PATCH] target/mips: Support Toshiba specific three-operand MADD and MADDU Philippe Mathieu-Daudé
2018-10-14 16:41 ` Fredrik Noring
2018-10-14 21:56   ` Philippe Mathieu-Daudé
2018-10-14 23:03     ` Maciej W. Rozycki
2018-10-15 17:02       ` Fredrik Noring
2018-10-16  9:43         ` Aleksandar Markovic
2018-10-16 18:19           ` Fredrik Noring
2018-10-16 18:37             ` Richard Henderson
2018-10-16 18:52               ` Fredrik Noring
2018-10-16 19:02                 ` Maciej W. Rozycki
2018-10-19 18:09                   ` Aleksandar Markovic
2018-10-28 19:43               ` Aleksandar Markovic
2018-10-28 20:00                 ` Maciej W. Rozycki
2018-10-29 11:52                 ` Aleksandar Markovic
2018-10-29 14:51                   ` Fredrik Noring
2018-10-29 15:03                     ` Aleksandar Markovic
2018-10-29 15:44                       ` Maciej W. Rozycki
2018-10-16 18:55             ` Maciej W. Rozycki
2018-10-15 15:36     ` Fredrik Noring [this message]
2018-10-24 18:01 ` Fredrik Noring
2018-10-26 11:17   ` Aleksandar Markovic

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=20181015153610.GA2364@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.