From patchwork Tue Dec 29 11:36:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421189 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (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=wRQf3rGN; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D4spQ14l0z9sVt for ; Tue, 29 Dec 2020 22:37:16 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D5CF1386EC4B; Tue, 29 Dec 2020 11:37:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5CF1386EC4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241830; bh=aRAO0CIprfST1qp/FZRoXNq9e6JE8bbGHoWMr2gAdY8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=wRQf3rGNWdeDiqSrvoti8eMC/sfGRSxh840CbQDB2kpGjEat6xyhy02Z5wheNoji2 GLK9txyW2B/Jxb5biiT9Kz8w9STfN/g/yzkp841bR59QZDiK12/Mq3ETz+fVSstgsz FJqGyGRJh/UbC1WIyMa0vRVKGBZsnNfh7J5s2obM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 8A140384A01C for ; Tue, 29 Dec 2020 11:37:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8A140384A01C Received: by mail-ed1-x52d.google.com with SMTP id c7so12309643edv.6 for ; Tue, 29 Dec 2020 03:37:07 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=aRAO0CIprfST1qp/FZRoXNq9e6JE8bbGHoWMr2gAdY8=; b=TAGr8t4uramKzJoazxTJ7NjrzAvoMhNA8euJQpNVlWG+CNyAeBWxf71lM2fkujL6lF jXUySSliar74Iv0WbKYrDBXN8uosGipozQgvPV9by6PrwsPDuATvCI+ISLGZpo4Z01i9 OyibxX2yQ271P/YpBgPn2gUv/i7sbvdn6nxrs/bDSGK3aAr13GSOCL7lQNuMtQOO5RDm geonsrwu3l6SUCmpn0pqOTpPbaurQmqVr5NPmg7oqvTlynI9m4uh/hLn4WKhU/25ASC/ 9IU/76eCX7vSi59RNoYHarlPzZ4lR4E8Fml9F7JZ/MAy0jRujlCARu8y84KfD5puFPtV l9/w== X-Gm-Message-State: AOAM531AfrgYJcDOj3ZzwhrOP5godCjf5Oh9krtJPgttoEw3JScqihYV 96ZnzOS8CtIc1lm3g3362I7zW1AR8ntIlw== X-Google-Smtp-Source: ABdhPJyCw0yktCVM9KCtuItgktrqTiiiDv7iN5+JDnt5ll4/e2EksU94JXaauYJ4C8NBXLPid6UCTg== X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr46670168edy.194.1609241826300; Tue, 29 Dec 2020 03:37:06 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:05 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 1/6] arc: Don't use predicated vadd2 instructions in mov patterns. Date: Tue, 29 Dec 2020 13:36:50 +0200 Message-Id: <20201229113655.3761444-1-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Update movdi, movdf and mov vectors not to use predicated vadd2 instructions. vadd2 is used as a "fast" move in these patterns. This fixes a number of failures in dejagnu. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.md (movdi_insn): Update pattern, no predicated vadd2 usage. (movdf_insn): Likewise. * config/arc/simdext.md (movVEC_insn): Likewise. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.md | 6 +++--- gcc/config/arc/simdext.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index ae08146bcaf..75c32f6d3e9 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -1341,7 +1341,7 @@ (define_insn_and_split "*movdi_insn" if (TARGET_PLUS_QMACW && even_register_operand (operands[0], DImode) && even_register_operand (operands[1], DImode)) - return \"vadd2\\t%0,%1,0\"; + return \"vadd2%?\\t%0,%1,0\"; return \"#\"; case 2: @@ -1421,7 +1421,7 @@ (define_insn_and_split "*movdf_insn" if (TARGET_PLUS_QMACW && even_register_operand (operands[0], DFmode) && even_register_operand (operands[1], DFmode)) - return \"vadd2\\t%0,%1,0\"; + return \"vadd2%?\\t%0,%1,0\"; return \"#\"; case 4: @@ -1450,7 +1450,7 @@ (define_insn_and_split "*movdf_insn" DONE; } [(set_attr "type" "move,move,move,move,load,store") - (set_attr "predicable" "no,no,yes,yes,no,no") + (set_attr "predicable" "no,no,no,yes,no,no") ;; ??? The ld/st values could be 16 if it's [reg,bignum]. (set_attr "length" "4,16,8,16,16,16")]) diff --git a/gcc/config/arc/simdext.md b/gcc/config/arc/simdext.md index d2fc309ea87..58651b5fcac 100644 --- a/gcc/config/arc/simdext.md +++ b/gcc/config/arc/simdext.md @@ -1413,7 +1413,7 @@ (define_insn_and_split "*mov_insn" if (TARGET_PLUS_QMACW && even_register_operand (operands[0], mode) && even_register_operand (operands[1], mode)) - return \"vadd2\\t%0,%1,0\"; + return \"vadd2%?\\t%0,%1,0\"; return \"#\"; case 2: @@ -1434,7 +1434,7 @@ (define_insn_and_split "*mov_insn" DONE; } [(set_attr "type" "move,multi,load,store") - (set_attr "predicable" "yes,no,no,no") + (set_attr "predicable" "no,no,no,no") (set_attr "iscompact" "false,false,false,false") ]) From patchwork Tue Dec 29 11:36:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421190 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=pass (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=qC4RUe5U; dkim-atps=neutral Received: from sourceware.org (unknown [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 4D4spX6vJ5z9sVt for ; Tue, 29 Dec 2020 22:37:24 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 931853887026; Tue, 29 Dec 2020 11:37:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 931853887026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241831; bh=vrnB1Dhkl2FUmnxDnkZJkgNE1qxRxZVxj9Jxyen6ris=; 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=qC4RUe5UCQjE5eEOKwye2xkVnd2BikKFS0/j2aPGN0ilmjw/rdLAEbEOQIxC8Guoi TNE2z4BpdvpsRSHr/Oz355A79jfT3MjKdRZh9Ct9NhTi9XvOZY4vZOgHMDjMOI3b6l rPTHhTVNrEJXiS13R6wVf/W2H6KdCdpWsCmc/fWI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id A420738438E4 for ; Tue, 29 Dec 2020 11:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A420738438E4 Received: by mail-ej1-x630.google.com with SMTP id ga15so17775905ejb.4 for ; Tue, 29 Dec 2020 03:37:08 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=vrnB1Dhkl2FUmnxDnkZJkgNE1qxRxZVxj9Jxyen6ris=; b=D6jPxIzUXIQjTXyxl+NBmIr8QumlKracATHi2cK+9DhJuGF+Cp4vCUrn52StJRcYlb FV2HNRlDE2RtSNHs97O/33OxEfERaOz7TzpKu5N5OyWwmyjWkI76yJ1UYU60t5B3uHMw UytJbb4hokjkdLW+7SI13VuS2d6AypO43pS2w3iHn8cGTG06njPiCSC5ll40WqtVHULw cjVZz44UiITlo6TPV8tYRt4lyPBKgo0yGyHlQ09Jf6730MsY4JW1J3gL7wkPDpcvL5bT r50gyBbgDL8eH+r5CsgG/pgSokZrBuhYRwHyAx4cjJxpvbE//Tl6NuAnOTx7z2mML0vp A0Vw== X-Gm-Message-State: AOAM532RBtbUhYzxDsrP32NDSB/F/Dbmi/pBSFpJ22XhoYFp6latJdc7 RcLrJ3nmfWMA/FL0sDf2gDwCphm0zJCfoA== X-Google-Smtp-Source: ABdhPJzJlRmH0hQhcjYRsYzMu88NYWIXa21bkPkJxkjpz9VbZrEUEDFLow0u2U1mWdg1SUk9+xDQQQ== X-Received: by 2002:a17:906:3404:: with SMTP id c4mr46099029ejb.86.1609241827552; Tue, 29 Dec 2020 03:37:07 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:07 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 2/6] arc: Fix cached to uncached moves. Date: Tue, 29 Dec 2020 13:36:51 +0200 Message-Id: <20201229113655.3761444-2-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201229113655.3761444-1-claziss@synopsys.com> References: <20201229113655.3761444-1-claziss@synopsys.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" We need an temporary register when moving data from a cached memory to an uncached memory. Fix this issue and add a test for it. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.c (prepare_move_operands): Use a temporary registers when we have cached mem-to-uncached mem moves. gcc/testsuite/ 2020-12-29 Claudiu Zissulescu Vladimir Isaev * cc.target/arc/uncached-9.c: New test. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.c | 12 +++++-- gcc/testsuite/gcc.target/arc/uncached-9.c | 39 +++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/arc/uncached-9.c diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 6a9e1fbf824..d0a52ee8b8d 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -9234,13 +9234,21 @@ prepare_move_operands (rtx *operands, machine_mode mode) } if (arc_is_uncached_mem_p (operands[1])) { + rtx tmp = operands[0]; + if (MEM_P (operands[0])) - operands[0] = force_reg (mode, operands[0]); + tmp = gen_reg_rtx (mode); + emit_insn (gen_rtx_SET - (operands[0], + (tmp, gen_rtx_UNSPEC_VOLATILE (mode, gen_rtvec (1, operands[1]), VUNSPEC_ARC_LDDI))); + if (MEM_P (operands[0])) + { + operands[1] = tmp; + return false; + } return true; } } diff --git a/gcc/testsuite/gcc.target/arc/uncached-9.c b/gcc/testsuite/gcc.target/arc/uncached-9.c new file mode 100644 index 00000000000..4caba293bc5 --- /dev/null +++ b/gcc/testsuite/gcc.target/arc/uncached-9.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +#include + +struct uncached_st +{ + int value; +} __attribute__((uncached)); + +struct cached_st +{ + int value; +}; + +struct uncached_st g_uncached_st = + { + .value = 17 + }; + +struct cached_st g_cached_st = + { + .value = 4 + }; + +void __attribute__((noinline)) test_struct_copy (void) +{ + g_cached_st.value = g_uncached_st.value; +} + +int main (void) +{ + test_struct_copy(); + + if (g_cached_st.value != g_uncached_st.value) + abort (); + + return 0; +} From patchwork Tue Dec 29 11:36:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421191 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=pass (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=hQWRgKs3; 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 4D4spb5SRVz9sVt for ; Tue, 29 Dec 2020 22:37:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3B5238350BA; Tue, 29 Dec 2020 11:37:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3B5238350BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241833; bh=e1KpdwhhH5/VTZKkYE4GrTWzWpn9vQ2/DSKpHMeO3C0=; 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=hQWRgKs3rASWdLD3hHH+K+l5Ep8cOzd3T/gxQnW0sm/l1gOQ1Wbm6ErF7zfXFeZOO hkU/BrdxrNaKeZZ/DxDkxB4+0fy+sddS3gjnETrGcovVvtNxmazUKDDv4zGjspuFBY CNF7Y513e1G3XF3h8lzXRiFAXEXIODtKRUC/XQVI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 9FAAD384A01C for ; Tue, 29 Dec 2020 11:37:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FAAD384A01C Received: by mail-ej1-x630.google.com with SMTP id q22so17809411eja.2 for ; Tue, 29 Dec 2020 03:37:09 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=e1KpdwhhH5/VTZKkYE4GrTWzWpn9vQ2/DSKpHMeO3C0=; b=Umrp2b4vx+yBqifkSRVlXfZM4TOTNZHrAvaTwXpqCviFnTHB/gbVWbbGBHLwixTXr4 5smEkROc6qMkWLVeQ7Cn2XLO4mxGX8mgwOysHj98fXN6C5kwz+cCo0WzywBS53y1wdcf QVfyrUr3mE+zq+IZ4uer3OmrdRRR7E06DN92u8fIcTE9YTEylFL+EGVGj5Ghl/mdyWWc Ges616qVa1WTxflB5OzsCCkzklxtGDXnx+5EnEEbmt+XDdc0we1tTnE4RsOvDfFkYb0J HZjYLOHIXhIJ30xd9bvXedYENwsNwjLhpaAGRlwm2l8YD+W/AjjZnHEUegMvoPmnojCj xukQ== X-Gm-Message-State: AOAM531y9SoiXr3OQn9Ji6AY59U2hQCs20Ijupj4ttOpdVn0fxYjWo9i NkxmqDATewfeGqycjkG1P1jjct2v8sLHVg== X-Google-Smtp-Source: ABdhPJzQtmq/vB6w1ljpqhFbM4VnibY1hf/GO0mrtmE3RzUExmwe24FpkUZTnY8B2nGL9tAPflntTw== X-Received: by 2002:a17:906:3711:: with SMTP id d17mr44632288ejc.121.1609241828568; Tue, 29 Dec 2020 03:37:08 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:08 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 3/6] arc: Update test pattern. Date: Tue, 29 Dec 2020 13:36:52 +0200 Message-Id: <20201229113655.3761444-3-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201229113655.3761444-1-claziss@synopsys.com> References: <20201229113655.3761444-1-claziss@synopsys.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" gcc/testsuite 2020-12-29 Claudiu Zissulescu * gcc.target/arc/loop-3.c: Update test pattern. Signed-off-by: Claudiu Zissulescu --- gcc/testsuite/gcc.target/arc/loop-3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/arc/loop-3.c b/gcc/testsuite/gcc.target/arc/loop-3.c index bf7aec94842..7f55e2f43fa 100644 --- a/gcc/testsuite/gcc.target/arc/loop-3.c +++ b/gcc/testsuite/gcc.target/arc/loop-3.c @@ -23,5 +23,5 @@ void fn1(void) } } -/* { dg-final { scan-assembler "bne_s @.L2" } } */ +/* { dg-final { scan-assembler "bne.*@.L2" } } */ /* { dg-final { scan-assembler-not "add.eq" } } */ From patchwork Tue Dec 29 11:36:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421192 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=pass (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=mmA7MdL0; dkim-atps=neutral Received: from sourceware.org (unknown [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 4D4sph42ywz9sVt for ; Tue, 29 Dec 2020 22:37:31 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 42FD93887030; Tue, 29 Dec 2020 11:37:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42FD93887030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241834; bh=WmaXhFMsbUXoL/pcuUre/b8nj2pfnXa5XVGuVseK5EQ=; 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=mmA7MdL0qoFupgEP0dTnMLSIoUbH2ApT/V5zJJoADDu1aYJRRbXVmxEZohZTqYONA ZIRzX00JfIEdPU2ceeMua8aLJObQ6WjOjpQms9FN2+F/PMjmW3XXiZYSobgaS9/u2D r9zxuhdtjgRmRVZ6Jx7lCUNWdYvLXrjtD5qSpoEk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 9AAAD38438A3 for ; Tue, 29 Dec 2020 11:37:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9AAAD38438A3 Received: by mail-ej1-x62c.google.com with SMTP id n26so17765680eju.6 for ; Tue, 29 Dec 2020 03:37:10 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=WmaXhFMsbUXoL/pcuUre/b8nj2pfnXa5XVGuVseK5EQ=; b=jES8Zm4Z/yPwQ8LKHBa2fLzUY/xxB2eT1q2Ep1adc1OEcgnkoAD1Phc3jPnw+SCGxL mjb90Hn+5f6sIgXgB3+eV/Gdl5Y4D8MojvzOxD+TspWySsNduzVbevANxl3nOM1mSPK8 phHtv8BpRb/4k52uOsn2iTFzeMg7w7QYrykHgM6+ExjY8yBGTp+Q2UbLf28KhV27474G unbhU1yNBBPLKIJZLWdBrgIElIqqVzZzEnVHhHusD7HsSKTZTXILTpshisJVO0bci6+P YjmqRAB5yqDVGGiQzdj6NdN6AnhGcA775WY9/+NTJ0wUVOPONBOlWP8w3LPmVUULxBa5 YlwA== X-Gm-Message-State: AOAM533DFxpkCTnZ0yrtpxjql6mbTXGwgZzSNYxp1v+XCuxUyDk9NLDC qeY4Dw6OyarGzpeuTFFNj/yv4OcBzAiTsw== X-Google-Smtp-Source: ABdhPJyFJmf0fIaUGg19GmB4O10bMJl6WJfdzGRTNZPH2lPL3C2pzoAE7RRdAFcLZBr7X+xm15604Q== X-Received: by 2002:a17:906:3099:: with SMTP id 25mr45306104ejv.321.1609241829554; Tue, 29 Dec 2020 03:37:09 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:09 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 4/6] arc: Make use reg_renumber safe. Date: Tue, 29 Dec 2020 13:36:53 +0200 Message-Id: <20201229113655.3761444-4-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201229113655.3761444-1-claziss@synopsys.com> References: <20201229113655.3761444-1-claziss@synopsys.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The REGNO_OK_FOR_BASE_P is using reg_renumber array. However, it is not always defined. Use it only when it is defined. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.h (REGNO_OK_FOR_BASE_P): Check if defined reg_renumber. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index fd6e21adfaa..c3886330f1b 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -588,7 +588,7 @@ extern enum reg_class arc_regno_reg_class[]; || ((REGNO) == ARG_POINTER_REGNUM) \ || ((REGNO) == FRAME_POINTER_REGNUM) \ || ((REGNO) == PCL_REG) \ - || ((unsigned) reg_renumber[REGNO] < 29) \ + || (reg_renumber && ((unsigned) reg_renumber[REGNO] < 29)) \ || ((unsigned) (REGNO) == (unsigned) arc_tp_regno) \ || (fixed_regs[REGNO] == 0 && IN_RANGE (REGNO, 32, 59)) \ || (fixed_regs[REGNO] == 0 && (REGNO) == R30_REG)) From patchwork Tue Dec 29 11:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421193 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (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=f4YJbAGS; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D4spl6P6nz9sVt for ; Tue, 29 Dec 2020 22:37:35 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4851388702E; Tue, 29 Dec 2020 11:37:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4851388702E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241835; bh=pxs1SZ6pO4ma2ntgeEL0lpV4XuWGmn7O3alUaGCbyrs=; 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=f4YJbAGS5upFwHpsvxwyTluXz9kBNReRE0lAJ7UU2otdFpmF4KSjZD9ejUacvEzjC 8WxBMitqQ4nrY7WT2ZFFgQaRY1/wtwMOZcTWT7lTCFnGz8pMRYnKBCBY5bDmbqLzgd gBGjH5pi0L+FDHEHl0HpyhVelsI3sk/nCVTPrO40= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 7A4DF38438E4 for ; Tue, 29 Dec 2020 11:37:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7A4DF38438E4 Received: by mail-ej1-x62e.google.com with SMTP id b9so17831672ejy.0 for ; Tue, 29 Dec 2020 03:37:11 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=pxs1SZ6pO4ma2ntgeEL0lpV4XuWGmn7O3alUaGCbyrs=; b=Df5vOs6vusngZG3/q65pAqdfaqUkNyJmpYWTTeKr9rq/07j3zyXtHpihepKIL/c4Cu j3pJnbClOfobglJOl8pAQkLs/WnpzCUkJQp4tmW6G4IM08J0QieoWiZ/+BJGppyfzmvo A3/U2rZ7atKR/wKB81hF9tHQZl7IXqFW/pMXgIApZ1IQ3iEeET3YazAG3GkMND3EJOz7 tuMlHerb+Ig5K+hdaDIjn0HJv65GlYIvSEc0TCPXYRQlQTGfvU4CrFDX1F1T+zpOeHcB pUNvKVPB5iGGeRTB48hmb6PzQ4GsX+5P+E0s1c5Y0o2P8gsv37J6CJeondfQq3EHGgBF mV4w== X-Gm-Message-State: AOAM532pSerYLDQZgMaqluj8kPzCfha+QkIhsRl789aPZUsIpnpl7pPx DjPDCFzULDvQOQrG7SmiI7HvJLsxp1693Q== X-Google-Smtp-Source: ABdhPJwkASbvzUDihYb2Orefsqnde15ApSRlVKDSEQQx3eBqCzN7Gj9ysW3PRE359MCSQfJL0Y1qVQ== X-Received: by 2002:a17:906:ceca:: with SMTP id si10mr44442118ejb.547.1609241830469; Tue, 29 Dec 2020 03:37:10 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:10 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 5/6] arc: flip if-condition predicates in secondary reload hook Date: Tue, 29 Dec 2020 13:36:54 +0200 Message-Id: <20201229113655.3761444-5-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201229113655.3761444-1-claziss@synopsys.com> References: <20201229113655.3761444-1-claziss@synopsys.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The ARC code contains code which should only work with the old reload pass. Such code is found in arc_secondary_reload hook, however it was not properly quarded. Reverse the if-condition predicate such that req_equiv_mem is called when lra is not in progress. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.c (arc_secondary_reload): Flip if-condition predicates. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index d0a52ee8b8d..fb672c75ff4 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -901,7 +901,7 @@ arc_secondary_reload (bool in_p, /* It is a pseudo that ends in a stack location. This procedure only works with the old reload step. */ - if (reg_equiv_mem (REGNO (x)) && !lra_in_progress) + if (!lra_in_progress && reg_equiv_mem (REGNO (x))) { /* Get the equivalent address and check the range of the offset. */ From patchwork Tue Dec 29 11:36:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu Ianculescu X-Patchwork-Id: 1421194 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=pass (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=xZN/WQwK; dkim-atps=neutral Received: from sourceware.org (unknown [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 4D4spp65Pqz9sVt for ; Tue, 29 Dec 2020 22:37:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71C57388A031; Tue, 29 Dec 2020 11:37:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71C57388A031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1609241836; bh=VmbA4AeCfzUTO5l0ALhVkJghwNiRIc/k8ld8fa7l8tY=; 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=xZN/WQwKLRV8WZp8EjPJunZ3+gtemo1MR2c2iiSZFZmuKcM6z/Z+uK5iiAU2OwHlY uansvMpcGTZEVDJeSsymnZdsSjbubCtS6Tx/dRSi3gXf28zt4v5cwUDTXg4frPVxr0 6zswfzlxwiuVJ9CLdK6W1tCce4irvjpMtduem77w= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 6C074388702F for ; Tue, 29 Dec 2020 11:37:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6C074388702F Received: by mail-ej1-x62d.google.com with SMTP id x16so17779071ejj.7 for ; Tue, 29 Dec 2020 03:37:12 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=VmbA4AeCfzUTO5l0ALhVkJghwNiRIc/k8ld8fa7l8tY=; b=T3xW2bdk6Wm9MOl+VMfjyy7FzsIud9/N+JyVQCWnP2yvCwcMFzCOLawnQk3X2ys4vu hF0GDCtTwVIPn2Sf2J8YdhcOnZrx5ewgEo/rRwIxWxqBWK53uAQ0wy7Or4Ul/BUNeaRV 1CuKpYBv35qXIzq0TYY20ZWfJyTL/KgDRK/IleKX0iP1o69UBAuwe0bB+ZmXpodeEXSZ WGd+1khYhX0jZzlNopzFsLwhoJ/cZ8kWhVFtDvxAPOyguxJDlmhOEFThVrUmvq+yYNWt 47cwtr+mSTTyOjwUFEpnUOWmMfnU3dH+PW7tF0gJumEzacWVu4KEKOTlRC7zp3VDohOo fV3w== X-Gm-Message-State: AOAM531Ilwi/eojLpi4KS872oip47+DQEhvxHuCYtd7Yw7hwQtep///W q2DjgxnvBBr+Wunn7lWSElT/ohbaHVm+2A== X-Google-Smtp-Source: ABdhPJx9/hVSwPLtTNcn3HERUDKUBknvqKgBIjzc+7wDQzfpZXA/cCpkILRW2bVmYCNVGn731Jlzww== X-Received: by 2002:a17:907:3fa3:: with SMTP id hr35mr45347204ejc.71.1609241831284; Tue, 29 Dec 2020 03:37:11 -0800 (PST) Received: from localhost.localdomain ([95.174.67.148]) by smtp.gmail.com with ESMTPSA id gn27sm8452866ejc.122.2020.12.29.03.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Dec 2020 03:37:10 -0800 (PST) X-Google-Original-From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Subject: [committed 6/6] arc: generate mac(u) insn instead of macd(u) when destination is accl Date: Tue, 29 Dec 2020 13:36:55 +0200 Message-Id: <20201229113655.3761444-6-claziss@synopsys.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201229113655.3761444-1-claziss@synopsys.com> References: <20201229113655.3761444-1-claziss@synopsys.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, 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: Claudiu Zissulescu via Gcc-patches From: Claudiu Zissulescu Ianculescu Reply-To: Claudiu Zissulescu Cc: fbedard@synopsys.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Generate MAC(U) instruction instead of MACD(U) when the destination register is already choosen as ACCL register. gcc/ 2020-12-29 Claudiu Zissulescu * config/arc/arc.md (maddsidi4_split): Skip macd gen, use mac insn instead. (macd): Update register letters. (umaddsidi4_split): Skip macdu gen, use macu insn instead. (macdu): Update register letters. Signed-off-by: Claudiu Zissulescu --- gcc/config/arc/arc.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 75c32f6d3e9..b616c7fb82c 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -6176,12 +6176,14 @@ (define_insn_and_split "maddsidi4_split" "{ rtx acc_reg = gen_rtx_REG (DImode, ACC_REG_FIRST); emit_move_insn (acc_reg, operands[3]); - if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode)) - emit_insn (gen_macd (operands[0], operands[1], operands[2])); + if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode) + && REGNO (operands[0]) != ACCL_REGNO) + emit_insn (gen_macd (operands[0], operands[1], operands[2])); else { emit_insn (gen_mac (operands[1], operands[2])); - emit_move_insn (operands[0], acc_reg); + if (REGNO (operands[0]) != ACCL_REGNO) + emit_move_insn (operands[0], acc_reg); } DONE; }" @@ -6192,8 +6194,8 @@ (define_insn "macd" [(set (match_operand:DI 0 "even_register_operand" "=Rcr,r,r") (plus:DI (mult:DI - (sign_extend:DI (match_operand:SI 1 "register_operand" "%0,c,c")) - (sign_extend:DI (match_operand:SI 2 "extend_operand" " c,cI,Cal"))) + (sign_extend:DI (match_operand:SI 1 "register_operand" "%0,r,r")) + (sign_extend:DI (match_operand:SI 2 "extend_operand" "r,rI,Cal"))) (reg:DI ARCV2_ACC))) (set (reg:DI ARCV2_ACC) (plus:DI @@ -6276,12 +6278,14 @@ (define_insn_and_split "umaddsidi4_split" "{ rtx acc_reg = gen_rtx_REG (DImode, ACC_REG_FIRST); emit_move_insn (acc_reg, operands[3]); - if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode)) - emit_insn (gen_macdu (operands[0], operands[1], operands[2])); + if (TARGET_PLUS_MACD && even_register_operand (operands[0], DImode) + && REGNO (operands[0]) != ACCL_REGNO) + emit_insn (gen_macdu (operands[0], operands[1], operands[2])); else { emit_insn (gen_macu (operands[1], operands[2])); - emit_move_insn (operands[0], acc_reg); + if (REGNO (operands[0]) != ACCL_REGNO) + emit_move_insn (operands[0], acc_reg); } DONE; }" @@ -6292,8 +6296,8 @@ (define_insn "macdu" [(set (match_operand:DI 0 "even_register_operand" "=Rcr,r,r") (plus:DI (mult:DI - (zero_extend:DI (match_operand:SI 1 "register_operand" "%0,c,c")) - (zero_extend:DI (match_operand:SI 2 "extend_operand" " c,cI,i"))) + (zero_extend:DI (match_operand:SI 1 "register_operand" "%0,r,r")) + (zero_extend:DI (match_operand:SI 2 "extend_operand" "r,rI,i"))) (reg:DI ARCV2_ACC))) (set (reg:DI ARCV2_ACC) (plus:DI