qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] tcg/optimize: optimize TSTNE using smask and zmask


From: Richard Henderson
Subject: Re: [PATCH v3] tcg/optimize: optimize TSTNE using smask and zmask
Date: Wed, 29 Jan 2025 17:23:29 -0800
User-agent: Mozilla Thunderbird

On 1/29/25 05:11, Paolo Bonzini wrote:
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>
---
        v2->v3: adjust for recent change to s_mask format

  tcg/optimize.c | 13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]