public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/92651] [10 Regression] Unnecessary stv transform in some x86 backend
[not found] <bug-92651-4@http.gcc.gnu.org/bugzilla/>
@ 2020-11-20 10:45 ` ubizjak at gmail dot com
0 siblings, 0 replies; only message in thread
From: ubizjak at gmail dot com @ 2020-11-20 10:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92651
--- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to rguenther@suse.de from comment #8)
> Sure. Another option would be to enhance STV even further
> (or add some peephole patterns - combine runs before STV2) to
> transform the
>
> psubd xmm3, xmm0
> psubd xmm0, xmm1
> pmaxsd xmm0, xmm3
>
> into
>
> psubd %xmm3, %xmm0
> pabsd %xmm0, %xmm0
>
> for enhancing STV that means adding abs() patterns (or adding
> combine-like matching to the pass which I'd suggest not do).
>
> Clearly that the above conversion isn't done is a generic
> missed optimization. Maybe you can benchmark that as well
> though I guess it won't come near the xor variant?
After PR97873 introduced abs to STV:
int test (int x, int y)
{
return abs (x - y);
}
cc1 -O2 -msse4.1 -mstv -m32:
movd 4(%esp), %xmm0
movd 8(%esp), %xmm1
psubd %xmm1, %xmm0
pabsd %xmm0, %xmm0
movd %xmm0, %eax
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-20 10:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-92651-4@http.gcc.gnu.org/bugzilla/>
2020-11-20 10:45 ` [Bug target/92651] [10 Regression] Unnecessary stv transform in some x86 backend ubizjak at gmail dot com
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).