On Sat, Oct 28, 2023 at 9:45 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
Expose a pair of comparison operators that map to the "test"
comparison that is available on many architectures.
Changes for v2:
* Add TCGCond to tcg_target_const_match.
This fixes a long-standing issue with ppc and s390x backends,
in that CMPI for signed comparisons has signed immediate and
CMPLI for unsigned comparisons has unsigned immediate.
But now allows different immediates for the TST comparisons.
* tcg/i386: Generate TEST x,x for power-of-two in {7,15,31,63}.
* tcg/i386: Generate BT n,x for other power-of-two.
* tcg/ppc: tcg_target_const_match improvements
* tcg/s390x: tcg_target_const_match improvements
* target/m68k: Use TST{EQ,NE} for gen_fcc_cond.
I updated the MIPS backend (untested though) and pushed the result to
branch i386 of https://gitlab.com/bonzini/qemu/.