summaryrefslogtreecommitdiffstats
path: root/target/mips/translate.c
diff options
context:
space:
mode:
authorAleksandar Markovic2018-08-02 16:16:05 +0200
committerAleksandar Markovic2018-08-24 17:51:59 +0200
commit6bfa9f4c9cf24d6cfaaa227722e9cdcca1ad6fe9 (patch)
treeaa5fe9167c42981bce1c85a3e88b8b93a6f10055 /target/mips/translate.c
parenttarget/mips: Add placeholder and invocation of decode_nanomips_opc() (diff)
downloadqemu-6bfa9f4c9cf24d6cfaaa227722e9cdcca1ad6fe9.tar.gz
qemu-6bfa9f4c9cf24d6cfaaa227722e9cdcca1ad6fe9.tar.xz
qemu-6bfa9f4c9cf24d6cfaaa227722e9cdcca1ad6fe9.zip
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/mips/translate.c')
-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;