target-mips: add missing restriction in DAUI instruction
PATCH 1/1 target-mips: add missing restriction in DAUI instruction
rs cannot be the zero register, Reserved Instruction exception must be signalled for this case.
Signed-off-by Leon Alrae <[email protected]>
--- target-mips/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
target-mips/translate.c +3 -1
@@ -19512,7 +19512,9 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)#if defined(TARGET_MIPS64 )/* OPC_DAUI */ check_mips_64 (ctx); -if (rt !=0 ) { +if (rs ==0 ) { +generate_exception (ctx,EXCP_RI ); + }else if (rt !=0 ) {TCGv t0 =tcg_temp_new ();gen_load_gpr (t0, rs);tcg_gen_addi_tl (cpu_gpr[rt], t0, imm <<16 );
Signature · 1 line
2.1.0
Quoted 13 lines · Leon Alrae
rs cannot be the zero register, Reserved Instruction exception must be signalled for this case.
Signed-off-by Leon Alrae <[email protected]>--- target-mips/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)target-mips/translate.c +0
-0
target-mips/translate.c static void decode_opc(CPUMIPSState *env, DisasContext *ctx) · line 19520
Quoted 10 lines
target-mips/translate.c +3
-1@@ -19512,7 +19512,9 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)#if defined(TARGET_MIPS64 )/* OPC_DAUI */ check_mips_64 (ctx); -if (rt !=0 ) { +if (rs ==0 ) { +generate_exception (ctx,EXCP_RI ); + }else if (rt !=0 ) {TCGv t0 =tcg_temp_new ();gen_load_gpr (t0, rs);tcg_gen_addi_tl (cpu_gpr[rt], t0, imm <<16 );
Reviewed-by Aurelien Jarno <[email protected]>
Signature · 2 lines
Aurelien Jarno GPG: 4096R/1DDD8C9B [email protected] http://www.aurel32.net