From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id B965E385840E for ; Tue, 1 Nov 2022 17:00:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B965E385840E 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-pg1-x535.google.com with SMTP id h193so5235245pgc.10 for ; Tue, 01 Nov 2022 10:00:14 -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:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0fbUVAeHvlZO9pjNozI760aLp2CjnuFCHVa0iVVGOAI=; b=Bek29ti/dA0zo/eavnA2F2atxNfA0+gMgeL9xujmzvX+LSSKJYuJyDNg2TGqja532N q86T+3zLxXFT6uy1BLHXuV+J0+K+ZIpOua2b+9Jjj8DLZP6+EYNs+oZSCzi6zj+3ZYJH ta1OKEZkKVHrW7sppjxFVwSGARNuMuiG4Of0ZhlxCczEHdX9pV4pkjlyWvyOZ2IQ6PqW N9Q0+m2+vvgdSNpC8jFFGjpbHV1kXsO5pKa+qbxbmvfJ3WxV/IYJ5SfDgrb7ZVT1/4zf DLt6dIg27zbWMPW23dqE1dpHeQ8yS1hlcFMIrZn3nVe0TnTOTS/TubdlNl6NXwpAIq1I Tgyw== 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:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0fbUVAeHvlZO9pjNozI760aLp2CjnuFCHVa0iVVGOAI=; b=t1iz3Cax9hmS6xWEjnZLYlw3TPAMmk6q0ODkqFKUtwUpo6hJJF8dt14TrbXmNUIbpD mDs7WB5P+kP366svCXpHjFtUjmliLREhXbnI4d1CHnk/wEEBcdo7uWpgYqNPKUKAoONo QWABSSXrO7tZ94P5sYppSFAKsXmbl17SIIflRXsIaw80ZPrEuHCN+jUwNNU4OpnWCOQP g8Kns/TxOLBFYop6GChZ5c2ALxxXiF3Q7blC7NK5Nj5FKk4BzBUfIow9RrADFznwIVbf YVgThf3X/gzxd9E2DfFwRpASF+0jqIEvyN2kxM2t9SFk0MqrW5ZZ+a0YlB7ShxqlWjtB YnxQ== X-Gm-Message-State: ACrzQf0aSwTFYddMahTYnPI8ck04aZzGHalmoGwDrN4U0gUWGDKDHEXR mvTXg/9fsVkLYffS5nzUrhk= X-Google-Smtp-Source: AMsMyM4jD9i+6rLiWCmBtJwZnPk0rr4f+iNqWUWgTCCX36w+0kYZOzr0uNLbI/L3TpLant/65nqUVg== X-Received: by 2002:a05:6a00:2396:b0:56c:b770:eda6 with SMTP id f22-20020a056a00239600b0056cb770eda6mr20426403pfc.38.1667322013487; Tue, 01 Nov 2022 10:00:13 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id p4-20020a622904000000b0056da2ad6503sm3047581pfp.39.2022.11.01.10.00.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 10:00:13 -0700 (PDT) Message-ID: Date: Tue, 1 Nov 2022 11:00:11 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 1/2]middle-end: Add new tbranch optab to add support for bit-test-and-branch operations Content-Language: en-US To: Tamar Christina , "gcc-patches@gcc.gnu.org" Cc: nd , "rguenther@suse.de" 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=-2.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 11/1/22 09:53, Tamar Christina wrote: >> >>> from the machine description. >>> >>> +@cindex @code{tbranch@var{mode}4} instruction pattern @item >>> +@samp{tbranch@var{mode}4} Conditional branch instruction combined >>> +with a bit test-and-compare instruction. Operand 0 is a comparison >>> +operator. Operand 1 is the operand of the comparison. Operand 2 is >>> +the bit position of Operand 1 to test. >>> +Operand 3 is the @code{code_label} to jump to. >> Should we refine/document the set of comparison operators allowed?    Is >> operand 1 an arbitrary RTL expression or more limited?  I'm guessing its >> relatively arbitrary given how you've massaged the existing branch-on-bit >> patterns from the aarch backend. > It can be any expression in theory. However in practical terms we usually force > the values to registers before calling the expansion. My assumption is that this > is for CSE purposes but that's only a guess. Understood.  And generally yes, forcing expressions into regs is good for CSE. > >> Do we have enough information lying around from Ranger to avoid the need >> to walk the def-use chain to discover that we're masking off all but one bit? >> > That's an interesting thought. I'll try to see if I can figure out how to query > Ranger here. It would be nice to do so here. Reach out to Aldy, I suspect he can probably give you the necessary pseudocode pretty quickly. Jeff