[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 12/15] target-mips: microMIPS32 R6 POOL32{I, C} i
From: |
Yongbok Kim |
Subject: |
[Qemu-devel] [PATCH v4 12/15] target-mips: microMIPS32 R6 POOL32{I, C} instructions |
Date: |
Thu, 25 Jun 2015 00:24:24 +0100 |
Add new microMIPS32 Release 6 POOL32I/POOL32C type instructions
Signed-off-by: Yongbok Kim <address@hidden>
Reviewed-by: Aurelien Jarno <address@hidden>
---
target-mips/translate.c | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 4c8cf9f..2eacbb1 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -14652,9 +14652,18 @@ static void decode_micromips32_opc(CPUMIPSState *env,
DisasContext *ctx)
check_insn_opc_removed(ctx, ISA_MIPS32R6);
mips32_op = OPC_TGEIU;
goto do_trapi;
- case TNEI:
- mips32_op = OPC_TNEI;
- goto do_trapi;
+ case TNEI: /* SYNCI */
+ if (ctx->insn_flags & ISA_MIPS32R6) {
+ /* SYNCI */
+ /* Break the TB to be able to sync copied instructions
+ immediately */
+ ctx->bstate = BS_STOP;
+ } else {
+ /* TNEI */
+ mips32_op = OPC_TNEI;
+ goto do_trapi;
+ }
+ break;
case TEQI:
check_insn_opc_removed(ctx, ISA_MIPS32R6);
mips32_op = OPC_TEQI;
@@ -14727,6 +14736,8 @@ static void decode_micromips32_opc(CPUMIPSState *env,
DisasContext *ctx)
break;
case POOL32C:
minor = (ctx->opcode >> 12) & 0xf;
+ offset = sextract32(ctx->opcode, 0,
+ (ctx->insn_flags & ISA_MIPS32R6) ? 9 : 12);
switch (minor) {
case LWL:
check_insn_opc_removed(ctx, ISA_MIPS32R6);
@@ -14784,23 +14795,27 @@ static void decode_micromips32_opc(CPUMIPSState *env,
DisasContext *ctx)
mips32_op = OPC_LL;
goto do_ld_lr;
do_ld_lr:
- gen_ld(ctx, mips32_op, rt, rs, SIMM(ctx->opcode, 0, 12));
+ gen_ld(ctx, mips32_op, rt, rs, offset);
break;
do_st_lr:
gen_st(ctx, mips32_op, rt, rs, SIMM(ctx->opcode, 0, 12));
break;
case SC:
- gen_st_cond(ctx, OPC_SC, rt, rs, SIMM(ctx->opcode, 0, 12));
+ gen_st_cond(ctx, OPC_SC, rt, rs, offset);
break;
#if defined(TARGET_MIPS64)
case SCD:
check_insn(ctx, ISA_MIPS3);
check_mips_64(ctx);
- gen_st_cond(ctx, OPC_SCD, rt, rs, SIMM(ctx->opcode, 0, 12));
+ gen_st_cond(ctx, OPC_SCD, rt, rs, offset);
break;
#endif
case PREF:
/* Treat as no-op */
+ if ((ctx->insn_flags & ISA_MIPS32R6) && (rt >= 24)) {
+ /* hint codes 24-31 are reserved and signal RI */
+ generate_exception(ctx, EXCP_RI);
+ }
break;
default:
MIPS_INVAL("pool32c");
--
1.7.5.4
- [Qemu-devel] [PATCH v4 00/15] target-mips: add microMIPS32 R6 Instruction Set support, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 01/15] target-mips: fix {RD, WR}PGPR in microMIPS, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 02/15] target-mips: add microMIPS TLBINV, TLBINVF, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 03/15] target-mips: remove an unused argument, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 04/15] target-mips: refactor {D}LSA, {D}ALIGN, {D}BITSWAP, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 08/15] target-mips: add microMIPS32 R6 opcode enum, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 10/15] target-mips: microMIPS32 R6 POOL32A{XF} instructions, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 05/15] target-mips: rearrange gen_compute_compact_branch, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 12/15] target-mips: microMIPS32 R6 POOL32{I, C} instructions,
Yongbok Kim <=
- [Qemu-devel] [PATCH v4 13/15] target-mips: microMIPS32 R6 Major instructions, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 06/15] target-mips: raise RI exceptions when FIR.PS = 0, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 11/15] target-mips: microMIPS32 R6 POOL32F instructions, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 15/15] target-mips: add mips32r6-generic CPU definition, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 09/15] target-mips: microMIPS32 R6 branches and jumps, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 07/15] target-mips: signal RI for removed instructions in microMIPS R6, Yongbok Kim, 2015/06/24
- [Qemu-devel] [PATCH v4 14/15] target-mips: microMIPS32 R6 POOL16{A, C} instructions, Yongbok Kim, 2015/06/24