From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 274513858D37; Fri, 3 Mar 2023 20:46:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 274513858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677876375; bh=R+V1pDxU4pBySQqNioRr385a8B4McvPAaAGAJwNoD6w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MqEiaiJEyMDBVLwtxvqsVEgqUfX9bItfUuU8SCxT47sT4WzNXRne8TOd29tg0IMbi nB/6iqRo1hBGhxNhQR9uJ3jg9UQ+YfNdPRzAFwVPa0diDq97tJMs1C2BdmH+o58IE7 B0b4f5353XtVIOKRcqve7fCXW9WZfqJAf9as5R9A= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109011] missed optimization in presence of __builtin_ctz Date: Fri, 03 Mar 2023 20:46:14 +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: 12.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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: 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=3D109011 --- Comment #5 from Jakub Jelinek --- And to answer myself, as x86 has vplzcnt* just for 32-bit and 64-bit elts w= ith -mavx512cd (perhaps -mavx512vl also depending on vecsize), there is also 8-= bit and 16-bit element vector popcount (guarded by different options). And with popcount it would be 3 instructions instead of 4, though dunno abo= ut their latencies etc.=