All of lore.kernel.org
 help / color / mirror / Atom feed
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 v5 01/14] target/mips: Introduce MXU registers
Date: Fri, 19 Oct 2018 18:33:35 +0200	[thread overview]
Message-ID: <1539966828-20947-2-git-send-email-aleksandar.markovic@rt-rk.com> (raw)
In-Reply-To: <1539966828-20947-1-git-send-email-aleksandar.markovic@rt-rk.com>

From: Craig Janeczek <jancraig@amazon.com>

Define and initialize the 16 MXU registers - 15 general computational
register, and 1 control register). There is also a zero register, but
it does not have any corresponding variable.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Craig Janeczek <jancraig@amazon.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 target/mips/cpu.h       | 10 ++++++++++
 target/mips/translate.c | 20 ++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index e48be4b..03c03fd 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -170,6 +170,16 @@ struct TCState {
         MSACSR_FS_MASK)
 
     float_status msa_fp_status;
+
+#define NUMBER_OF_MXU_REGISTERS 16
+    target_ulong mxu_gpr[NUMBER_OF_MXU_REGISTERS - 1];
+    target_ulong mxu_cr;
+#define MXU_CR_LC       31
+#define MXU_CR_RC       30
+#define MXU_CR_BIAS     2
+#define MXU_CR_RD_EN    1
+#define MXU_CR_MXU_EN   0
+
 };
 
 typedef struct CPUMIPSState CPUMIPSState;
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 3a0bdd5..ef7ad62 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -1937,6 +1937,10 @@ static TCGv_i32 fpu_fcr0, fpu_fcr31;
 static TCGv_i64 fpu_f64[32];
 static TCGv_i64 msa_wr_d[64];
 
+/* MXU registers */
+static TCGv mxu_gpr[NUMBER_OF_MXU_REGISTERS - 1];
+static TCGv mxu_CR;
+
 #include "exec/gen-icount.h"
 
 #define gen_helper_0e0i(name, arg) do {                           \
@@ -2059,6 +2063,11 @@ static const char * const msaregnames[] = {
     "w30.d0", "w30.d1", "w31.d0", "w31.d1",
 };
 
+static const char * const mxuregnames[] = {
+    "XR1",  "XR2",  "XR3",  "XR4",  "XR5",  "XR6",  "XR7",  "XR8",
+    "XR9",  "XR10", "XR11", "XR12", "XR13", "XR14", "XR15", "MXU_CR",
+};
+
 #define LOG_DISAS(...)                                                        \
     do {                                                                      \
         if (MIPS_DEBUG_DISAS) {                                               \
@@ -26264,6 +26273,17 @@ void mips_tcg_init(void)
     fpu_fcr31 = tcg_global_mem_new_i32(cpu_env,
                                        offsetof(CPUMIPSState, active_fpu.fcr31),
                                        "fcr31");
+
+    for (i = 0; i < NUMBER_OF_MXU_REGISTERS - 1; i++) {
+        mxu_gpr[i] = tcg_global_mem_new(cpu_env,
+                                        offsetof(CPUMIPSState,
+                                                 active_tc.mxu_gpr[i]),
+                                        mxuregnames[i]);
+    }
+
+    mxu_CR = tcg_global_mem_new(cpu_env,
+                                offsetof(CPUMIPSState, active_tc.mxu_cr),
+                                mxuregnames[NUMBER_OF_MXU_REGISTERS - 1]);
 }
 
 #include "translate_init.inc.c"
-- 
2.7.4

  reply	other threads:[~2018-10-19 16:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 16:33 [Qemu-devel] [PATCH v5 00/14] Add limited MXU instruction support Aleksandar Markovic
2018-10-19 16:33 ` Aleksandar Markovic [this message]
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 02/14] target/mips: Define a bit for MXU in insn_flags Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 03/14] target/mips: Add and integrate MXU decoding engine placeholder Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 04/14] target/mips: Add MXU decoding engine Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 05/14] target/mips: Add bit encoding for MXU add/subtract patterns 'aptn2' Aleksandar Markovic
2018-10-19 17:12   ` Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 06/14] target/mips: Add bit encoding for MXU operand getting patterns 'optn2' Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 07/14] target/mips: Add bit encoding for MXU operand getting patterns 'optn3' Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 08/14] target/mips: Add emulation of non-MXU MULL within MXU decoding engine Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 09/14] target/mips: Add emulation of MXU instructions S32I2M and S32M2I Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 10/14] target/mips: Add emulation of MXU instruction S8LDD Aleksandar Markovic
2018-10-19 17:15   ` Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 11/14] target/mips: Add emulation of MXU instruction D16MUL Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 12/14] target/mips: Add emulation of MXU instruction D16MAC Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 13/14] target/mips: Add emulation of MXU instructions Q8MUL and Q8MULSU Aleksandar Markovic
2018-10-19 16:33 ` [Qemu-devel] [PATCH v5 14/14] 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=1539966828-20947-2-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 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.