From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E31773858D32; Sat, 12 Aug 2023 20:54:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E31773858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691873649; bh=jXkFIzXB0bbRbc9Y2y54Y2dpV0u5hNJhjElhmipL07o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oEg6EEhDkw2uh4Qrh7mtDO97Fe8BxZxOb1nDlprgeX3SIc3wZTB4XmEoQVNezdMw+ aN6h+IzRd17zrffL1R0JJP42hMPT9BjSD1fi7B+PAEbnSdjIP2j6u0eTM3GDe+dtSZ cWxYyoZHooyWaW4WmCttvlbQbicn9kh0Vd8o5rYI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111006] [SVE] Extra neg for storing to short from int comparison Date: Sat, 12 Aug 2023 20:54:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D111006 --- Comment #2 from Andrew Pinski --- Note the non-SVE code generation can be improved too. With: (simplify (negate (vec_pack_trunc:s (vec_cond:s @0 uniform_integer_cst_p@1 uniform_integer_cst_p@2) (vec_cond:s @3 @1 @2))) (with { tree outer_mask_type =3D truth_type_for (type); tree allones =3D build_minus_one_cst (type); tree zeros =3D build_zero_cst (type); } (if (integer_onep (@1) && integer_zerop (@2)) (vec_cond (vec_pack_trunc:outer_mask_type @0 @3) { allones; } { zeros; }= ) (if (integer_onep (@2) && integer_zerop (@1)) (vec_cond (vec_pack_trunc:outer_mask_type @0 @3) { zeros; } { allones; } ))))) I will submit both later next week.=