From patchwork Mon Aug 7 20:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1818200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=b1FRAZVY; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RKSm66Cvxz1yYl for ; Tue, 8 Aug 2023 06:36:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F4263857C44 for ; Mon, 7 Aug 2023 20:36:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id A6F743858D28 for ; Mon, 7 Aug 2023 20:36:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6F743858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-268bc714ce0so4048764a91.0 for ; Mon, 07 Aug 2023 13:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1691440599; x=1692045399; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=7FEETwbNRpqSJhaQB0VwEHGvzPE0G6owz67bXKAZ8Jc=; b=b1FRAZVYEDWYV2kHT71RwdlGdw0jY3sBSxKn/aTLwAlO7dp7HdvpMWLnAxQRMwGExQ 5Ld9uGCSCKxWQe1oWky5CbcG0yuA6EafuFSPdwG52W4tE0Q1B8dyxZ61sphWQMFGeDp/ 1Kegf3L8bn61tBN71FQjGwa0O/RUFfQOUAeH4LhMvH76zAVaQ4g7ciky1GYRU/vGJSvG 91n3B4RXS5azZuxHwnsGE4UHiYeFuGcKDliYvdjpfkK7Q3813RCN5N8Q1PKQMcNlL645 eyZvDNx3hmPbAz+pSv2bsMHz8Gh+lCaYg+FMAmm+P+ov+G0mSs8cU1vZQenSgaHZP/Qp sK3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691440599; x=1692045399; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7FEETwbNRpqSJhaQB0VwEHGvzPE0G6owz67bXKAZ8Jc=; b=g26eTTH57fLSK70SwsYq+bYmj4rvNmv1YPLcDsp7hDaU0njGkj3dFv802iWuDT9Btz GQa0clVq4hTCDu5IWwh8VUW7ZcThfraBnpoogNHjfGJFCU+RnxmzHkxLluXp5tJsbH8J z0DkdRKcPx8VhUGC40ZyMxfkHrgxE1GVmS2BT9H83a7heWILaw2Yr5UTjk23Th59sNp6 LnjARnKZUk2ESuz0OK9Teod3Po4ZhgUHFL1sRzQuk9rhkbhx720zQJbJBRBQllYRflwy tzn4MbSkZI72gWSlty7tMsdSlSn93L/ntBzz2lWxUHsqlTCY2XHYfMzH90BEFfdYIiSe jM4g== X-Gm-Message-State: AOJu0Yz640lF4rdhRmVx0lz6o5F9+APVMS0Q4t45njawQ4EB0ehpxq3/ 7dTogfnVp3N2I2lP+lm38YOCRw6hnt/A1HS0XYVISw== X-Google-Smtp-Source: AGHT+IG+70rDDWd+3bDDf3bbEKxw1/06azm1UaiXmeYjVEyOPc3xD4WUFtjlDQDtOwXmL5Jr50h9Bg== X-Received: by 2002:a17:90a:cb0d:b0:268:d716:4b69 with SMTP id z13-20020a17090acb0d00b00268d7164b69mr9684436pjt.22.1691440599114; Mon, 07 Aug 2023 13:36:39 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id b21-20020a17090acc1500b002633fa95ac2sm9068355pju.13.2023.08.07.13.36.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Aug 2023 13:36:38 -0700 (PDT) Message-ID: Date: Mon, 7 Aug 2023 14:36:37 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: "gcc-patches@gcc.gnu.org" From: Jeff Law Subject: [committed][RISC-V]Don't reject constants in cmov condition X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This test is too aggressive. Constants have VOIDmode, so we need to let the through this phase of conditional move support. Fixes several missed conditional moves with the trunk. Committed to the trunk, Jeff commit 18c453f0e633abb9b317947b011ec6e07780fba8 Author: Jeff Law Date: Mon Aug 7 14:34:40 2023 -0600 [committed][RISC-V]Don't reject constants in cmov condition This test is too aggressive. Constants have VOIDmode, so we need to let the through this phase of conditional move support. Fixes several missed conditional moves with the trunk. gcc/ * config/riscv/riscv.cc (riscv_expand_conditional_move): Allow VOIDmode operands to conditional before canonicalization. diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 279304afc19..5248dd3febe 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -3582,7 +3582,8 @@ riscv_expand_conditional_move (rtx dest, rtx op, rtx cons, rtx alt) enforce that so that we don't strip away a sign_extension thinking it is unnecessary. We might consider using riscv_extend_operands if they are not already properly extended. */ - if (GET_MODE (op0) != word_mode || GET_MODE (op1) != word_mode) + if ((GET_MODE (op0) != word_mode && GET_MODE (op0) != VOIDmode) + || (GET_MODE (op1) != word_mode && GET_MODE (op1) != VOIDmode)) return false; /* Canonicalize the comparison. It must be an equality comparison