From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 2CFB23858C55 for ; Thu, 29 Sep 2022 20:49:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2CFB23858C55 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x102a.google.com with SMTP id u59-20020a17090a51c100b00205d3c44162so7095302pjh.2 for ; Thu, 29 Sep 2022 13:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=cnoZCHuRGmjM3WRpbwXx2VBoASZAYG7/j9J3b73ygk4=; b=YYU1XvCMQV6jGr1WQ5vMMYmWOM5Cqj1DVASGQUvmTuk8IM+PiNvg2U5oya0V7/hp+a VraNpLSld4NZQC80sqmTj2Z4G1D44IQSIdxn7sq4CV2uoNnr4hdoruJmMqqfNo5k7x2e FhuwyY/3pEDdkjKjYetC6yLh2G6nvPW9jn5uIza6nfGL3jWoUgRtKbuv6l/4cp6gUMsP 99GTziGvee7EoRlwPp0Bw/eD4+O4+fMvPwGapasdVxLYOav5Lu8Nqf/953YugSKSgWxU Zs7dSMUILxdadecnHw/3s40iBRUuswFo7tx9xjS/DiZH68J634nujXk6LqjpS5vw4hNa 3ELQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=cnoZCHuRGmjM3WRpbwXx2VBoASZAYG7/j9J3b73ygk4=; b=mZA7sbq9DWDQMsap4OGVapNBECMRNAp57/J3ExTXfoxGO9j2clmnBRPYIJ+ziuufyG HVMDpIIv8RUcgDCb5QLHcdSEqNL7MX70AVUSrYfNwWTscyCq2YtqQH8oo4NXK4W8+9Vx I2+kvy1UPN2DedkmCYMXgMWg+oOHTsuZ69pHuqWqTU39gsi6/+dDGnOBbxhVX8NgNwB3 15GQsk67oawLEEE+kISLcKe6hevzVL2nVipxJMDQIOrnDP78D22+ETfsmvC7bZNf4MhQ tFA9brk0H7j5qo27Ej5zqeAJaRucDJyuRMah7T32LY76sHtAMCfic4xJahFcYuDpJxMY DUTA== X-Gm-Message-State: ACrzQf3kyvKv4Khr97Pjt31hgO0pJeB4vSZWI6OHyxnfwV4pBAFCKOJl gMkkfMZBy2SSUnxYstjm1fA= X-Google-Smtp-Source: AMsMyM5Axz1eeqVs+2osL/D1012Ynd2AFg2Bbg2KCg68SwL6ysTu5TZOFC79gfdyCxYn6+qBQybaug== X-Received: by 2002:a17:90b:4a50:b0:203:1204:5bc4 with SMTP id lb16-20020a17090b4a5000b0020312045bc4mr18440256pjb.79.1664484548016; Thu, 29 Sep 2022 13:49:08 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id f67-20020a625146000000b0053812f35a41sm91310pfb.194.2022.09.29.13.49.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 13:49:07 -0700 (PDT) Message-ID: <69338309-8c9b-c93c-1df3-24e10b9452c4@gmail.com> Date: Thu, 29 Sep 2022 14:49:06 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH 1/2]middle-end: RFC: On expansion of conditional branches, give hint if argument is a truth type to backend Content-Language: en-US To: Tamar Christina , Richard Biener , "gcc-patches@gcc.gnu.org" , nd , richard.sandiford@arm.com References: <057c8b16-50a4-61cb-1801-759d1ae19021@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,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 9/29/22 03:37, Richard Sandiford wrote: > Jeff Law writes: >> On 9/28/22 09:04, Richard Sandiford wrote: >>> Tamar Christina writes: >>>>> 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.. >>> Good guess :-P We shouldn't rely on something like that for correctness. >>> >>> Would it help if we promoted the test-and-branch instructions to optabs, >>> alongside cbranch? The jump expanders could then target it directly. >>> >>> IMO that'd be a reasonable thing to do if it does help. It's a relatively >>> common operation, especially on CISCy targets. >> But don't we represent these single bit tests using zero_extract as the >> condition of the branch?  I guess if we can generate them directly >> rather than waiting for combine to deduce that we're dealing with a >> single bit test and constructing the zero_extract form would be an >> improvement and might help aarch at the same time. > Do you mean that the promote_mode stuff should use ext(z)v rather than > zero_extend to promote a bool, where available? No, just that if we're doing a single bit test that the way to handle that is with a zero_extract and the earlier we can generate that form, the better. Jeff