From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 92D9C3858D3C; Mon, 4 Oct 2021 02:57:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92D9C3858D3C From: "gabravier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102583] New: [x86] Failure to optimize 32-byte integer vector conversion to 16-byte float vector properly when converting upper part with -mavx2 Date: Mon, 04 Oct 2021 02:57:04 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gabravier at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 04 Oct 2021 02:57:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102583 Bug ID: 102583 Summary: [x86] Failure to optimize 32-byte integer vector conversion to 16-byte float vector properly when converting upper part with -mavx2 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- typedef int v8si __attribute__((vector_size(32))); typedef float v4sf __attribute__((vector_size(16))); v4sf high (v8si *srcp) { v8si src =3D *srcp; return (v4sf) { (float)src[4], (float)src[5], (float)src[6], (float)src[7= ] }; } With -O3 -mavx2, GCC outputs this: high(int __vector(8)*): vmovdqa ymm0, YMMWORD PTR [rdi] vperm2i128 ymm0, ymm0, ymm0, 17 vcvtdq2ps xmm0, xmm0 vzeroupper ret LLVM instead outputs this: high(int __vector(8)*): vcvtdq2ps xmm0, xmmword ptr [rdi + 16] ret And GCC outputs the equivalent code if -mavx2 is removed: high(int __vector(8)*): cvtdq2ps xmm0, XMMWORD PTR [rdi+16] ret=