public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/43147] New: SSE shuffle merge
@ 2010-02-23 1:27 liranuna at gmail dot com
2010-02-23 1:37 ` [Bug rtl-optimization/43147] " liranuna at gmail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: liranuna at gmail dot com @ 2010-02-23 1:27 UTC (permalink / raw)
To: gcc-bugs
I've noticed that GCC (my current version is 4.4.1) doesn't fully optimize SSE
shuffle merges, as seen in this example:
#include <xmmintrin.h>
extern void printv(__m128 m);
int main()
{
m = _mm_shuffle_ps(m, m, 0xC9); // Those two shuffles together swap
pairs
m = _mm_shuffle_ps(m, m, 0x2D); // And could be optimized to 0x4E
printv(m);
return 0;
}
This code generates the following assembly:
movaps .LC1, %xmm1
shufps $201, %xmm1, %xmm1
shufps $45, %xmm1, %xmm1 ; <-- Both should merge to 78
movaps %xmm1, %xmm0
movaps %xmm1, -24(%ebp)
.LC0:
.long 1065353216 ; 1.0f
.long 1073741824 ; 2.0f
.long 1077936128 ; 3.0f
.long 1082130432 ; 4.0f
Would be nice to see it as an enhancement!
--
Summary: SSE shuffle merge
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: liranuna at gmail dot com
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43147
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/43147] SSE shuffle merge
2010-02-23 1:27 [Bug rtl-optimization/43147] New: SSE shuffle merge liranuna at gmail dot com
@ 2010-02-23 1:37 ` liranuna at gmail dot com
2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: liranuna at gmail dot com @ 2010-02-23 1:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from liranuna at gmail dot com 2010-02-23 01:37 -------
It appears I am missing a line in the code I posted:
#include <xmmintrin.h>
extern void printv(__m128 m);
int main()
{
__m128 m = _mm_set_ps(1.0f, 2.0f, 3.0f, 4.0f);
m = _mm_shuffle_ps(m, m, 0xC9); // Those two shuffles together swap
pairs
m = _mm_shuffle_ps(m, m, 0x2D); // And could be optimized to 0x4E
printv(m);
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43147
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/43147] SSE shuffle merge
2010-02-23 1:27 [Bug rtl-optimization/43147] New: SSE shuffle merge liranuna at gmail dot com
2010-02-23 1:37 ` [Bug rtl-optimization/43147] " liranuna at gmail dot com
@ 2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-23 1:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2010-02-23 01:42 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-02-23 01:42:16
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43147
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/43147] SSE shuffle merge
2010-02-23 1:27 [Bug rtl-optimization/43147] New: SSE shuffle merge liranuna at gmail dot com
2010-02-23 1:37 ` [Bug rtl-optimization/43147] " liranuna at gmail dot com
2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
@ 2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-23 1:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2010-02-23 01:42 -------
I think that is because nothing simplifies:
(vec_select:V4SF (vec_concat:V8SF (vec_select:V4SF (vec_concat:V8SF
(reg:V4SF 62)
(reg:V4SF 62))
(parallel [
(const_int 1 [0x1])
(const_int 2 [0x2])
(const_int 4 [0x4])
(const_int 7 [0x7])
]))
(vec_select:V4SF (vec_concat:V8SF (reg:V4SF 62)
(reg:V4SF 62))
(parallel [
(const_int 1 [0x1])
(const_int 2 [0x2])
(const_int 4 [0x4])
(const_int 7 [0x7])
])))
(parallel [
(const_int 1 [0x1])
(const_int 3 [0x3])
(const_int 6 [0x6])
(const_int 4 [0x4])
]))
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43147
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-23 1:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23 1:27 [Bug rtl-optimization/43147] New: SSE shuffle merge liranuna at gmail dot com
2010-02-23 1:37 ` [Bug rtl-optimization/43147] " liranuna at gmail dot com
2010-02-23 1:42 ` pinskia at gcc dot gnu dot org
2010-02-23 1:42 ` pinskia at gcc dot gnu dot 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).