Skip to content

Commit b115744

Browse files
committed
Fix the TCG code of V850 SETF instruction.
1 parent fedf2fc commit b115744

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

qemu/target/rh850/translate.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -2217,17 +2217,20 @@ static void gen_data_manipulation(DisasContext *ctx, int rs1, int rs2, int opera
22172217
int_cond = extract32(ctx->opcode,0,4);
22182218
TCGv condResult = condition_satisfied(tcg_ctx, int_cond);
22192219
cont = gen_new_label(tcg_ctx);
2220+
end = gen_new_label(tcg_ctx);
22202221

2221-
tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000000);
22222222
tcg_gen_brcondi_i32(tcg_ctx, TCG_COND_NE, condResult, 0x1, cont);
2223-
tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000001);
2223+
tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000001);
2224+
tcg_gen_br(tcg_ctx, end);
22242225

22252226
gen_set_label(tcg_ctx, cont);
2226-
2227+
tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000000);
2228+
2229+
gen_set_label(tcg_ctx, end);
22272230
gen_set_gpr(tcg_ctx, rs2, operand_local);
22282231

2229-
tcg_temp_free(tcg_ctx, condResult);
2230-
tcg_temp_free(tcg_ctx, operand_local);
2232+
tcg_temp_free(tcg_ctx, condResult);
2233+
tcg_temp_free(tcg_ctx, operand_local);
22312234
}
22322235
break;
22332236

@@ -4250,6 +4253,7 @@ static void decode_RH850_32(CPURH850State *env, DisasContext *ctx)
42504253
}
42514254
else
42524255
{
4256+
printf("gen SETF\r\n");
42534257
gen_data_manipulation(ctx, rs1, rs2, OPC_RH850_SETF_cccc_reg2);
42544258
}
42554259
break;

0 commit comments

Comments
 (0)