qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/6] tcg: Always implement neg and movcond


From: Richard Henderson
Subject: Re: [PATCH 0/6] tcg: Always implement neg and movcond
Date: Wed, 25 Oct 2023 21:20:47 -0700
User-agent: Mozilla Thunderbird

On 10/25/23 21:13, Richard Henderson wrote:
Having opcodes always present means that we can remove some tests.
NOT and MOVCOND were *almost* always present anyway.

A close candidate is NOT.  The hiccup is s390x: except for the most
recent hardware revision, there is no single insn which can implement
the operation.

I experimented with replacements:

     i32: xilf r,-1             (6 bytes, requires R=X)
          lcr r,x; ahi r,-1     (6 bytes)
     i64: lcgr r,x; aghi r,-1   (8 bytes)

But both don't compare well with the current

          lghi tmp,-1           (4 bytes, shared)
          xgrk r,x,tmp          (4 bytes)

With the constant -1 managed by register allocation, it gets loaded
once and then reused between operations.

An alternative might be to assume the presence of all opcodes during
initial expansion and lower them later, after optimization.  I'm close
to doing just that for the more complex opcodes like deposit anyway,
because the expansion is too complex for the optimizer to do anything
sensible after constant propagation.

Oh, for the record,

Based-on: 20231025072707.833943-1-richard.henderson@linaro.org
("tcg: Introduce TCG_COND_TST{EQ,NE}")


r~



reply via email to

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