[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 22/84] target/mips: Add emulation of nanoMIPS 16-
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PATCH v9 22/84] target/mips: Add emulation of nanoMIPS 16-bit branch instructions |
Date: |
Thu, 16 Aug 2018 16:57:15 +0200 |
From: Yongbok Kim <address@hidden>
Add emulation of nanoMIPS 16-bit branch instructions.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Stefan Markovic <address@hidden>
---
target/mips/translate.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/target/mips/translate.c b/target/mips/translate.c
index f9ec95b..05c8b8f 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -16746,14 +16746,50 @@ static int decode_nanomips_opc(CPUMIPSState *env,
DisasContext *ctx)
case NM_SWGP16:
break;
case NM_BC16:
+ gen_compute_branch(ctx, OPC_BEQ, 2, 0, 0,
+ (sextract32(ctx->opcode, 0, 1) << 10) |
+ (extract32(ctx->opcode, 1, 9) << 1), 0);
break;
case NM_BALC16:
+ gen_compute_branch(ctx, OPC_BGEZAL, 2, 0, 0,
+ (sextract32(ctx->opcode, 0, 1) << 10) |
+ (extract32(ctx->opcode, 1, 9) << 1), 0);
break;
case NM_BEQZC16:
+ gen_compute_branch(ctx, OPC_BEQ, 2, rt, 0,
+ (sextract32(ctx->opcode, 0, 1) << 7) |
+ (extract32(ctx->opcode, 1, 6) << 1), 0);
break;
case NM_BNEZC16:
+ gen_compute_branch(ctx, OPC_BNE, 2, rt, 0,
+ (sextract32(ctx->opcode, 0, 1) << 7) |
+ (extract32(ctx->opcode, 1, 6) << 1), 0);
break;
case NM_P16_BR:
+ switch (ctx->opcode & 0xf) {
+ case 0:
+ /* P16.JRC */
+ switch (extract32(ctx->opcode, 4, 1)) {
+ case NM_JRC:
+ gen_compute_branch(ctx, OPC_JR, 2,
+ extract32(ctx->opcode, 5, 5), 0, 0, 0);
+ break;
+ case NM_JALRC16:
+ gen_compute_branch(ctx, OPC_JALR, 2,
+ extract32(ctx->opcode, 5, 5), 31, 0, 0);
+ break;
+ }
+ break;
+ default:
+ {
+ /* P16.BRI */
+ uint32_t opc = extract32(ctx->opcode, 4, 3) <
+ extract32(ctx->opcode, 7, 3) ? OPC_BEQ :
OPC_BNE;
+ gen_compute_branch(ctx, opc, 2, rs, rt,
+ extract32(ctx->opcode, 0, 4) << 1, 0);
+ }
+ break;
+ }
break;
case NM_P16_SR:
break;
--
2.7.4
- [Qemu-devel] [PATCH v9 12/84] elf: Add ELF flags for MIPS machine variants, (continued)
- [Qemu-devel] [PATCH v9 12/84] elf: Add ELF flags for MIPS machine variants, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 01/84] MAINTAINERS: Update target/mips maintainer's email addresses, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 08/84] target/mips: Implement CP0 Config1.WR bit functionality, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 21/84] target/mips: Add emulation of nanoMIPS 16-bit arithmetic instructions, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 02/84] target/mips: Avoid case statements formulated by ranges - part 1, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 28/84] target/mips: Add emulation of some common nanoMIPS 32-bit instructions, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 17/84] target/mips: Add nanoMIPS base instruction set opcodes, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 14/84] linux-user: Add preprocessor availability control to some syscalls, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 22/84] target/mips: Add emulation of nanoMIPS 16-bit branch instructions,
Aleksandar Markovic <=
- [Qemu-devel] [PATCH v9 04/84] target/mips: Mark switch fallthroughs with interpretable comments, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 03/84] target/mips: Avoid case statements formulated by ranges - part 2, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 15/84] qemu-doc: Amend MIPS-related items, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 13/84] linux-user: Update MIPS syscall numbers up to kernel 4.18 headers, Aleksandar Markovic, 2018/08/16
- [Qemu-devel] [PATCH v9 35/84] target/mips: Implement emulation of nanoMIPS ROTX instruction, Aleksandar Markovic, 2018/08/16