From patchwork Tue Sep 15 01:19:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 1364021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=JfFEPLQr; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Br55R4dYXz9sTC for ; Tue, 15 Sep 2020 11:20:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92253386F807; Tue, 15 Sep 2020 01:20:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92253386F807 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600132835; bh=AZUfgACXG4amTsiKHHYlgTsBznJ6vhKRCSsfEljLyVY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JfFEPLQrzYNCXbNsSlaAZYz59jkOiI6dzISyvfHrSRiGGBoH7fGJcpkV/mn2e8oSE RBtdqcqNTkCIeEoaO60XPPppt4S0X/C6FbvwDU6rUYsoQeintWdNQDz9Nl/BHNgQrT W40gWoqWysmaYsTZy7bmdvC1tkBkaON7V9aK+XL4= X-Original-To: gcc-patches@sourceware.org Delivered-To: gcc-patches@sourceware.org Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id 4D56E383F858 for ; Tue, 15 Sep 2020 01:20:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4D56E383F858 Received: by mail-pj1-x102f.google.com with SMTP id t7so897191pjd.3 for ; Mon, 14 Sep 2020 18:20:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AZUfgACXG4amTsiKHHYlgTsBznJ6vhKRCSsfEljLyVY=; b=frvmlXMlXVfapGI1CJ/yFqkuLr1GuFgDdTLzWux2ggcy2UqfTPP4y3DKyNmmJU1j7Z h+Xs9qd3b6s90rYnUmbUSzHW9VbC02coXk9AMPvbf224UrtV5H/RTpOHMwKIIVGmHTSw Sjx4JQ+sYLjtBq+roPVYqyNcD5W3DgIpAQqAkuh95uXYmEbpvYSam6T31p57MjZ45gZk YXUPOgBApCNMw3vsUWfsU7muIMEsfiSTXgtUtk3lTHESFOzyRsCKS8wT0tfJ4sMtyOdu GQGvx5+ucXawSu98vycK1HrCMVPFlQ/pmHaV+4B4m2eNTqbPf5cho2UTC0vb3CyKoZap 5A2w== X-Gm-Message-State: AOAM531rvMZVvimXk07L6qhJ+6/BWXAewVVDHmKxHp51SGKxtypqZXKD GXfmLEPRBnLcmQ9Coamsoqk= X-Google-Smtp-Source: ABdhPJzr5/iCBDAACDGuD275zKJdVAYXm2aW7cincUJad9jABttYlnJO3YIfd3mEf31t1lCkhcrJbw== X-Received: by 2002:a17:90a:fc1:: with SMTP id 59mr2021682pjz.156.1600132832507; Mon, 14 Sep 2020 18:20:32 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:2474:1d78:84bf:1670]) by smtp.gmail.com with ESMTPSA id e207sm12210851pfh.171.2020.09.14.18.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 18:20:31 -0700 (PDT) To: Segher Boessenkool Subject: [RS6000] rs6000_rtx_costs for PLUS/MINUS constant Date: Tue, 15 Sep 2020 10:49:40 +0930 Message-Id: <20200915011946.3395-3-amodra@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200915011946.3395-1-amodra@gmail.com> References: <20200915011946.3395-1-amodra@gmail.com> X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , X-Patchwork-Original-From: Alan Modra via Gcc-patches From: Alan Modra Reply-To: Alan Modra Cc: gcc-patches@sourceware.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" These functions do behave a little differently for SImode, so the mode should be passed. * config/rs6000/rs6000.c (rs6000_rtx_costs): Pass mode to reg_or_add_cint_operand and reg_or_sub_cint_operand. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 6fc86f8185a..32044d33977 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21189,9 +21189,9 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code, return true; } else if ((outer_code == PLUS - && reg_or_add_cint_operand (x, VOIDmode)) + && reg_or_add_cint_operand (x, mode)) || (outer_code == MINUS - && reg_or_sub_cint_operand (x, VOIDmode)) + && reg_or_sub_cint_operand (x, mode)) || ((outer_code == SET || outer_code == IOR || outer_code == XOR)