[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-4.1 1/7] tcg: Fix constant folding of INDEX_op_ex
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL for-4.1 1/7] tcg: Fix constant folding of INDEX_op_extract2_i32 |
Date: |
Sun, 14 Jul 2019 11:12:43 +0000 |
On a 64-bit host, discard any replications of the 32-bit
sign bit when performing the shift and merge.
Fixes: https://bugs.launchpad.net/bugs/1834496
Tested-by: Christophe Lyon <address@hidden>
Tested-by: Alex Bennée <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/optimize.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index d7c71a6085..d2424de4af 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1213,8 +1213,8 @@ void tcg_optimize(TCGContext *s)
if (opc == INDEX_op_extract2_i64) {
tmp = (v1 >> op->args[3]) | (v2 << (64 - op->args[3]));
} else {
- tmp = (v1 >> op->args[3]) | (v2 << (32 - op->args[3]));
- tmp = (int32_t)tmp;
+ tmp = (int32_t)(((uint32_t)v1 >> op->args[3]) |
+ ((uint32_t)v2 << (32 - op->args[3])));
}
tcg_opt_gen_movi(s, op, op->args[0], tmp);
break;
--
2.17.1
- [Qemu-devel] [PULL for-4.1 0/7] tcg patch queue, Richard Henderson, 2019/07/14
- [Qemu-devel] [PULL for-4.1 1/7] tcg: Fix constant folding of INDEX_op_extract2_i32,
Richard Henderson <=
- [Qemu-devel] [PULL for-4.1 3/7] include/qemu/atomic.h: Add signal_barrier, Richard Henderson, 2019/07/14
- [Qemu-devel] [PULL for-4.1 2/7] tcg/aarch64: Fix output of extract2 opcodes, Richard Henderson, 2019/07/14
- [Qemu-devel] [PULL for-4.1 5/7] tcg: Remove cpu_ld*_code_ra, Richard Henderson, 2019/07/14
- [Qemu-devel] [PULL for-4.1 4/7] tcg: Introduce set/clear_helper_retaddr, Richard Henderson, 2019/07/14
- [Qemu-devel] [PULL for-4.1 6/7] tcg: Remove duplicate #if !defined(CODE_ACCESS), Richard Henderson, 2019/07/14
- [Qemu-devel] [PULL for-4.1 7/7] tcg: Release mmap_lock on translation fault, Richard Henderson, 2019/07/14
- Re: [Qemu-devel] [PULL for-4.1 0/7] tcg patch queue, Peter Maydell, 2019/07/15