Skip to content

Commit e422e1c

Browse files
committed
target/arc: Fix arc_gen_MOV
Signed-off-by: Yuriy Kolerov <[email protected]>
1 parent c191641 commit e422e1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

target/arc/semfunc-v2.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,12 @@ arc_gen_MOV(DisasCtxt *ctx, TCGv a, TCGv b)
18281828
tcg_gen_andi_tl(temp_2, temp_2, 1);
18291829
tcg_gen_brcond_tl(TCG_COND_EQ, temp_2, arc_true, done_1);
18301830
tcg_gen_mov_tl(la, b);
1831-
tcg_gen_mov_tl(a, la);
1831+
1832+
// Do not save value for null instructions (destination is 0).
1833+
if (!(ctx->insn.operands[0].type & ARC_OPERAND_UNSIGNED && ctx->insn.operands[0].value == 0)) {
1834+
tcg_gen_mov_tl(a, la);
1835+
}
1836+
18321837
f_flag = getFFlag ();
18331838
if ((f_flag == true)) {
18341839
setZFlag(la);

0 commit comments

Comments
 (0)