From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id A78CE3858016 for ; Wed, 28 Sep 2022 17:23:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A78CE3858016 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-io1-xd32.google.com with SMTP id r134so10691541iod.8 for ; Wed, 28 Sep 2022 10:23:36 -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=phvNHgaBVryfrepHvFrGv2V8RLcQpcCkQRroT5NVJEk=; b=K5sVOE2w0t3YQTTNAE5t9TUszkKWn0PRxjY6h2+Uox/73H9Z2njX3FYf0iA8bI8HEE aFKhjEsPTRLYLD73LU5qrZtkBlPOHfwiJP2OaRdP+Z6K9/N4eOP7gLqSDksPQMU55CBr WXMbUwsIpaGFrjHe2EJu0//bKQ38FwJS7ElSdXczXuj4OQ0Ypb248hmdwiJTG4fkzs/6 QwL9jpHNFCZ5tnNZ/HPwVXvo6TATKipUY43yczVYyrHWfBuV439WQbliEZSOIaDswroF mE4To0zvkGGLn5ANnZ9L9fXuuovBKyNl+WgU2zyXijjnRM3XQtxorkywqOJLvqEQNoRF Jy6w== 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=phvNHgaBVryfrepHvFrGv2V8RLcQpcCkQRroT5NVJEk=; b=o0jbNXcuTQ1y+hTidyQLPTlBpBUu76N3g5n00g+AA7qd7gZS8P9hFEBgk36k8aXYvO yHhWjRBMVJ8l1cE1YyhT8hxDZ3YKuPfCc2iSvNqmRb+dJKiTluPEspNikLJKbxKsjLOl iNvOcCGKeVfWI+Wuel5ZlvcfOpCHv3VtXuuEBVc1PQLPugoNtV4pEWHxa4YB026W5RyW uMpei8UnTbm7tOTjzASudYrDGUQKJpsk2inejz8ow2nQ5HH0S+usO6B3ERzMM98KqzCb 9eYVFGSGPtz9g+qqH1gwl2XLXZ5K+0ZMSo3toy+TypiTArfaupxLbK23K+OqXupc6P4s eEYg== X-Gm-Message-State: ACrzQf0CpAXbd0jpn7NRoYFS1GG2eyxyagd3Ku1IoBclpubPhr/M1Vou 6gkLEnF575FvZVaMulD/etc= X-Google-Smtp-Source: AMsMyM71xupQaJbmQGv+7LH0q0etJCuufu9mJ0H1gxiLV15mcnDDtlizpTTx7bsRFNIcyaYXrkofgA== X-Received: by 2002:a6b:c343:0:b0:68a:b1d0:3ddf with SMTP id t64-20020a6bc343000000b0068ab1d03ddfmr14521504iof.0.1664385815778; Wed, 28 Sep 2022 10:23:35 -0700 (PDT) Received: from [192.168.0.58] (65-130-23-164.slkc.qwest.net. [65.130.23.164]) by smtp.gmail.com with ESMTPSA id y3-20020a056602164300b006a11760aebbsm2203899iow.36.2022.09.28.10.23.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Sep 2022 10:23:35 -0700 (PDT) Message-ID: <057c8b16-50a4-61cb-1801-759d1ae19021@gmail.com> Date: Wed, 28 Sep 2022 11:23:32 -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: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 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/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. jeff