From: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net, richard.henderson@linaro.org,
jancraig@amazon.com, amarkovic@wavecomp.com,
smarkovic@wavecomp.com, pjovanovic@wavecomp.com
Subject: [Qemu-devel] [PATCH v6 13/18] target/mips: Move MUL, S32M2I, S32I2M handling out of main MXU switch
Date: Tue, 23 Oct 2018 18:18:24 +0200 [thread overview]
Message-ID: <1540311509-23970-14-git-send-email-aleksandar.markovic@rt-rk.com> (raw)
In-Reply-To: <1540311509-23970-1-git-send-email-aleksandar.markovic@rt-rk.com>
From: Aleksandar Markovic <amarkovic@wavecomp.com>
Move MUL, S32M2I, S32I2M handling out of switch. These are all
instructions that do not depend on MXU_EN flag of MXU_CR.
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
target/mips/translate.c | 41 +++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/target/mips/translate.c b/target/mips/translate.c
index c8c71c4..111affb 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -24859,6 +24859,29 @@ static void decode_opc_mxu(CPUMIPSState *env, DisasContext *ctx)
{
uint32_t opcode = extract32(ctx->opcode, 0, 6);
+ if (opcode == OPC__MXU_MUL) {
+ uint32_t rs, rt, rd, op1;
+
+ rs = extract32(ctx->opcode, 21, 5);
+ rt = extract32(ctx->opcode, 16, 5);
+ rd = extract32(ctx->opcode, 11, 5);
+ op1 = MASK_SPECIAL2(ctx->opcode);
+
+ gen_arith(ctx, op1, rd, rs, rt);
+
+ return;
+ }
+
+ if (opcode == OPC_MXU_S32M2I) {
+ gen_mxu_s32m2i(ctx);
+ return;
+ }
+
+ if (opcode == OPC_MXU_S32I2M) {
+ gen_mxu_s32i2m(ctx);
+ return;
+ }
+
switch (opcode) {
case OPC_MXU_S32MADD:
/* TODO: Implement emulation of S32MADD instruction. */
@@ -24870,18 +24893,6 @@ static void decode_opc_mxu(CPUMIPSState *env, DisasContext *ctx)
MIPS_INVAL("OPC_MXU_S32MADDU");
generate_exception_end(ctx, EXCP_RI);
break;
- case OPC__MXU_MUL: /* 0x2 - unused in MXU specs */
- {
- uint32_t rs, rt, rd, op1;
-
- rs = extract32(ctx->opcode, 21, 5);
- rt = extract32(ctx->opcode, 16, 5);
- rd = extract32(ctx->opcode, 11, 5);
- op1 = MASK_SPECIAL2(ctx->opcode);
-
- gen_arith(ctx, op1, rd, rs, rt);
- }
- break;
case OPC_MXU__POOL00:
decode_opc_mxu__pool00(env, ctx);
break;
@@ -25033,12 +25044,6 @@ static void decode_opc_mxu(CPUMIPSState *env, DisasContext *ctx)
MIPS_INVAL("OPC_MXU_S16SDI");
generate_exception_end(ctx, EXCP_RI);
break;
- case OPC_MXU_S32M2I:
- gen_mxu_s32m2i(ctx);
- break;
- case OPC_MXU_S32I2M:
- gen_mxu_s32i2m(ctx);
- break;
case OPC_MXU_D32SLL:
/* TODO: Implement emulation of D32SLL instruction. */
MIPS_INVAL("OPC_MXU_D32SLL");
--
2.7.4
next prev parent reply other threads:[~2018-10-23 16:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 16:18 [Qemu-devel] [PATCH v6 00/18] target/mips: Add limited support for Ingenic's MXU ASE Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 01/18] target/mips: Introduce MXU registers Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 02/18] target/mips: Define a bit for MXU in insn_flags Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 03/18] target/mips: Amend MXU instruction opcodes Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 04/18] target/mips: Add and integrate MXU decoding engine placeholder Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 05/18] target/mips: Add MXU decoding engine Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 06/18] target/mips: Add bit encoding for MXU accumulate add/sub 1-bit pattern 'aptn1' Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 07/18] target/mips: Add bit encoding for MXU accumulate add/sub 2-bit pattern 'aptn2' Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 08/18] target/mips: Add bit encoding for MXU execute add/sub pattern 'eptn2' Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 09/18] target/mips: Add bit encoding for MXU operand getting pattern 'optn2' Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 10/18] target/mips: Add bit encoding for MXU operand getting pattern 'optn3' Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 11/18] target/mips: Add emulation of non-MXU MULL within MXU decoding engine Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 12/18] target/mips: Add emulation of MXU instructions S32I2M and S32M2I Aleksandar Markovic
2018-10-23 16:18 ` Aleksandar Markovic [this message]
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 14/18] target/mips: Add emulation of MXU instruction S8LDD Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 15/18] target/mips: Add emulation of MXU instruction D16MUL Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 16/18] target/mips: Add emulation of MXU instruction D16MAC Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 17/18] target/mips: Add emulation of MXU instructions Q8MUL and Q8MULSU Aleksandar Markovic
2018-10-23 16:18 ` [Qemu-devel] [PATCH v6 18/18] target/mips: Add emulation of MXU instructions S32LDD and S32LDDR 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=1540311509-23970-14-git-send-email-aleksandar.markovic@rt-rk.com \
--to=aleksandar.markovic@rt-rk.com \
--cc=amarkovic@wavecomp.com \
--cc=aurelien@aurel32.net \
--cc=jancraig@amazon.com \
--cc=pjovanovic@wavecomp.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=smarkovic@wavecomp.com \
/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).