From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH 0/6] tcg: Always implement neg and movcond
Date: Wed, 25 Oct 2023 21:20:47 -0700 [thread overview]
Message-ID: <aa715385-3508-473f-bc40-3cd6e2e0e87b@linaro.org> (raw)
In-Reply-To: <20231026041404.1229328-1-richard.henderson@linaro.org>
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~
prev parent reply other threads:[~2023-10-26 4:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 4:13 [PATCH 0/6] tcg: Always implement neg and movcond Richard Henderson
2023-10-26 4:13 ` [PATCH 1/6] tcg/mips: Split out tcg_out_setcond_int Richard Henderson
2023-10-26 4:14 ` [PATCH 2/6] tcg/mips: Always implement movcond Richard Henderson
2023-10-26 4:14 ` [PATCH 3/6] tcg: Remove TCG_TARGET_HAS_movcond_{i32,i64} Richard Henderson
2023-10-26 4:14 ` [PATCH 4/6] tcg/mips: Implement neg opcodes Richard Henderson
2023-10-26 4:14 ` [PATCH 5/6] tcg/loongarch64: " Richard Henderson
2023-10-26 4:14 ` [PATCH 6/6] tcg: Remove TCG_TARGET_HAS_neg_{i32,i64} Richard Henderson
2023-10-26 4:20 ` Richard Henderson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa715385-3508-473f-bc40-3cd6e2e0e87b@linaro.org \
--to=richard.henderson@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).