translate: don't touch registers in CMPD
This commit is contained in:
parent
a52b787a70
commit
35dd059fbf
1 changed files with 8 additions and 3 deletions
|
|
@ -743,14 +743,19 @@ static bool trans_CMP_reg(DisasContext *ctx, arg_CMP_reg *a) {
|
|||
}
|
||||
|
||||
static bool trans_CMPD_reg(DisasContext *ctx, arg_CMPD_reg *a) {
|
||||
TCGv tmp_a = tcg_temp_new_i32();
|
||||
TCGv tmp_b = tcg_temp_new_i32();
|
||||
tcg_gen_mov_i32(tmp_a, r[a->rs1]);
|
||||
tcg_gen_mov_i32(tmp_b, r[a->rs2]);
|
||||
|
||||
if (a->rs1 < CR16C_FIRST_32B_REG) {
|
||||
tcg_gen_deposit_i32(r[a->rs1], r[a->rs1], r[a->rs1+1], 16, 16);
|
||||
tcg_gen_deposit_i32(tmp_a, tmp_a, r[a->rs1+1], 16, 16);
|
||||
}
|
||||
if (a->rs2 < CR16C_FIRST_32B_REG) {
|
||||
tcg_gen_deposit_i32(r[a->rs2], r[a->rs2], r[a->rs2+1], 16, 16);
|
||||
tcg_gen_deposit_i32(tmp_b, tmp_b, r[a->rs2+1], 16, 16);
|
||||
}
|
||||
|
||||
gen_cmp(r[a->rs2], r[a->rs1]);
|
||||
gen_cmp(tmp_b, tmp_a);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue