From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 95E7F3858C60; Mon, 21 Feb 2022 08:45:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95E7F3858C60 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104600] VCE(vector){} should be converted (or expanded) into BIT_INSERT_EXPR Date: Mon, 21 Feb 2022 08:45:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Feb 2022 08:45:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104600 --- Comment #2 from Andrew Pinski --- Here is another example even with 32bit int and 64bit long: #define vector __attribute__((vector_size(8))) long f(int a, int b) { vector int t =3D {a, b}; return (long)t; } void f1(long *t1, int a, int b) { vector int t =3D {a, b}; *t1 =3D (long)t; } void f2(long *t1, int a, int b) { vector int t =3D {a, b}; *t1 =3D ((long)t) + 1; } long f_1(unsigned a, unsigned b) { long t =3D (((unsigned long)a) << 32) | (unsigned long)b; return (long)t; } void f1_1(long *t1, unsigned a, unsigned b) { long t =3D (((unsigned long)a) << 32) | (unsigned long)b; *t1 =3D (long)t; } void f2_1(long *t1, unsigned a, unsigned b) { long t =3D (((unsigned long)a) << 32) | (unsigned long)b; *t1 =3D ((long)t) + 1; } ----- CUT ---- For f2 and f2_1 we have: movd %esi, %xmm0 movd %edx, %xmm1 punpckldq %xmm1, %xmm0 movq %xmm0, %rsi addq $1, %rsi movq %rsi, (%rdi) vs salq $32, %rsi movl %edx, %edx orq %rdx, %rsi addq $1, %rsi movq %rsi, (%rdi) It all depends on how fast move between GPRs and SSE register sets is vs do= ing it all in the integer. I only think this should be done for the 2x size case and nothing more.=