From 6bfa9f4c9cf24d6cfaaa227722e9cdcca1ad6fe9 Mon Sep 17 00:00:00 2001 From: Aleksandar Markovic Date: Thu, 2 Aug 2018 16:16:05 +0200 Subject: [PATCH] target/mips: Add nanoMIPS decoding and extraction utilities Add some basic utility functions and macros for nanoMIPS decoding engine. Reviewed-by: Richard Henderson Signed-off-by: Yongbok Kim Signed-off-by: Aleksandar Markovic Signed-off-by: Stefan Markovic --- target/mips/translate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.11.4.GIT