public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99856] New: Alpha Compositing auto vectorization regression: 8.3 -> 9.1
@ 2021-03-31 20:24 dushistov at mail dot ru
  2021-04-01  4:42 ` [Bug tree-optimization/99856] [9/10/11 Regression] Alpha Compositing auto vectorization regression marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dushistov at mail dot ru @ 2021-03-31 20:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

end of thread, other threads:[~2021-04-01  9:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 20:24 [Bug c/99856] New: Alpha Compositing auto vectorization regression: 8.3 -> 9.1 dushistov at mail dot ru
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

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