aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Markovic <amarkovic@wavecomp.com>2018-12-25 15:06:15 +0100
committerAleksandar Markovic <amarkovic@wavecomp.com>2019-01-03 17:52:52 +0100
commit01fc2557ca59c86b6583724ea1952dc2ee271a57 (patch)
treec5fac1f7c68ae010d6d991fac2d17e13a71d705e
parent988d6c897c03cf333f820f9ddb6dde1d663d50c0 (diff)
disas: nanoMIPS: Comment the decoder of 'gpr3' gpr encoding type
Comment the decoder of 'gpr3' gpr encoding type in nanoMIPS disassembler. Reviewed-by: Aleksandar Rikalo <arikalo@wavecomp.com> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
-rw-r--r--disas/nanomips.cpp51
1 files changed, 48 insertions, 3 deletions
diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 2856645330..30988f8b78 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -292,9 +292,54 @@ uint64 NMD::renumber_registers(uint64 index, uint64 *register_list,
/*
- * these functions should be decode functions but the json does not have
- * decode sections so they are based on the encode, the equivalent decode
- * functions need writing eventually.
+ * NMD::decode_gpr_gpr3() - decoder for 'gpr3' gpr encoding type
+ *
+ * Map a 3-bit code to the 5-bit register space according to this pattern:
+ *
+ * 7 6 5 4 3 2 1 0
+ * | | | | | | | |
+ * | | | | | | | |
+ * | | | └-----------------------┐
+ * | | └-----------------------┐ |
+ * | └-----------------------┐ | |
+ * └-----------------------┐ | | |
+ * | | | | | | | |
+ * ┌-------┘ | | | | | | |
+ * | ┌-------┘ | | | | | |
+ * | | ┌-------┘ | | | | |
+ * | | | ┌-------┘ | | | |
+ * | | | | | | | |
+ * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+ * 3 2 1 0
+ *
+ * Used in handling following instructions:
+ *
+ * - ADDIU[R1.SP]
+ * - ADDIU[R2]
+ * - ADDU[16]
+ * - AND[16]
+ * - ANDI[16]
+ * - BEQC[16]
+ * - BEQZC[16]
+ * - BNEC[16]
+ * - BNEZC[16]
+ * - LB[16]
+ * - LBU[16]
+ * - LH[16]
+ * - LHU[16]
+ * - LI[16]
+ * - LW[16]
+ * - LW[GP16]
+ * - LWXS[16]
+ * - NOT[16]
+ * - OR[16]
+ * - SB[16]
+ * - SH[16]
+ * - SLL[16]
+ * - SRL[16]
+ * - SUBU[16]
+ * - SW[16]
+ * - XOR[16]
*/
uint64 NMD::decode_gpr_gpr3(uint64 d)
{