From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51445 invoked by alias); 21 Apr 2015 13:56:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 51419 invoked by uid 48); 21 Apr 2015 13:56:01 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65832] New: Inefficient vector construction Date: Tue, 21 Apr 2015 13:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01731.txt.bz2 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