[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/11] target/hppa: fix overwriting source reg in add
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 02/11] target/hppa: fix overwriting source reg in addb |
Date: |
Tue, 12 Mar 2019 09:18:55 -0700 |
From: Sven Schnelle <address@hidden>
When one of the source registers is the same as the destination register,
the source register gets overwritten with the destionation value before
do_add_sv() is called, which leads to unexpection condition matches.
Signed-off-by: Sven Schnelle <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/hppa/translate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 6c815e05c2..c4815d7e1a 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -3031,7 +3031,7 @@ static bool do_addb(DisasContext *ctx, unsigned r,
TCGv_reg in1,
DisasCond cond;
in2 = load_gpr(ctx, r);
- dest = dest_gpr(ctx, r);
+ dest = tcg_temp_new();
sv = NULL;
cb_msb = NULL;
@@ -3047,6 +3047,8 @@ static bool do_addb(DisasContext *ctx, unsigned r,
TCGv_reg in1,
}
cond = do_cond(c * 2 + f, dest, cb_msb, sv);
+ save_gpr(ctx, r, dest);
+ tcg_temp_free(dest);
return do_cbranch(ctx, disp, n, &cond);
}
--
2.17.2
- [Qemu-devel] [PULL 00/11] target/hppa patch queue, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 01/11] target/hppa: Check for page crossings in use_goto_tb, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 02/11] target/hppa: fix overwriting source reg in addb,
Richard Henderson <=
- [Qemu-devel] [PULL 03/11] target/hppa: fix TLB handling for page 0, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 05/11] target/hppa: add TLB trace events, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 04/11] target/hppa: report ITLB_EXCP_MISS for ITLB misses, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 06/11] target/hppa: remove PSW I/R/Q bit check, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 08/11] target/hppa: fix b,gate instruction, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 07/11] target/hppa: ignore DIAG opcode, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 09/11] target/hppa: allow multiple itlbp without itlba, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 10/11] target/hppa: add TLB protection id check, Richard Henderson, 2019/03/12
- [Qemu-devel] [PULL 11/11] target/hppa: exit TB if either Data or Instruction TLB changes, Richard Henderson, 2019/03/12
- Re: [Qemu-devel] [PULL 00/11] target/hppa patch queue, no-reply, 2019/03/12