Skip to content

Commit

Permalink
target/mips: Add emulation of nanoMIPS 16-bit shift instructions
Browse files Browse the repository at this point in the history
Add emulation of nanoMIPS 16-bit shift instructions.

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>
  • Loading branch information
yongbok authored and AMarkovic committed Aug 24, 2018
1 parent 764371d commit c46562f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions target/mips/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -16765,6 +16765,21 @@ static int decode_nanomips_opc(CPUMIPSState *env, DisasContext *ctx)
case NM_P16_MV:
break;
case NM_P16_SHIFT:
{
int shift = extract32(ctx->opcode, 0, 3);
uint32_t opc = 0;
shift = (shift == 0) ? 8 : shift;

switch (extract32(ctx->opcode, 3, 1)) {
case NM_SLL16:
opc = OPC_SLL;
break;
case NM_SRL16:
opc = OPC_SRL;
break;
}
gen_shift_imm(ctx, opc, rt, rs, shift);
}
break;
case NM_P16C:
break;
Expand Down

0 comments on commit c46562f

Please sign in to comment.