]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tcg/optimize: Build and use o_bits in fold_movcond
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 10 Dec 2024 22:30:12 +0000 (16:30 -0600)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 30 Jun 2025 13:42:38 +0000 (07:42 -0600)
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/optimize.c

index 42d5ee23c0dbc50dcfe12297b5f27d64c96edce5..abcbee91111ce30d1b108aa5c22ba55eca354564 100644 (file)
@@ -2097,7 +2097,7 @@ static bool fold_mov(OptContext *ctx, TCGOp *op)
 
 static bool fold_movcond(OptContext *ctx, TCGOp *op)
 {
-    uint64_t z_mask, s_mask;
+    uint64_t z_mask, o_mask, s_mask;
     TempOptInfo *tt, *ft;
     int i;
 
@@ -2123,6 +2123,7 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
     tt = arg_info(op->args[3]);
     ft = arg_info(op->args[4]);
     z_mask = tt->z_mask | ft->z_mask;
+    o_mask = tt->o_mask & ft->o_mask;
     s_mask = tt->s_mask & ft->s_mask;
 
     if (ti_is_const(tt) && ti_is_const(ft)) {
@@ -2145,7 +2146,7 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op)
         }
     }
 
-    return fold_masks_zs(ctx, op, z_mask, s_mask);
+    return fold_masks_zos(ctx, op, z_mask, o_mask, s_mask);
 }
 
 static bool fold_mul(OptContext *ctx, TCGOp *op)