From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id EDA373858296 for ; Thu, 3 Aug 2023 02:59:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EDA373858296 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-oi1-x236.google.com with SMTP id 5614622812f47-3a38953c928so364356b6e.1 for ; Wed, 02 Aug 2023 19:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691031553; x=1691636353; 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=miYyElbXsiNmzH3fcESNdrHPYcVo4e4/ueyWqvut070=; b=pO93Ft0hY5E43ShCobWtp+g0X1l4MpKARxXhb13k0zbl4hE9CTtYqLDwDnhNczSY8r xkU9oMGA8neA/elaWk/sx141WZA6viIyWkwO2RRvZlkwm7pvw+afSdbrQOJtYH9uU4XT 4tstC11fCdfnAs2NmarbHUlNoQSij50Px0OSsUbYFwfzHQEUYNf7dTzCNT8/OAxDAEK3 bA+uSgv1ihzVGVDSBMsbGGd5YnlvviLLEkcQCdTP7OlFfG5LgTcbRT7ToDsg4OXhbLEZ ljNfQLDsncAofJpdrCjsVi1r9aZAL1LEo+uGD8/K+xt+gPWy4iX2RAil5lMDY0fBz9E5 5YyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691031553; x=1691636353; 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=miYyElbXsiNmzH3fcESNdrHPYcVo4e4/ueyWqvut070=; b=iZ9LBTZHcvTl69AmdLZGpseFIrGwOds5p26wrLnB7Trji35+F+drhzVU1NRDaS79bv xMz5zobA9RQ6L+c6903EOTHY2SKp89qJBKOZ+XJwcit/aRC18N1D/dGfSC7+sHv7LSs8 WaV1CpyE9SBx9lEp6jnwnnSs69wPHakdi0wA3kABtIaAk9oJA4XcZh5uWyG9qzrJsRtH 67Lu65+w0T6653TFGjNsS6Bj+V4bLk7HVHZqVitxRLNkhjerzOsEyhC9gakRvnGOM8IY RfjpmenjSM2Vfv5ZohkeAZAuQ8F9hVU8GBYlpVZwyXr89FWaBrK1IwdqSIflgf+WQO0U 0bwA== X-Gm-Message-State: ABy/qLZAHJt5//Vlnrz78QAjB8KI7EitR3stdmfaMPR1MvALUWgBwRht RvZ7KRheY3d31lPAgsQNIiU= X-Google-Smtp-Source: APBJJlH5BMIVpU/a8B1RwcIialWLQu0wPRn13e6/RaVbuAIBqrl4USQakZbbkLggqkLiE4/7yAZmMg== X-Received: by 2002:a05:6808:1a05:b0:3a1:c93c:6d28 with SMTP id bk5-20020a0568081a0500b003a1c93c6d28mr24306394oib.23.1691031553082; Wed, 02 Aug 2023 19:59:13 -0700 (PDT) Received: from [172.31.1.103] ([172.56.168.124]) by smtp.gmail.com with ESMTPSA id h18-20020a62b412000000b00682af93093dsm11681310pfn.45.2023.08.02.19.59.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 19:59:12 -0700 (PDT) Message-ID: <84620816-9b2e-d1cc-ff40-f680c52d4ab9@gmail.com> Date: Wed, 2 Aug 2023 20:59:10 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 0/5] Recognize Zicond extension Content-Language: en-US To: Xiao Zeng , gcc-patches Cc: research_trasio , "kito.cheng" , zhengyu , eri-sw-toolchain References: <20230719101156.21771-1-zengxiao@eswincomputing.com> <2023072716434903717718@eswincomputing.com> <86dc9255-3d7b-54fc-1c3c-35373218c5f0@gmail.com> <202307281434423583808@eswincomputing.com> From: Jeff Law In-Reply-To: <202307281434423583808@eswincomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 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,T_SCC_BODY_TEXT_LINE 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 7/28/23 00:34, Xiao Zeng wrote: > >> >> What I like about yours is it keeps all the logic in riscv.cc rather >> than scattering it across riscv.cc and riscv.md. > > Yes, when I use enough test cases, I cannot find a concise way to optimize > all test cases. When I enumerated all possible cases in the movcc > function of the RISC-V backend, I found a method that satisfied me, which > is the method in patch [3/5]. I continue to work with the riscv_expand_conditional_move improvements. Given the deeper problems we have with costing, I'm considering starting to push some of the riscv_expand_conditional_move work you've done without the testcases since those testcases depend on fixing the costing problems. The expansion changes still have value without the costing changes. When we expand a COND_EXPR from gimple, we will attempt to use the conditional move pattern first, without regard for costing. > > If it's just for the Zicond instruction set, is it necessary to make judgments > outside of eq/ne? After all, it does not support comparison actions other > than eq/ne. Of course, it is also possible to use a special technique to use > Zicond in non eq/ne comparisons. It's not necessary, but it's certainly helpful to utilize sCC insns in conjuction with zicond to if-convert other conditional branches. It's conceptually pretty simple. If the incoming code is not EQ/NE or we're not comparing a register against 0, then we can emit an scc insn to get the comparison result into a temporary, then use the standard zicond expansions. Jeff