public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bergner at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103548] New: Identical MMA assemble quads are incorrectly combined
Date: Fri, 03 Dec 2021 18:52:22 +0000	[thread overview]
Message-ID: <bug-103548-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-12-03 18:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 18:52 bergner at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103548-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).