qemu/tcg
WANG Rui 1207071390 tcg/optimize: Fix folding of vector bitsel
It looks like a typo. When the false value (C) is the constant -1, the
correct fold should be: R = B | ~A

Reproducer (LoongArch64 assembly):

     .text
     .globl  _start
 _start:
     vldi    $vr1, 3073
     vldi    $vr2, 1023
     vbitsel.v       $vr0, $vr2, $vr1, $vr2
     vpickve2gr.d    $a1, $vr0, 1
     xori    $a0, $a1, 1
     li.w    $a7, 93
     syscall 0

Fixes: e58b977238 ("tcg/optimize: Optimize bitsel_vec")
Link: https://github.com/llvm/llvm-project/issues/159610
Signed-off-by: WANG Rui <wangrui@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250919124901.2756538-1-wangrui@loongson.cn>
(cherry picked from commit a50347a414)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2025-09-26 09:59:25 +03:00
..
aarch64 tcg/aarch64: Use 'z' constraint 2025-02-18 08:29:03 -08:00
arm include/exec: Use uintptr_t in CPUTLBEntry 2025-02-18 08:29:02 -08:00
i386 tcg/i386: Use tcg_{high,unsigned}_cond in tcg_out_brcond2 2025-02-18 08:29:03 -08:00
loongarch64 tcg: Remove TCG_TARGET_HAS_{br,set}cond2 from riscv and loongarch64 2025-02-18 08:29:03 -08:00
mips tcg/mips: Use 'z' constraint 2025-02-18 08:29:03 -08:00
ppc include/exec: Use uintptr_t in CPUTLBEntry 2025-02-18 08:29:02 -08:00
riscv tcg: Remove TCG_TARGET_HAS_{br,set}cond2 from riscv and loongarch64 2025-02-18 08:29:03 -08:00
s390x tcg: Replace addr{lo,hi}_reg with addr_reg in TCGLabelQemuLdst 2025-02-18 07:33:42 -08:00
sparc64 tcg/sparc64: Use 'z' constraint 2025-02-18 08:29:03 -08:00
tci tcg: Merge INDEX_op_qemu_*_{a32,a64}_* 2025-02-18 07:33:42 -08:00
debuginfo.c accel/tcg: Move perf and debuginfo support to tcg/ 2024-01-29 21:04:10 +10:00
meson.build meson: Drop the .fa library suffix 2024-07-03 18:41:26 +02:00
optimize.c tcg/optimize: Fix folding of vector bitsel 2025-09-26 09:59:25 +03:00
perf.c accel/tcg: Move perf and debuginfo support to tcg/ 2024-01-29 21:04:10 +10:00
region.c tcg: Make the cleanup-on-error path unique 2024-01-23 13:22:46 +10:00
tcg-common.c tcg: Constify tcg_op_defs 2025-01-16 20:57:16 -08:00
tcg-has.h tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
tcg-internal.h tcg: Move tcg_op_insert_{after,before} decls to tcg-internal.h 2025-01-16 20:57:16 -08:00
tcg-op-gvec.c tcg: Only include 'tcg-has.h' when necessary 2025-01-16 20:57:16 -08:00
tcg-op-ldst.c tcg: Merge INDEX_op_qemu_*_{a32,a64}_* 2025-02-18 07:33:42 -08:00
tcg-op-vec.c tcg: Only include 'tcg-has.h' when necessary 2025-01-16 20:57:16 -08:00
tcg-op.c tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
tcg.c tcg: Fix constant propagation in tcg_reg_alloc_dup 2025-07-01 22:02:27 +03:00
tci.c tcg: Merge INDEX_op_qemu_*_{a32,a64}_* 2025-02-18 07:33:42 -08:00