public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/65832] New: Inefficient vector construction
@ 2015-04-21 13:56 rguenth at gcc dot gnu.org
  2015-04-21 14:03 ` [Bug target/65832] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-21 13:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65832

            Bug ID: 65832
           Summary: Inefficient vector construction
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
            Target: x86_64-*-*, i?86-*-*

typedef int v4si __attribute__((vector_size(16)));

v4si foo (int i, int j, int k, int l)
{
  return (v4si) { i, j, k, l };
}

produces

        movl    %edx, -12(%rsp)
        movd    -12(%rsp), %xmm1
        movl    %ecx, -12(%rsp)
        movd    -12(%rsp), %xmm2
        movl    %edi, -12(%rsp)
        movd    -12(%rsp), %xmm0
        movl    %esi, -12(%rsp)
        movd    -12(%rsp), %xmm3
        punpckldq       %xmm2, %xmm1
        punpckldq       %xmm3, %xmm0
        punpcklqdq      %xmm1, %xmm0
        ret

as we spill everything to the stack we could as well use a vector load, thus
something like

        movl    %edx, -12(%rsp)
        movl    %ecx, -16(%rsp)
        movl    %edi, -20(%rsp)
        movl    %esi, -24(%rsp)
        movdqu  -12(%rsp), %xmm0
        ret


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-06-24 20:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-21 13:56 [Bug target/65832] New: Inefficient vector construction rguenth at gcc dot gnu.org
2015-04-21 14:03 ` [Bug target/65832] " rguenth at gcc dot gnu.org
2015-04-21 14:11 ` rguenth at gcc dot gnu.org
2015-04-28  8:51 ` rguenth at gcc dot gnu.org
2015-04-28  8:55 ` rguenth at gcc dot gnu.org
2015-05-22 12:15 ` rguenth at gcc dot gnu.org
2015-06-01 10:30 ` rguenth at gcc dot gnu.org
2020-06-24 20:45 ` [Bug middle-end/65832] " gabravier 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).