Skip to content

Commit

Permalink
Fix the TCG code of V850 SETF instruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien Cauquil committed Mar 8, 2024
1 parent fedf2fc commit b115744
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions qemu/target/rh850/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,17 +2217,20 @@ static void gen_data_manipulation(DisasContext *ctx, int rs1, int rs2, int opera
int_cond = extract32(ctx->opcode,0,4);
TCGv condResult = condition_satisfied(tcg_ctx, int_cond);
cont = gen_new_label(tcg_ctx);
end = gen_new_label(tcg_ctx);

tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000000);
tcg_gen_brcondi_i32(tcg_ctx, TCG_COND_NE, condResult, 0x1, cont);
tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000001);
tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000001);
tcg_gen_br(tcg_ctx, end);

gen_set_label(tcg_ctx, cont);

tcg_gen_movi_i32(tcg_ctx, operand_local, 0x00000000);

gen_set_label(tcg_ctx, end);
gen_set_gpr(tcg_ctx, rs2, operand_local);

tcg_temp_free(tcg_ctx, condResult);
tcg_temp_free(tcg_ctx, operand_local);
tcg_temp_free(tcg_ctx, condResult);
tcg_temp_free(tcg_ctx, operand_local);
}
break;

Expand Down Expand Up @@ -4250,6 +4253,7 @@ static void decode_RH850_32(CPURH850State *env, DisasContext *ctx)
}
else
{
printf("gen SETF\r\n");
gen_data_manipulation(ctx, rs1, rs2, OPC_RH850_SETF_cccc_reg2);
}
break;
Expand Down

0 comments on commit b115744

Please sign in to comment.