aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorAleksandar Markovic <amarkovic@wavecomp.com>2018-08-02 16:16:05 +0200
committerAleksandar Markovic <amarkovic@wavecomp.com>2018-08-24 17:51:59 +0200
commit6bfa9f4c9cf24d6cfaaa227722e9cdcca1ad6fe9 (patch)
treeaa5fe9167c42981bce1c85a3e88b8b93a6f10055 /target
parentc533c0f4741be62501ef6c7f6ce77ffbfc2e4964 (diff)
target/mips: Add nanoMIPS decoding and extraction utilities
Add some basic utility functions and macros for nanoMIPS decoding engine. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Yongbok Kim <yongbok.kim@mips.com> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
Diffstat (limited to 'target')
-rw-r--r--target/mips/translate.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 4184d91b7c..ab982cf6d6 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -16593,6 +16593,17 @@ enum {
*
*/
+
+/* extraction utilities */
+
+#define NANOMIPS_EXTRACT_RD(op) ((op >> 7) & 0x7)
+#define NANOMIPS_EXTRACT_RS(op) ((op >> 4) & 0x7)
+#define NANOMIPS_EXTRACT_RS2(op) uMIPS_RS(op)
+#define NANOMIPS_EXTRACT_RS1(op) ((op >> 1) & 0x7)
+#define NANOMIPS_EXTRACT_RD5(op) ((op >> 5) & 0x1f)
+#define NANOMIPS_EXTRACT_RS5(op) (op & 0x1f)
+
+
static int decode_nanomips_opc(CPUMIPSState *env, DisasContext *ctx)
{
return 2;