qemu/tcg
Paolo Bonzini 3502062991 tcg/optimize: optimize TSTNE using smask and zmask
Generalize the existing optimization of "TSTNE x,sign" and "TSTNE x,-1".
This can be useful for example in the i386 frontend, which will generate
tests of zero-extended registers against 0xffffffff.

Ironically, on x86 hosts this is a very slight pessimization in the very
case it's meant to optimize because

 brcond_i64 cc_dst,$0xffffffff,tsteq,$L1

(test %ebx, %ebx) is 1 byte smaller than

 brcond_i64 cc_dst,$0x0,eq,$L1

(test %rbx, %rbx).  However, in general it is an improvement, especially
if it avoids placing a large immediate in the constant pool.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-02-07 15:51:01 +01:00
..
aarch64 tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
arm tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
i386 tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
loongarch64 tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
mips tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
ppc tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
riscv tcg/riscv: Use BEXTI for single-bit extractions 2025-01-16 20:57:17 -08:00
s390x tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
sparc64 tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
tci tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -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: optimize TSTNE using smask and zmask 2025-02-07 15:51:01 +01: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: Split out tcg-target-mo.h 2025-01-16 20:57:16 -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: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00
tci.c tcg: Remove TCG_TARGET_HAS_deposit_{i32,i64} 2025-01-16 20:57:17 -08:00