From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 395963858D32 for ; Mon, 26 Sep 2022 12:43:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 395963858D32 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-out1.suse.de (Postfix) with ESMTP id 0FFB921DB0; Mon, 26 Sep 2022 12:43:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664196197; 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=Um6XlvrpUiNo9QGIHnJCj6XhPy/Ev8QhMMt156XEKdQ=; b=m6wsS1akKt3SgoToVwg4MtTIByodBz2UAdVGr3ezB/iyt2Pg6/nnL/Jif8LxOZk171Jjet WXGGuICyBfO0n6uFui2Ih5XHH905S1guDdRBoYcORGadehCf17v20zR1NJV8uKIjBnKrGV B+/AHiTEUoGJMvNrd0bCHgrnirjng2k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664196197; 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=Um6XlvrpUiNo9QGIHnJCj6XhPy/Ev8QhMMt156XEKdQ=; b=w46qsLN6ZnI6mkH6JXpdWxcS6+6SDP39zAHPzquL92u/0ACWYDUZ6W3fJq/9zB3lUnHO46 1Twm0glbkNnjMmAw== 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 030052C153; Mon, 26 Sep 2022 12:43:16 +0000 (UTC) Date: Mon, 26 Sep 2022 12:43:16 +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,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, Richard Biener wrote: > 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? Looking at what we produce on aarch64 it seems 'bool' is using an SImode register but your characterization that the upper 24 bits have undefined content suggests that is a wrong representation? If the ABI doesn't say anything about the upper bits we should reflect that somehow? Richard.