public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/98477] aarch64: Unnecessary GPR -> FPR moves for conditional select
Date: Wed, 24 Apr 2024 06:22:48 +0000 [thread overview]
Message-ID: <bug-98477-4-EXXZZqcIFJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98477-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98477
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> here is a testcase for the fcsel usage for integer cmov:
A slightly better example where there is no use of inline-asm or forcing to
specific registers:
```
#define vector16 __attribute__((vector_size(16)))
void
foo (int a, int *b, vector16 int c, vector16 int d)
{
int t = a ? c[0] : d[0];
*b = t;
}
```
We should be able to produce:
```
foo:
cmp w0, 0
fcsel s1, s1, s0, eq
str s1, [x1]
ret
```
And here is a decent one for float modes (-O2 -fno-ssa-phiopt is needed though,
otherwise the tree level does the VCE after the cmov):
```
#define vector8 __attribute__((vector_size(8)))
void
foo (int a, double *b, long long c, long long d)
{
double ct;
double dt;
__builtin_memcpy(&ct, &c, sizeof(long long));
__builtin_memcpy(&dt, &d, sizeof(long long));
double t = a ? ct : dt;
*b = t;
}
```
next prev parent reply other threads:[~2024-04-24 6:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 9:35 [Bug target/98477] New: " ktkachov at gcc dot gnu.org
2020-12-30 9:40 ` [Bug target/98477] " ktkachov at gcc dot gnu.org
2020-12-30 9:47 ` pinskia at gcc dot gnu.org
2020-12-30 9:50 ` pinskia at gcc dot gnu.org
2020-12-30 9:50 ` pinskia at gcc dot gnu.org
2023-11-18 6:59 ` pinskia at gcc dot gnu.org
2024-04-24 0:02 ` pinskia at gcc dot gnu.org
2024-04-24 6:05 ` pinskia at gcc dot gnu.org
2024-04-24 6:09 ` pinskia at gcc dot gnu.org
2024-04-24 6:22 ` pinskia at gcc dot gnu.org [this message]
2024-04-24 6:28 ` pinskia at gcc dot gnu.org
2024-05-06 18:29 ` pinskia at gcc dot gnu.org
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=bug-98477-4-EXXZZqcIFJ@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).