From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 19B123858D32 for ; Mon, 26 Sep 2022 12:34:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 19B123858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id F04291F8A6; Mon, 26 Sep 2022 12:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664195651; 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=pg56ySrw0u0S+cXhRoJRBBDjT97pNdaCIxTmJHJHs3Y=; b=IWtmj+oVRDcKaS767Xw5fi2uSV1P9pS05Zr5ZgsNxmNrRAdJkzmH5ORJ0LvydY20nKRLfd 6L/M3GPyIth/X6TLywNiwQ+zOdirIsS0GcA5bKHLPhk54SFmRdPivX1RsmWUw7XA7mAhkh +lL/Y7OeiJX+BuZYU9dUOHBNkbrxUnM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664195651; 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=pg56ySrw0u0S+cXhRoJRBBDjT97pNdaCIxTmJHJHs3Y=; b=kJr1DuGzbUmkqLstJroQeqadOGNyw59yUOM2tfpE4D3Mhyzm4TbAc3V/fbOR8RClR7gA41 ZfgdXkAsbP5LUjCw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D067A2C17E; Mon, 26 Sep 2022 12:34:11 +0000 (UTC) Date: Mon, 26 Sep 2022 12:34:11 +0000 (UTC) From: Richard Biener To: Tamar Christina cc: "gcc-patches@gcc.gnu.org" , nd , "jeffreyalaw@gmail.com" , Richard Sandiford Subject: Re: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 Mon, 26 Sep 2022, Tamar Christina wrote: > > Maybe the target could use (subreg:SI (reg:BI ...)) as argument. Heh. > > But then I'd still need to change the expansion code. I suppose this could prevent the issue with changes to code on other targets. > > > > > We have undocumented addcc, negcc, etc. patterns, should we have aandcc pattern for this indicating support for andcc + jump as opposedto cmpcc + jump? > > > > > > This could work yeah. I didn't know these existed. > > > Ah, so they are conditional add, not add setting CC, so andcc wouldn't > > be appropriate. > > > So I'm not sure how we'd handle such situation - maybe looking at > > REG_DECL and recognizing a _Bool PARM_DECL is OK? > > I have a slight suspicion that Richard Sandiford would likely reject this though.. The additional AND seemed less hacky as it's just communicating range. > > I still need to also figure out which representation of bool is being used, because only the 0-1 variant works. Is there a way to check that? So another option would be, in case you have (subreg:SI (reg:QI)), if we expand if (b != 0) expand that to !((b & 255) == 0) basically invert the comparison and the leverage the paradoxical subreg to specify a narrower immediate to AND with? Just hoping that arm can do 255 as immediate and still efficiently handle this? Wouldn't this transform be possible in combine with the appropriate backend pattern and combine synthesizing the and for paradoxical subregs? Richard.