From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6298B388B00C; Mon, 11 May 2020 07:12:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6298B388B00C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589181141; bh=d3hk4GoTGctCvYPzZsC3ozjlMNhWFGQddES4Nrs1n4c=; h=From:To:Subject:Date:From; b=JS0iUUbyzumneTexNM82axZqjriWdsRmxjK3aD7TWY4ZiPOR1hEtTvLwAZcONCeGu 3lmIVYPAAuhGAEPaP8bsHNndN8tYGLEz3tAwUIdEvT7tVaePpZld4FW5Gw5ZtuVlag QqnnWCzi2VRyAA/QwnfN/K8B1EKg6O89xzCuG5h8= From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95046] New: Vectorize V2SFmode operations Date: Mon, 11 May 2020 07:12:21 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak 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, 11 May 2020 07:12:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95046 Bug ID: 95046 Summary: Vectorize V2SFmode operations Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: ubizjak at gmail dot com Target Milestone: --- The compiler should vectorize V2SF operations using XMM registers. The same principles as applied to integer MMX operations (mmx-with-sse) sho= uld also apply to V2SF mode operations, but to avoid unwanted secondary effects (e.g. exceptions) extra care should be taken to load values to registers wi= th parts outside V2SFmode cleared. Following testcase: --cut here-- float r[2], a[2], b[2]; void foo (void) { for (int i =3D 0; i < 2; i++) r[i] =3D a[i] + b[i]; } --cut here-- should vectorize to: movq a(%rip), %xmm0 movq b(%rip), %xmm1 addps %xmm1, %xmm0 movlps %xmm0, r(%rip) Please note movq insn that assures clearing of top 64bits of 128bit xmm register.=