From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A0D03857C6F; Wed, 31 Mar 2021 20:24:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A0D03857C6F From: "dushistov at mail dot ru" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dushistov at mail dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2021 20:24:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99856 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 #include #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 =3D 0; for (; i < len*4; i +=3D 4) { uint8_t Sa =3D Srgba[i + 3]; Rrgba[i + 0] =3D DIV255(Srgba[i + 0] * 255 + Drgba[i + 0] * (255 - = Sa)); Rrgba[i + 1] =3D DIV255(Srgba[i + 1] * 255 + Drgba[i + 1] * (255 - = Sa)); Rrgba[i + 2] =3D DIV255(Srgba[i + 2] * 255 + Drgba[i + 2] * (255 - = Sa)); Rrgba[i + 3] =3D 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=