diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-10 15:58:04 -0600 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2025-06-30 07:42:38 -0600 |
commit | f78342472fb4de10aa78e5cb5e2f502700d5a728 (patch) | |
tree | 9a7f38767a39952a8dbc8ffeab7242ee3f81a2a5 | |
parent | de85257f14a5b16edb754190e850de1e916ac37c (diff) | |
download | qemu-f78342472fb4de10aa78e5cb5e2f502700d5a728.zip qemu-f78342472fb4de10aa78e5cb5e2f502700d5a728.tar.gz qemu-f78342472fb4de10aa78e5cb5e2f502700d5a728.tar.bz2 |
tcg/optimize: Build and use o_bits in fold_extu
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | tcg/optimize.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index 103c94b..42d5ee2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2039,25 +2039,31 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) static bool fold_extu(OptContext *ctx, TCGOp *op) { - uint64_t z_mask; + uint64_t z_mask, o_mask; + TempOptInfo *t1; if (fold_const1(ctx, op)) { return true; } - z_mask = arg_info(op->args[1])->z_mask; + t1 = arg_info(op->args[1]); + z_mask = t1->z_mask; + o_mask = t1->o_mask; + switch (op->opc) { case INDEX_op_extrl_i64_i32: case INDEX_op_extu_i32_i64: z_mask = (uint32_t)z_mask; + o_mask = (uint32_t)o_mask; break; case INDEX_op_extrh_i64_i32: z_mask >>= 32; + o_mask >>= 32; break; default: g_assert_not_reached(); } - return fold_masks_z(ctx, op, z_mask); + return fold_masks_zo(ctx, op, z_mask, o_mask); } static bool fold_mb(OptContext *ctx, TCGOp *op) |