public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/95046] New: Vectorize V2SFmode operations
@ 2020-05-11  7:12 ubizjak at gmail dot com
  2020-05-11  7:13 ` [Bug target/95046] " ubizjak at gmail dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: ubizjak at gmail dot com @ 2020-05-11  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

            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) should
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 with
parts outside V2SFmode cleared.

Following testcase:

--cut here--
float r[2], a[2], b[2];

void foo (void)
{
  for (int i = 0; i < 2; i++)
    r[i] = 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.

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

end of thread, other threads:[~2021-12-27  9:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  7:12 [Bug target/95046] New: Vectorize V2SFmode operations ubizjak at gmail dot com
2020-05-11  7:13 ` [Bug target/95046] " ubizjak at gmail dot com
2020-05-11  7:13 ` ubizjak at gmail dot com
2020-05-11  9:17 ` cvs-commit at gcc dot gnu.org
2020-05-11 14:39 ` cvs-commit at gcc dot gnu.org
2020-05-11 18:13 ` cvs-commit at gcc dot gnu.org
2020-05-12 15:06 ` cvs-commit at gcc dot gnu.org
2020-05-12 15:08 ` cvs-commit at gcc dot gnu.org
2020-05-12 16:38 ` cvs-commit at gcc dot gnu.org
2020-05-12 17:25 ` cvs-commit at gcc dot gnu.org
2020-05-14  7:16 ` cvs-commit at gcc dot gnu.org
2020-05-14 11:48 ` cvs-commit at gcc dot gnu.org
2020-05-14 17:52 ` cvs-commit at gcc dot gnu.org
2020-05-15  7:25 ` cvs-commit at gcc dot gnu.org
2020-05-15  8:03 ` cvs-commit at gcc dot gnu.org
2020-12-10  9:45 ` ubizjak at gmail dot com
2021-06-29 17:18 ` cvs-commit at gcc dot gnu.org
2021-12-24 16:10 ` cvs-commit at gcc dot gnu.org
2021-12-27  9:12 ` cvs-commit at gcc dot gnu.org

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).