public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103548] New: Identical MMA assemble quads are incorrectly combined
@ 2021-12-03 18:52 bergner at gcc dot gnu.org
  2021-12-03 19:45 ` [Bug target/103548] " bergner at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-12-03 18:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103548
           Summary: Identical MMA assemble quads are incorrectly combined
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

We incorrectly combine multiple identical build/assemble quads/accs leading to
incorrect assembly being generated:

typedef unsigned char  vec_t __attribute__((vector_size(16)));

void
foo (__vector_quad *dst, vec_t *src)
{
  __vector_quad quad0, quad1;
  /* Adjacent loads should be combined into two lxvp instructions.
     and identical build accs should not be combined.  */
  __builtin_mma_build_acc (&quad0, src[0], src[1], src[2], src[3]);
  __builtin_mma_build_acc (&quad1, src[0], src[1], src[2], src[3]);
  dst[0] = quad0;
  dst[2] = quad1;
}

...gives:

        lxv 3,0(4)
        lxv 2,16(4)
        lxv 1,32(4)
        lxv 0,48(4)
        xxmtacc 0
        xxmfacc 0
        stxvp 2,0(3)
        stxvp 0,32(3)
        xxmfacc 0
        stxvp 2,128(3)
        stxvp 0,160(3)
        blr

Notive we only have 4 loads and 1 xxmtacc but 2 xxmfacc.  This is incorrect.  I
have a patch I'm testing. 

Note that for build/assemble pair, we are allowed to combine identical
calls...amd we do.

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

end of thread, other threads:[~2023-05-08 12:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 18:52 [Bug target/103548] New: Identical MMA assemble quads are incorrectly combined bergner at gcc dot gnu.org
2021-12-03 19:45 ` [Bug target/103548] " bergner at gcc dot gnu.org
2021-12-14 21:00 ` cvs-commit at gcc dot gnu.org
2021-12-14 23:19 ` bergner at gcc dot gnu.org
2022-05-06  8:32 ` jakub at gcc dot gnu.org
2023-05-08 12:23 ` rguenth 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).