From 2f4d1720783d7fc5d06317d148e6bb0d7386a220 Mon Sep 17 00:00:00 2001 From: Romain Malmain Date: Fri, 25 Oct 2024 14:18:36 +0200 Subject: [PATCH] fix a bug in tcg_gen_not_vec operation. --- tcg/tcg-op-vec.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 0e3828d656..86176a59b1 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -590,11 +590,17 @@ void tcg_gen_eqv_vec(unsigned vece, TCGv_vec r, TCGv_vec a, TCGv_vec b) void tcg_gen_not_vec(unsigned vece, TCGv_vec r, TCGv_vec a) { - if (TCG_TARGET_HAS_not_vec) { - vec_gen_op2(INDEX_op_not_vec, 0, r, a); - } else { + /* TODO (SymQEMU): + * This instruction is not instrumented yet. + * For now, we make sure that alternative instructions below, which are instrumented, are always used. + * Directly instrumenting this instruction would improve performance of SymQEMU. + */ + + // if (TCG_TARGET_HAS_not_vec) { + // vec_gen_op2(INDEX_op_not_vec, 0, r, a); + // } else { tcg_gen_xor_vec(0, r, a, tcg_constant_vec_matching(r, 0, -1)); - } + // } } void tcg_gen_neg_vec(unsigned vece, TCGv_vec r, TCGv_vec a) @@ -611,7 +617,6 @@ void tcg_gen_neg_vec(unsigned vece, TCGv_vec r, TCGv_vec a) * Directly instrumenting this instruction would improve performance of SymQEMU. */ - /*if (!TCG_TARGET_HAS_neg_vec || !do_op2(vece, r, a, INDEX_op_neg_vec)) {*/ tcg_gen_sub_vec(vece, r, tcg_constant_vec_matching(r, vece, 0), a); /*}*/