public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113882] New: V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI
@ 2024-02-12 2:13 pinskia at gcc dot gnu.org
2024-02-12 9:06 ` [Bug target/113882] " rguenth at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-12 2:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113882
Bug ID: 113882
Summary: V4SF->V4HI could be implemented using V4SF->V4SI and
then truncation to V4HI
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Target: aarch64
Take:
```
void f(short *a, float *b)
{
a[0] = b[0];
a[1] = b[1];
a[2] = b[2];
a[3] = b[3];
}
void f1(float *a, short *b)
{
a[0] = b[0];
a[1] = b[1];
a[2] = b[2];
a[3] = b[3];
}
```
GCC can SLP f1 (which does V4SF->V4HI) but not f1.
LLVM can though:
```
f:
ldr q0, [x1]
fcvtzs v0.4s, v0.4s
xtn v0.4h, v0.4s
str d0, [x0]
ret
```
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/113882] V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI
2024-02-12 2:13 [Bug target/113882] New: V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI pinskia at gcc dot gnu.org
@ 2024-02-12 9:06 ` rguenth at gcc dot gnu.org
2024-05-11 22:51 ` pinskia at gcc dot gnu.org
2024-06-26 16:55 ` pzheng at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-12 9:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113882
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |53947
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The vectoizer has some of these tricks but the intermediate conversion allowed
is somewhat hard-coded. I think the C standard says SF -> HI invokes undefined
behavior on overflow so the conversion should be valid.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/113882] V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI
2024-02-12 2:13 [Bug target/113882] New: V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI pinskia at gcc dot gnu.org
2024-02-12 9:06 ` [Bug target/113882] " rguenth at gcc dot gnu.org
@ 2024-05-11 22:51 ` pinskia at gcc dot gnu.org
2024-06-26 16:55 ` pzheng at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-11 22:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113882
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2024-05-11
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I have someone working on this,
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/113882] V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI
2024-02-12 2:13 [Bug target/113882] New: V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI pinskia at gcc dot gnu.org
2024-02-12 9:06 ` [Bug target/113882] " rguenth at gcc dot gnu.org
2024-05-11 22:51 ` pinskia at gcc dot gnu.org
@ 2024-06-26 16:55 ` pzheng at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pzheng at gcc dot gnu.org @ 2024-06-26 16:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113882
Pengxuan Zheng <pzheng at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|ASSIGNED |RESOLVED
CC| |pzheng at gcc dot gnu.org
--- Comment #3 from Pengxuan Zheng <pzheng at gcc dot gnu.org> ---
In fact, GCC is able to vectorize through intermediate conversions if we pass
-fno-trapping-math. There's a bug (PR54192) open discussing if the flag should
be set by default.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-26 16:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12 2:13 [Bug target/113882] New: V4SF->V4HI could be implemented using V4SF->V4SI and then truncation to V4HI pinskia at gcc dot gnu.org
2024-02-12 9:06 ` [Bug target/113882] " rguenth at gcc dot gnu.org
2024-05-11 22:51 ` pinskia at gcc dot gnu.org
2024-06-26 16:55 ` pzheng at gcc dot gnu.org
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).