From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 8C9C43858D33 for ; Mon, 20 Nov 2023 06:46:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C9C43858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C9C43858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700462804; cv=none; b=MDJS004ZIzQKk4BrkjyEYuo/1JlBWeEiGH5T8VTCxCAtjcSywEQLf52zkGgHf5zs6xGAC4hZXW7vYUKEnXaiixzVvQdaIhb7KxBa8pNBVDu2jbyxE3COcq8+uc4kexyd17qOXb7PvF8HvM1lP73UXepfxnpACYgfNjxG+hJV158= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700462804; c=relaxed/simple; bh=XvsqnNRUPZqAP29wtdKgDkmdDut9/jcWyG8nqBdQUIY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=mLQDg3aZ82CQjzlmg27AfcBTCPywFir6H/DzXjszJa7kpBGGRAEX71eO6zR6cGURH0aBiF0wS+JlzgT/bb/UcAdVvdrrNjZ91sdWFIVyTq3PiEuDYltUQT9AKAMMB/WM5IpYHegMCwQ+ZjNfGcvIHAphAnFHDXKkTrzEoLXteok= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6ce2b6cb933so2454383a34.0 for ; Sun, 19 Nov 2023 22:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700462803; x=1701067603; darn=gcc.gnu.org; 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=BOpG1eU7xW6EHN8ZX90WyPyeEIhvtbcHQNvG/BSaya8=; b=RmLjZUFrAb1biavUqz6plWIJ1VSA2d1OXpQ51h/tntI9yMP+rtArkIj+QB6Lr8rsg/ TapVf476eVLWePiEzb+/kJ2KGaD6biNPpDBwaDGphn+It+C5yJodSMBRVz+QE00OiyrZ +fppgAsTGOj8iMLm0AGb3cCll46w9AjnxfKW8YLraMkvJqkuUlpiI1DUGSRwU7WksuBY vOxRgJNGJtHi2ppFZhS3u+hNR+Qchomxs7AfhKORXjA8woZxgRtvROrEkmO4F99duBu/ nuc/QYmi/vW4OR9oxG3yydjGGM6Qvf2M3eaqxGaRmga15GS0u779rIQEY8V/dmWx/Pya IN0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700462803; x=1701067603; 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=BOpG1eU7xW6EHN8ZX90WyPyeEIhvtbcHQNvG/BSaya8=; b=XSr4K/iJo3Iv/KSPgZ4lh0QPwcfVp+tiFxCf3JiCY74HtCfncW82W+XTPq3cTnl+IU bPmXV++aE+LUqzSFHxUtOa0G+2ZDwTXpb9/U4m6qHbaOV5WqC3E7ULB4co260EHfTU5W 8+imV/JEqf4GmSW0qBThtlkUwfuz0vDFFuoqAc8dKmWOg/g4V6kfStbW4kd7bptKbP/J TZ9/2TMVcUbyosH9ussKhA08bczbAF1CRTmIBbeLb9ZCHkemwe2dhKqHZRX6ZCuy8FD4 oDeZy9PoCD46UFYNCdZacffOSQSbdjp45XJa40NFnhEyysohUMCEofxoqODyWxiZQHp5 kOUA== X-Gm-Message-State: AOJu0YwtUEijolLYZMUpxfa8rbrUXm5+6VwyEQ2c7O/OiafC/0t0CJE5 /2dIPWt/T2VeZFv3L9nFj3c= X-Google-Smtp-Source: AGHT+IEwaiNQ3Gw/r3SMXb84ApfaO88lTLJqYFEmGopa0+e8cP3jh1lhetsNVa6An6kl814S1TbrMw== X-Received: by 2002:a05:6870:d8cd:b0:1ea:131f:5fb7 with SMTP id of13-20020a056870d8cd00b001ea131f5fb7mr9005360oac.26.1700462802645; Sun, 19 Nov 2023 22:46:42 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id n5-20020a056870880500b001e1076a668asm1251531oam.36.2023.11.19.22.46.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Nov 2023 22:46:42 -0800 (PST) Message-ID: <4c7a3049-f818-45df-8352-71ab12118a95@gmail.com> Date: Sun, 19 Nov 2023 23:46:41 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] [ifcvt] if convert x=c ? y+z : y by RISC-V Zicond like insns Content-Language: en-US To: Fei Gao , gcc-patches Cc: Kito Cheng , Palmer Dabbelt References: <20231030072523.26818-1-gaofei@eswincomputing.com> <20231030072523.26818-3-gaofei@eswincomputing.com> <2023103111354257191364@eswincomputing.com> From: Jeff Law In-Reply-To: <2023103111354257191364@eswincomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 10/30/23 21:35, Fei Gao wrote: >> So just a few notes to further illustrate why I'm currently looking to >> take the VRULL+Ventana implementation.  The code above would be much >> better handled by just calling noce_emit_cmove.  noce_emit_cmove will go >> through the conditional move expander.  So any improvement we make in >> the expander "just work" when called from the if-converter. > noce_emit_czero is used here to make sure czero insns are emited. > noce_emit_cmove includes SFB and Thead movcc, which will take precedence > over zicond in RISCV if enabled. Unfortunately we have products with SFB and Zicond > both available and saw such conflict. > And that is also the reason to add hook TARGET_HAVE_COND_ZERO > in [PATCH 1/4] to disallow ineffient code emited by SFB enable and Zicond disabled case. I understand what you're trying to do, but I would consider the TARGET_HAVE_COND_ZERO fundamentally the wrong approach. I'm willing to defer routing everything through noce_emit_cmove for now, but that's really where this code needs to be going. If that's causing a conflict for a particular implementation with both SFB and Zicond, then we'll have to look at the details and adjust things in the target files. > Cool and waiting for your submit. Shifts/rotates can be added in noce_try_cond_zero_arith. Fully agreed. Those are easy. > I tried to keep noce_try_cond_zero_arith simple without introducing SCC and other stuff > as addtional insns will be generated for greater than like comparision > but may not be generated for branch-insn based SFB. And I think the result is we're going to fail to implement many profitable if-conversions. Jeff