Skip to content

Commit

Permalink
target/xtensa: fix FPU2000 bugs
Browse files Browse the repository at this point in the history
- FPU2000 defines rfr and wfr opcodes, not rfr.s and wfr.s;
- movcond.s uses incorrect operand in tcg_gen_movcond: in case the
  condition is not satisfied it must not change its argument 0.

Fixes: c04e169 ("target/xtensa: extract FPU2000 opcode
translators")
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
jcmvbkbc committed Sep 17, 2018
1 parent 3ee0141 commit e8e05fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions target/xtensa/translate.c
Expand Up @@ -4706,7 +4706,7 @@ static void translate_movcond_s(DisasContext *dc, const uint32_t arg[],

tcg_gen_movcond_i32(par[0], cpu_FR[arg[0]],
cpu_R[arg[2]], zero,
cpu_FR[arg[1]], cpu_FR[arg[2]]);
cpu_FR[arg[1]], cpu_FR[arg[0]]);
tcg_temp_free(zero);
}
}
Expand Down Expand Up @@ -4867,7 +4867,7 @@ static const XtensaOpcodeOps fpu2000_ops[] = {
.translate = translate_compare_s,
.par = (const uint32_t[]){COMPARE_OLT},
}, {
.name = "rfr.s",
.name = "rfr",
.translate = translate_rfr_s,
}, {
.name = "round.s",
Expand Down Expand Up @@ -4921,7 +4921,7 @@ static const XtensaOpcodeOps fpu2000_ops[] = {
.translate = translate_ftoi_s,
.par = (const uint32_t[]){float_round_to_zero, true},
}, {
.name = "wfr.s",
.name = "wfr",
.translate = translate_wfr_s,
},
};
Expand Down

0 comments on commit e8e05fd

Please sign in to comment.