public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dushistov at mail dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/99856] New: Alpha Compositing auto vectorization regression: 8.3 -> 9.1
Date: Wed, 31 Mar 2021 20:24:39 +0000	[thread overview]
Message-ID: <bug-99856-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 99856
           Summary: Alpha Compositing auto vectorization regression: 8.3
                    -> 9.1
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dushistov at mail dot ru
  Target Milestone: ---

Such code vectorized with gcc 8.3, but failed to vectorized with 9.1.
Last version of clang works just fine.

```
#include <stdint.h>
#include <stddef.h>

#define SHIFTFORDIV255(a)\
    ((((a) >> 8) + a) >> 8)

#define DIV255(a)\
    SHIFTFORDIV255(a + 0x80)

void
opSourceOver_premul(uint8_t* restrict Rrgba,
                    const uint8_t* restrict Srgba,
                    const uint8_t* restrict Drgba, size_t len)
{
    size_t i = 0;
    for (; i < len*4; i += 4) {
        uint8_t Sa = Srgba[i + 3];
        Rrgba[i + 0] = DIV255(Srgba[i + 0] * 255 + Drgba[i + 0] * (255 - Sa));
        Rrgba[i + 1] = DIV255(Srgba[i + 1] * 255 + Drgba[i + 1] * (255 - Sa));
        Rrgba[i + 2] = DIV255(Srgba[i + 2] * 255 + Drgba[i + 2] * (255 - Sa));
        Rrgba[i + 3] = DIV255(Srgba[i + 3] * 255 + Drgba[i + 3] * (255 - Sa));
    }
}
```

see https://godbolt.org/z/PW65xzb4h
with assembler output for 8.3 and 9.1

             reply	other threads:[~2021-03-31 20:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 20:24 dushistov at mail dot ru [this message]
2021-04-01  4:42 ` [Bug tree-optimization/99856] [9/10/11 Regression] Alpha Compositing auto vectorization regression marxin at gcc dot gnu.org
2021-04-01  7:21 ` rguenth at gcc dot gnu.org
2021-04-01  8:23 ` cvs-commit at gcc dot gnu.org
2021-04-01  9:14 ` [Bug tree-optimization/99856] [9/10 " cvs-commit at gcc dot gnu.org
2021-04-01  9:42 ` [Bug tree-optimization/99856] [9 " cvs-commit at gcc dot gnu.org
2021-04-01  9:43 ` 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-99856-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).