aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tcg/optimize.c4
1 files 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;