mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-08 23:15:32 +00:00
tcg: Fix constant folding of INDEX_op_extract2_i32
On a 64-bit host, discard any replications of the 32-bit sign bit when performing the shift and merge. Backports commit 80f4d7c3ae216c191fb403e149bcba88d6aa40bb from qemu
This commit is contained in:
parent
3ee580d58f
commit
b2d75f4955
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue