]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tcg/optimize: Don't fold INDEX_op_and_vec to extract
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 18 Jul 2025 17:34:06 +0000 (17:34 +0000)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 21 Jul 2025 15:09:04 +0000 (08:09 -0700)
There is no such thing as vector extract.

Fixes: 932522a9ddc1 ("tcg/optimize: Fold and to extract during optimize")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3036
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Tested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
tcg/optimize.c

index 62a128bc9b794b2a676bb40940d51d02da750a5e..3638ab9fea05167e83aa4b77f7d38d61d20577b3 100644 (file)
@@ -1454,7 +1454,7 @@ static bool fold_and(OptContext *ctx, TCGOp *op)
     a_mask = t1->z_mask & ~t2->o_mask;
 
     if (!fold_masks_zosa_int(ctx, op, z_mask, o_mask, s_mask, a_mask)) {
-        if (ti_is_const(t2)) {
+        if (op->opc == INDEX_op_and && ti_is_const(t2)) {
             /*
              * Canonicalize on extract, if valid.  This aids x86 with its
              * 2 operand MOVZBL and 2 operand AND, selecting the TCGOpcode