From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 4F5413858D1E for ; Mon, 30 Oct 2023 18:46:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F5413858D1E 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 4F5413858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698691593; cv=none; b=RFFV9Q//+SF58x5wcMk3xZHNKixsfzIlhGMSNCp5PicLYeHTmTqe3WkzUpC+JwA28sw02qS52NvQ/eYw6tD/vO62anJqCkohSo5yKOlaRK2HRIl539QIT2Fk1LeaqeURPMQvQN6Xz/W0BIXxr9BzGtnswJN7Y/bajsZQC1OxEk8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698691593; c=relaxed/simple; bh=Q2bseIrito0kcm6Qf2iShr57bcJK1lROM/OGsRE5LlE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=XPwQR47Fstd1wk3rJp2HaK5XjoQbQpXcnONNggcniRBS79bODRaRVbIf6kDdC/Jc5K9XjbNeZ821yTSddWeTW6j3QU3n8x1cJriwTEUTm3qYqG3UJHXVC6cj//LFVRGhi3XOS8n7bCiu0akj8tIE2yNjPZVZ4Lxue24xuMuAU7A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cc29f39e7aso16908535ad.0 for ; Mon, 30 Oct 2023 11:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698691591; x=1699296391; 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=6tnnXw9mSVLRTJDYpQVp7rPzTM2hkJuBgY9hOEheM5U=; b=Z83fKcvjLY4bQVbuGK7baevWqpHrFSQw7ptFQ6/tsWAfAqPLBlaFrRLSKiR6J/tEOf +Rr76sOghZQq+iDuBtQrd+QocwzPb4rAcggEWtuVdHQ4Bf3NzAl46E7w3CFpTjbMu6MU lPz1bW5on6mXVmqMPWfIYz7ltC/OdSW1eEzZ/12ZlU43xYp6lX7pQmRZ2/LrV/7Moe0l p0svxF4tnn+IMULuQmxqAQOXwz/Or1aqDuG8NyPi1hWZwBFYzmO7gb48XuHxq9iaFmQN 1G/GoEMIIso7WE9KwERK85NDz53FB4WWWOXiC8WvDSByUqws87LuyZ26Xtl/LcjwLLPl WllA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698691591; x=1699296391; 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=6tnnXw9mSVLRTJDYpQVp7rPzTM2hkJuBgY9hOEheM5U=; b=KdzuB/N9PPiX7Q1dkehyw7UU02oi20NoegrlYwLbhoFiElFbxUTpEqsk2mKpeP9tGm yhUR0zTlm1FSJ/HnhxHDujYc7hVdtkEMOAEB0voq6kfG/eFfy0dwDC1i783/bnp5SU2a ODtVLYdrpjTSKS3IsSY09Z6sqygTkWiQwpWvx8JrChEjn9gJCRWXkm2R69bMP7kalPls VHm2gZm6ZfmkWYrWNFhMctDYzHJYOomy9ScQOp/ihTkLaCLutFfNDx4NYpJBtZUXLYyl 5dolJ30vx5evv5ZO/gKvYtA76MciujKTk1R02/lsnYXSDisHeQo+a7bU9PvsuyTXZZON 6laQ== X-Gm-Message-State: AOJu0YxpzR5L8vt0FYoGt4EZyks/iirgjdBVI6xNU5CvVWwG7aQqYThH fiqZPO7g+IKBJrCJG1s0DqM= X-Google-Smtp-Source: AGHT+IGXmNYdpe0l4LbIdo2GcGihhZnC+WzaJ5BOih7kX+oGHrhVe78mZtFtM1iFucHgSUOwhjrwWg== X-Received: by 2002:a17:902:a418:b0:1cc:2eda:bde6 with SMTP id p24-20020a170902a41800b001cc2edabde6mr5772368plq.34.1698691591217; Mon, 30 Oct 2023 11:46:31 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id c12-20020a170902724c00b001b8b2b95068sm6538725pll.204.2023.10.30.11.46.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Oct 2023 11:46:30 -0700 (PDT) Message-ID: <7bc1729b-2ac4-4552-a484-28925a328374@gmail.com> Date: Mon, 30 Oct 2023 12:46:26 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] [ifcvt] if convert x=c ? y&z : y by RISC-V Zicond like insns Content-Language: en-US To: Fei Gao , gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com References: <20231030072523.26818-1-gaofei@eswincomputing.com> <20231030072523.26818-5-gaofei@eswincomputing.com> From: Jeff Law In-Reply-To: <20231030072523.26818-5-gaofei@eswincomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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,KAM_SHORT,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 10/30/23 01:25, Fei Gao wrote: > Conditional and, if zero > rd = (rc == 0) ? (rs1 & rs2) : rs1 > --> > and rd, rs1, rs2 > czero.eqz rtmp, rs1, rc > or rd, rd, rtmp > > Conditional and, if non-zero > rd = (rc != 0) ? (rs1 & rs2) : rs1 > --> > and rd, rs1, rs2 > czero.nez rtmp, rs1, rc > or rd, rd, rtmp > > Co-authored-by: Xiao Zeng > > gcc/ChangeLog: > > * ifcvt.cc (noce_cond_zero_binary_op_supported): add support for and > (noce_try_cond_zero_arith): adapt for and operation. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/zicond_ifcvt_opt.c: add TCs for and operation. Our internal bits also capture all these cases. The allocation is slightly different and occasionally operands are swapped in an associative operation, but the net is the same. Jeff