[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/41] target/arm: Fix sign-extension for SMLAL*
From: |
Peter Maydell |
Subject: |
[PULL 01/41] target/arm: Fix sign-extension for SMLAL* |
Date: |
Tue, 22 Oct 2019 14:30:54 +0100 |
From: Richard Henderson <address@hidden>
The 32-bit product should be sign-extended, not zero-extended.
Fixes: ea96b374641b
Reported-by: Laurent Desnogues <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Desnogues <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
target/arm/translate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 698c594e8ce..96340520ee2 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -8045,7 +8045,9 @@ static bool op_smlaxxx(DisasContext *s, arg_rrrr *a,
case 2:
tl = load_reg(s, a->ra);
th = load_reg(s, a->rd);
- t1 = tcg_const_i32(0);
+ /* Sign-extend the 32-bit product to 64 bits. */
+ t1 = tcg_temp_new_i32();
+ tcg_gen_sari_i32(t1, t0, 31);
tcg_gen_add2_i32(tl, th, tl, th, t0, t1);
tcg_temp_free_i32(t0);
tcg_temp_free_i32(t1);
--
2.20.1
- [PULL 00/41] target-arm queue, Peter Maydell, 2019/10/22
- [PULL 01/41] target/arm: Fix sign-extension for SMLAL*,
Peter Maydell <=
- [PULL 02/41] aspeed: Add an AST2600 eval board, Peter Maydell, 2019/10/22
- [PULL 03/41] hw/timer/exynos4210_mct: Initialize ptimer before starting it, Peter Maydell, 2019/10/22
- [PULL 05/41] hw/timer/puv3_ost.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/22
- [PULL 04/41] hw/timer/arm_mptimer.c: Undo accidental rename of arm_mptimer_init(), Peter Maydell, 2019/10/22
- [PULL 06/41] hw/timer/sh_timer: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/22
- [PULL 07/41] hw/timer/lm32_timer: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/22
- [PULL 08/41] hw/timer/altera_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/22
- [PULL 09/41] hw/watchdog/etraxfs_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/22
- [PULL 10/41] hw/m68k/mcf5208.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/22
- [PULL 11/41] target/arm: Split out rebuild_hflags_common, Peter Maydell, 2019/10/22