From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 4D7173882100; Fri, 14 Jun 2024 12:10:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D7173882100 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D7173882100 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718367044; cv=none; b=sbInlLQGgW/4Z0c8b23cOxLdC37qF62vDJY2zQRRcQcR7jUXhtzIcTZ405RQKwpdJEmTULzQgVnxee8HfvSysWu1PaqvnwcsjYWNPU8Z308wjaHNDuFH3RRyr1rZk6roVfSdpofZ9OQyqzpvr8vJHceJa5FpdXQf0/MMnbSf+l8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718367044; c=relaxed/simple; bh=TqUZa0Undth7vHTu7LI2uBi9Pr8QLQa4PMyfVc8Ivac=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=xMKg7CnmcJg2zilIyngn7+TLChrHYFswy/AFDJ0My07qpVSESc33UvPOLuCO+NbLZVv0bZxssR6emUoQDe+WxxVt0ncqm0Jb4TfcUZZC5ZCV0GdYoDNpf6GHWoIEuVllRPt/RyB4k6RanIo+2FrMf80uap5xw2eogl+CdgOdqqk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from murzim.nue2.suse.org (unknown [10.168.4.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5702220466; Fri, 14 Jun 2024 12:10:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718367042; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bBISScwJAFXogRhBRyff7S843p7FWyE6JzKJQOlHbxE=; b=wqzEAmnxuHXDAZ2+LvZ2VqNOW2E70eFRV88zZB5bz2sCKAyH+3jgGqwDLpbAekYSNElU4o oeMAXuLBz3cdv8SPpRTP9LV75rGSRy59lWgd3KstW6sQOWimgqEd31ENirYChgRzc2hX/G eSMRLqlY/ZEAFrG1hXe90fIc3TPc8nU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718367042; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bBISScwJAFXogRhBRyff7S843p7FWyE6JzKJQOlHbxE=; b=0ewMYbd05fB9Bxhrck12XTEIV7qTAf8MKOk4nvtMX81EFBbaY389WY0CCvuw10GGD2sr94 6kHbLRjyeRh7nbCQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718367042; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bBISScwJAFXogRhBRyff7S843p7FWyE6JzKJQOlHbxE=; b=wqzEAmnxuHXDAZ2+LvZ2VqNOW2E70eFRV88zZB5bz2sCKAyH+3jgGqwDLpbAekYSNElU4o oeMAXuLBz3cdv8SPpRTP9LV75rGSRy59lWgd3KstW6sQOWimgqEd31ENirYChgRzc2hX/G eSMRLqlY/ZEAFrG1hXe90fIc3TPc8nU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718367042; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bBISScwJAFXogRhBRyff7S843p7FWyE6JzKJQOlHbxE=; b=0ewMYbd05fB9Bxhrck12XTEIV7qTAf8MKOk4nvtMX81EFBbaY389WY0CCvuw10GGD2sr94 6kHbLRjyeRh7nbCQ== Date: Fri, 14 Jun 2024 14:10:42 +0200 (CEST) From: Richard Biener To: Richard Sandiford cc: gcc-patches@gcc.gnu.org, hongtao.liu@intel.com, ebotcazou@libertysurf.fr, krebbel@linux.ibm.com, linkw@gcc.gnu.org, syq@gcc.gnu.org, xuchenghua@loongson.cn, ams@baylibre.com, richard.earnshaw@arm.com Subject: Re: [PATCH] middle-end/114189 - drop uses of vcond{,u,eq}_optab In-Reply-To: <271q309s-rqn4-81n9-8r3p-799q36on9356@fhfr.qr> Message-ID: <11snn047-o533-9q87-os1r-5rsn28s09641@fhfr.qr> References: <20240614103115.1DB0213AB1@imap1.dmz-prg2.suse.org> <271q309s-rqn4-81n9-8r3p-799q36on9356@fhfr.qr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.987]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; RCVD_COUNT_ZERO(0.00)[0]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email] X-Spam-Score: -4.30 X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 14 Jun 2024, Richard Biener wrote: > On Fri, 14 Jun 2024, Richard Sandiford wrote: > > > Richard Biener writes: > > > On Fri, 14 Jun 2024, Richard Sandiford wrote: > > > > > >> Richard Biener writes: > > >> > The following retires vcond{,u,eq} optabs by stopping to use them > > >> > from the middle-end. Targets instead (should) implement vcond_mask > > >> > and vec_cmp{,u,eq} optabs. The PR this change refers to lists > > >> > possibly affected targets - those implementing these patterns, > > >> > and in particular it lists mips, sparc and ia64 as targets that > > >> > most definitely will regress while others might simply remove > > >> > their vcond{,u,eq} patterns. > > >> > > > >> > I'd appreciate testing, I do not expect fallout for x86 or arm/aarch64. > > >> > I know riscv doesn't implement any of the legacy optabs. But less > > >> > maintained vector targets might need adjustments. > > >> > > > >> > I want to get rid of those optabs for GCC 15. If I don't hear from > > >> > you I will assume your target is fine. > > >> > > >> Great! Thanks for doing this. > > >> > > >> Is there a plan for how we should handle vector comparisons that > > >> have to be done as the inverse of the negated condition? Should > > >> targets simply not provide vec_cmp for such conditions and leave > > >> the target-independent code to deal with the fallout? (For a > > >> standalone comparison, it would invert the result. For a VEC_COND_EXPR > > >> it would swap the true and false values.) > > > > > > I would expect that the ISEL pass which currently deals with finding > > > valid combos of .VCMP{,U,EQ} and .VCOND_MASK deals with this. > > > So how do we deal with this right now? I expect RTL expansion will > > > do the inverse trick, no? > > > > I think in practice (at least for the targets I've worked on), > > the target's vec_cmp handles the inversion itself. Thus the > > main optimisation done by targets' vcond patterns is to avoid > > the inversion (and instead swap the true/false values) when the > > "opposite" comparison is the native one. > > I see. I suppose whether or not vec_cmp is handled is determined > by a FAIL so it's somewhat difficult to determine this at ISEL time. I'll also note that we document vec_cmp{,u,eq} as having all zeros, all ones for the result while vcond_mask might only care for the MSB (it's documented to work on the result of a pre-computed vector comparison). So this eventually asks for targets to work out the optimal sequence via combine helpers and thus eventually splitters to fixup invalid compare operators late? Richard.