From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC0973858D28; Mon, 12 Jun 2023 05:48:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC0973858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686548922; bh=pm9GhuOw7D1kM1Da3a00DfuFTV1eFDd2polHWSWv2Y8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L9gDPk6DwHA1jcDywo1XPh8fqkTHzQZCyPbdkVPjA1FGdD2laWQyKtO9RkeEQL7lf F2ijmV6L/MQ1h+3HgbCq6AAutcbr++AWjyRB84Y6CSqZNoyOhTDcM0HbvNaz2rotLU s8NKQsxmeR/rmcmINeApz/fZy1PReWkRuNpJMWwU= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108410] x264 averaging loop not optimized well for avx512 Date: Mon, 12 Jun 2023 05:48:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108410 --- Comment #6 from Hongtao.liu --- > and the key thing to optimize is >=20 > ivtmp_78 =3D ivtmp_77 + 4294967232; // -64 > _79 =3D MIN_EXPR ; > _80 =3D (unsigned char) _79; > _81 =3D {_80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _8= 0, > _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, > _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, > _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, _80, > _80, _80, _80, _80, _80, _80}; >=20 > that is we want to broadcast a saturated (to vector element precision) va= lue. Yes, backend needs to support vec_pack_ssat_m, vec_pack_usat_m. But I didn't find optab for ss_truncate or us_truncate which might be used = by BB vectorizer.=