From patchwork Sun May 3 16:12:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1282033 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=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=N7aQtKip; 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 49FWGt5v17z9sRf for ; Mon, 4 May 2020 02:12:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16AFD3851C39; Sun, 3 May 2020 16:12:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 3E6DE3851C07 for ; Sun, 3 May 2020 16:12:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3E6DE3851C07 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NRv8/zOdwKkGmXIwzJ3D4zamFSjgphzxER8gMXol0HE=; b=N7aQtKipxhP6bhd/9MXf7O3cs/ as4wWxNDdMs3QHuvtDDSh2X6kh/ZCfO8wZjyClwx0BTpVHlot3GpO57WxidN+jGIwj6eTzhbpcUNI DWOQPxq+R98yGGs6Ux1dLpF38yOtNpgQEevF4fjFWrtGHmOlXYHCxcq+KdboNNsWEWd0tMlVYMMyx tc9+GR3teFgdtUx9rUYeupYEFMzgWzbXI874hrroJVaLVTWmJ7fCG/Kzvw6xrLNrlACGbdmgtLD7w nzf8nhMKaGBccEPwkIYhSmX6Q57+7iuFdOq+EZ51K9e8D0b6vfeTBu55yi8K8mG5sy5p34i0be6YR enMI0RZA==; Received: from [95.87.234.74] (port=33926 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jVHDz-0002UW-Vf; Sun, 03 May 2020 19:12:18 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 1/5] PRU: Fix comment to avoid fall through warning Date: Sun, 3 May 2020 19:12:00 +0300 Message-Id: <20200503161204.18245-2-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503161204.18245-1-dimitar@dinux.eu> References: <20200503161204.18245-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-21.9 required=5.0 tests=BAYES_05, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: 2020-05-03 Dimitar Dimitrov * config/pru/pru.c (pru_print_operand): Fix fall through comment. Signed-off-by: Dimitar Dimitrov --- gcc/config/pru/pru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/pru/pru.c b/gcc/config/pru/pru.c index 37394c5e3b9..e20b41c6d1f 100644 --- a/gcc/config/pru/pru.c +++ b/gcc/config/pru/pru.c @@ -1650,7 +1650,7 @@ pru_print_operand (FILE *file, rtx op, int letter) return; case 'Q': cond = swap_condition (cond); - /* Fall through to reverse. */ + /* Fall through. */ case 'R': fprintf (file, "%s", pru_comparison_str (reverse_condition (cond))); return; From patchwork Sun May 3 16:12:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1282035 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=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=H1UiYYuZ; 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 49FWGz5lzjz9sRf for ; Mon, 4 May 2020 02:12:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79A803851C3F; Sun, 3 May 2020 16:12:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 5C1853851C1D for ; Sun, 3 May 2020 16:12:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5C1853851C1D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4UR1MKcBtpPMkt59IFLvsnzVXbCYEJwxygcwj86AJNE=; b=H1UiYYuZNgfGNlWjm69WhkODuR zwyFtrI08IfYs8DbE03d1U5zeI4+gBvrgTLhmd1Vlk7W3rs6B6BLQdqzjBtoLWjkCv0q9uzgsSz4o wc7aGAL0efj8tqtzrUfdOk9aQSgzqHjypHxN8rGzkVeXZAYt+BBMP9dVvsAiTCA1Eq/IE0Hd67+j/ 28VNqy/0NmqVBWJ0YO4sLz541vWu2+k9SZXWoYUPLSY5STbzpqYqY874kMlwO8pYRnCd9Yg/8nN8k uStCAQAX3oTmFrrHK5j/V6ImKGiu9i1g4atd3cF2okc+BiLi7St3iTYXbRwEuExsXvWuTqdBqiE9i fpnKOH9Q==; Received: from [95.87.234.74] (port=33926 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jVHE2-0002UW-35; Sun, 03 May 2020 19:12:20 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 2/5] PRU: Simplify machine description Date: Sun, 3 May 2020 19:12:01 +0300 Message-Id: <20200503161204.18245-3-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503161204.18245-1-dimitar@dinux.eu> References: <20200503161204.18245-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-24.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Use the new @insn syntax for simpler gen_* invocation. gcc/ChangeLog: 2020-05-03 Dimitar Dimitrov * config/pru/pru.c (pru_emit_doloop): Use new gen_doloop_end_internal and gen_doloop_begin_internal. (pru_reorg_loop): Use gen_pruloop with mode. * config/pru/pru.md: Use new @insn syntax. Signed-off-by: Dimitar Dimitrov --- gcc/config/pru/pru.c | 44 +++++++++++++------------------------------ gcc/config/pru/pru.md | 6 +++--- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/gcc/config/pru/pru.c b/gcc/config/pru/pru.c index e20b41c6d1f..45b18ed6fe4 100644 --- a/gcc/config/pru/pru.c +++ b/gcc/config/pru/pru.c @@ -2345,26 +2345,14 @@ pru_emit_doloop (rtx *operands, int is_end) tag = GEN_INT (cfun->machine->doloop_tags - 1); machine_mode opmode = GET_MODE (operands[0]); + gcc_assert (opmode == HImode || opmode == SImode); + if (is_end) - { - if (opmode == HImode) - emit_jump_insn (gen_doloop_end_internalhi (operands[0], - operands[1], tag)); - else if (opmode == SImode) - emit_jump_insn (gen_doloop_end_internalsi (operands[0], - operands[1], tag)); - else - gcc_unreachable (); - } + emit_jump_insn (gen_doloop_end_internal (opmode, operands[0], + operands[1], tag)); else - { - if (opmode == HImode) - emit_insn (gen_doloop_begin_internalhi (operands[0], operands[0], tag)); - else if (opmode == SImode) - emit_insn (gen_doloop_begin_internalsi (operands[0], operands[0], tag)); - else - gcc_unreachable (); - } + emit_insn (gen_doloop_begin_internal (opmode, operands[0], + operands[0], tag)); } @@ -2607,6 +2595,7 @@ pru_reorg_loop (rtx_insn *insns) /* Case (1) or (2). */ rtx_code_label *repeat_label; rtx label_ref; + rtx loop_rtx; /* Create a new label for the repeat insn. */ repeat_label = gen_label_rtx (); @@ -2616,23 +2605,16 @@ pru_reorg_loop (rtx_insn *insns) will utilize an internal for the PRU core LOOP register. */ label_ref = gen_rtx_LABEL_REF (VOIDmode, repeat_label); machine_mode loop_mode = GET_MODE (loop->begin->loop_count); - if (loop_mode == HImode) - emit_insn_before (gen_pruloophi (loop->begin->loop_count, label_ref), - loop->begin->insn); - else if (loop_mode == SImode) - { - rtx loop_rtx = gen_pruloopsi (loop->begin->loop_count, label_ref); - emit_insn_before (loop_rtx, loop->begin->insn); - } - else if (loop_mode == VOIDmode) + if (loop_mode == VOIDmode) { gcc_assert (CONST_INT_P (loop->begin->loop_count)); gcc_assert (UBYTE_INT ( INTVAL (loop->begin->loop_count))); - rtx loop_rtx = gen_pruloopsi (loop->begin->loop_count, label_ref); - emit_insn_before (loop_rtx, loop->begin->insn); + loop_mode = SImode; } - else - gcc_unreachable (); + gcc_assert (loop_mode == HImode || loop_mode == SImode); + loop_rtx = gen_pruloop (loop_mode, loop->begin->loop_count, label_ref); + emit_insn_before (loop_rtx, loop->begin->insn); + delete_insn (loop->begin->insn); /* Insert the repeat label before the first doloop_end. diff --git a/gcc/config/pru/pru.md b/gcc/config/pru/pru.md index 67624e2aac0..2f1bc21f025 100644 --- a/gcc/config/pru/pru.md +++ b/gcc/config/pru/pru.md @@ -887,7 +887,7 @@ (define_insn "cbranch_qbbx_4" ;; This insn is volatile because we'd like it to stay in its original ;; position, just before the loop header. If it stays there, we might ;; be able to convert it into a "loop" insn. -(define_insn "doloop_begin_internal" +(define_insn "@doloop_begin_internal" [(set (match_operand:HISI 0 "register_operand" "=r") (unspec_volatile:HISI [(match_operand:HISI 1 "reg_or_ubyte_operand" "rI") @@ -909,7 +909,7 @@ (define_expand "doloop_begin" ; Note: "JUMP_INSNs and CALL_INSNs are not allowed to have any output ; reloads;". Hence this insn must be prepared for a counter that is ; not a register. -(define_insn "doloop_end_internal" +(define_insn "@doloop_end_internal" [(set (pc) (if_then_else (ne (match_operand:HISI 0 "nonimmediate_operand" "+r,*m") (const_int 1)) @@ -951,7 +951,7 @@ (define_expand "doloop_end" DONE; }) -(define_insn "pruloop" +(define_insn "@pruloop" [(set (reg:HISI LOOPCNTR_REGNUM) (unspec:HISI [(match_operand:HISI 0 "reg_or_ubyte_operand" "rI") (label_ref (match_operand 1))] From patchwork Sun May 3 16:12:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1282034 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=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=cOUOSqQo; 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 49FWGx2g2Tz9sRf for ; Mon, 4 May 2020 02:12:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A9F1386F44E; Sun, 3 May 2020 16:12:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 58FF33851C3C for ; Sun, 3 May 2020 16:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 58FF33851C3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=j7yc9zj2QdhWj9vny5OYsJb2ArU0AYcNUXvtfWNW7yU=; b=cOUOSqQoxTRU4yZVxdeWMhZ3v8 U5cCbjRXojYgvk47fatfJhr7sSBUyGuSZIu2A0F/x9YxtaHbgcXFc/hrsF/+AaiZDRjgGSe20089t 9X3jcLrvW8t5Z0lWmaSTy56QNYkMiNxpWPkyLVfA3p0B+A7HkzXRWwhJ86LBW3RaLevJccI67+bC3 p2FSHUS12rdsLsaNhqBXO+vVYGsahiF9i25E/scRTXi3cb+092J5dD9CUAFax+VtiGB3D6opYzW2F x4d+u/IWri5hnn3xtgFmI4q6PHNFquuW+kyfjvWbVkOhCdCX1IApsZlvjboIn/fOqTBNP9mGiFt+5 AlyTksLg==; Received: from [95.87.234.74] (port=33926 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jVHE4-0002UW-E8; Sun, 03 May 2020 19:12:23 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 3/5] PRU: Fix R3.w0 register class Date: Sun, 3 May 2020 19:12:02 +0300 Message-Id: <20200503161204.18245-4-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503161204.18245-1-dimitar@dinux.eu> References: <20200503161204.18245-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-24.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SCC_5_SHORT_WORD_LINES, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" TI has clarified [1] that R3.w0 is caller saved, so allow compiler to use it. This is safe change because older GCC versions treat R3.w0 as fixed register and never use it. [1] https://e2e.ti.com/support/tools/ccs/f/81/t/849993 gcc/ChangeLog: 2020-05-03 Dimitar Dimitrov * config/pru/pru.h: Mark R3.w0 as caller saved. gcc/testsuite/ChangeLog: 2020-05-03 Dimitar Dimitrov * gcc.target/pru/lra-framepointer-fragmentation-1.c: Update test to take into account additional available registers. * gcc.target/pru/lra-framepointer-fragmentation-2.c: Ditto. Signed-off-by: Dimitar Dimitrov --- gcc/config/pru/pru.h | 11 ++++++++--- .../gcc.target/pru/lra-framepointer-fragmentation-1.c | 5 +++-- .../gcc.target/pru/lra-framepointer-fragmentation-2.c | 10 ++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gcc/config/pru/pru.h b/gcc/config/pru/pru.h index ea6ee109184..314e877a5f9 100644 --- a/gcc/config/pru/pru.h +++ b/gcc/config/pru/pru.h @@ -125,7 +125,8 @@ 1 r1 Caller Saved. Also used as a temporary by function. profiler and function prologue/epilogue. 2 r2 sp Stack Pointer. - 3* r3.w0 ra Return Address (16-bit). + 3* r3.w0 Caller saved. + 3* r3.w2 ra Return Address (16-bit). 4 r4 fp Frame Pointer, also called Argument Pointer in ABI. 5-13 r5-r13 Callee Saved Registers. 14-29 r14-r29 Register Arguments. Caller Saved Registers. @@ -152,7 +153,7 @@ #define FIXED_REGISTERS \ { \ -/* 0 */ 0,0,0,0, 0,0,0,0, 1,1,1,1, 1,1,1,1, \ +/* 0 */ 0,0,0,0, 0,0,0,0, 1,1,1,1, 0,0,1,1, \ /* 4 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, \ /* 8 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, \ /* 12 */ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, \ @@ -178,10 +179,13 @@ } #define PRU_SEQ_R(X) (X) * 4 + 0, (X) * 4 + 1, (X) * 4 + 2, (X) * 4 + 3 +#define PRU_SEQ_R_W0(X) (X) * 4 + 0, (X) * 4 + 1 +#define PRU_SEQ_R_W2(X) (X) * 4 + 2, (X) * 4 + 3 #define REG_ALLOC_ORDER \ { \ /* Call-clobbered, yet not used for parameters. */ \ PRU_SEQ_R (0), PRU_SEQ_R ( 1), \ + PRU_SEQ_R_W0 (3), \ \ PRU_SEQ_R (14), PRU_SEQ_R (15), PRU_SEQ_R (16), PRU_SEQ_R (17), \ PRU_SEQ_R (18), PRU_SEQ_R (19), PRU_SEQ_R (20), PRU_SEQ_R (21), \ @@ -193,7 +197,8 @@ PRU_SEQ_R (13), \ \ PRU_SEQ_R ( 4), \ - PRU_SEQ_R ( 2), PRU_SEQ_R ( 3), \ + PRU_SEQ_R ( 2), \ + PRU_SEQ_R_W2 (3), \ \ /* I/O and virtual registers. */ \ PRU_SEQ_R (30), PRU_SEQ_R (31), PRU_SEQ_R (32), PRU_SEQ_R (33), \ diff --git a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c index ee1288fc2ae..b2a49e3a9e1 100644 --- a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c +++ b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-1.c @@ -12,6 +12,7 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b, uint64_t l1 = 0x12345678, l2 = 0x87654321, l3 = 1001, l4 = 1002; uint64_t l5 = 1004; uint32_t l6 = 2005; + uint16_t s1 = 4321; uint8_t c1 = 101, c2 = 102; /* The numerous dummy asm input operands create just @@ -24,10 +25,10 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b, : "0" (l1), "r" (a), "r"(b), "r"(c), "r"(d), "r"(e), "r"(f), "r"(g), "r"(h), "r"(l2), - "r"(c1), "r"(c2), + "r"(c1), "r"(c2), "r"(s1), "r"(l3), "r"(l4), "r"(l5), "r"(l6)); - global = a+b+c+d+e+f+g+h + c1+c2 + l2; + global = a+b+c+d+e+f+g+h + s1 + c1+c2 + l2; return l1; } diff --git a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c index 6c98e9bf13b..2f910295f2a 100644 --- a/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c +++ b/gcc/testsuite/gcc.target/pru/lra-framepointer-fragmentation-2.c @@ -14,6 +14,7 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b, uint64_t l1 = 0x12345678, l2 = 0x87654321, l3 = 1001, l4 = 1002; uint64_t l5 = 1004; uint32_t l6 = 2005; + uint16_t s1 = 4321; uint8_t c1 = 101, c2 = 102; /* The numerous dummy asm input operands create just @@ -36,13 +37,14 @@ uint64_t __attribute__((noinline)) test(uint64_t a, uint64_t b, "add %0, %0, %14\n\t" "add %0, %0, %15\n\t" "add %0, %0, %16\n\t" + "add %0, %0, %17\n\t" : "=r" (l1) : "0" (l1), "r" (a), "r"(b), "r"(c), "r"(d), "r"(e), "r"(f), - "r"(g), "r"(h), "r"(c1), "r"(c2), + "r"(g), "r"(h), "r"(c1), "r"(c2), "r"(s1), "r"(l2), "r"(l3), "r"(l4), "r"(l5), "r"(l6)); - global = a+b+c+d+e+f+g+h + c1+c2 + l2+l3+l4+l5+l6; + global = a+b+c+d+e+f+g+h + s1 + c1+c2 + l2+l3+l4+l5+l6; return l1; } @@ -51,10 +53,10 @@ int main() { uint64_t a = test(1, 2, 3, 4, 5, 6, 7, 8); - if (a != 0x98878ae8) { + if (a != 0x98879bc9) { abort(); } - if (global != 0x876557a4) { + if (global != 0x87656885) { abort(); } return 0; From patchwork Sun May 3 16:12:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1282036 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=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=eLAudAyG; 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 49FWH23CsFz9sRf for ; Mon, 4 May 2020 02:12:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0964386F829; Sun, 3 May 2020 16:12:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id 41DAD3851C3C for ; Sun, 3 May 2020 16:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 41DAD3851C3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9Gs/j+DcEAFPZ/hYNQeZekkjUyBZAgTZufXZe1jnjAw=; b=eLAudAyGzq6xSClvMjqpE3XVxP 4kBzhwYeZTcyjqNKNqH/zJqLXC0DVckAAJHOszZtR3S4FveQF3WwV/ywDU5KOtqnh5XO0sByyGVyJ Pu2kFi8XAU3uYrksVQ3SRQk7eBsLuypywjZXARzNbKSZI1LB+Li2T1Gn5dZhWkEXrKR6rnnQce4el PsPcCD4OSdJmn46smmkNg/ie+hoQYJAvYzDNjCI2tJunO0ruxZYDVty1y3FEPXBZOHMpFDqclx9e6 BBc72+nuun7tIdOZFU7mNadKJ3DxQWR8kDO9/lTbkNjWfpYlUXd9EPkW0O2J/G/M7WjZ72zQB9pUG r8prDiLA==; Received: from [95.87.234.74] (port=33926 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jVHE7-0002UW-7M; Sun, 03 May 2020 19:12:25 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 4/5] testsuite: pru: Add clobber test Date: Sun, 3 May 2020 19:12:03 +0300 Message-Id: <20200503161204.18245-5-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503161204.18245-1-dimitar@dinux.eu> References: <20200503161204.18245-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-25.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" gcc/testsuite/ChangeLog: 2020-05-03 Dimitar Dimitrov * gcc.target/pru/clobber-sp.c: New test. Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/gcc.target/pru/clobber-sp.c | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 gcc/testsuite/gcc.target/pru/clobber-sp.c diff --git a/gcc/testsuite/gcc.target/pru/clobber-sp.c b/gcc/testsuite/gcc.target/pru/clobber-sp.c new file mode 100644 index 00000000000..3cc0a60bfc9 --- /dev/null +++ b/gcc/testsuite/gcc.target/pru/clobber-sp.c @@ -0,0 +1,24 @@ +/* Test inline ASM clobber for SP register */ + +/* { dg-do compile } */ +/* { dg-options "-O1" } */ + +/* -O1 in the options is significant. */ + +extern void abort (void); + +int +test1 (void) +{ + int res; + + /* { dg-warning "listing the stack pointer register 'sp' in a clobber list is deprecated" "" { target pru-*-* } .+2 } */ + /* { dg-message "note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement" "" { target pru-*-* } .+1 } */ + asm volatile( + "ldi %[res], 101 \n\t" + : [res] "=r" (res) + : + : "sp"); + + return res; +} From patchwork Sun May 3 16:12:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1282037 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=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=ubk6V43L; 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 49FWH534CNz9sRf for ; Mon, 4 May 2020 02:12:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FC12386F82C; Sun, 3 May 2020 16:12:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id F063F386F47A for ; Sun, 3 May 2020 16:12:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F063F386F47A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dimitar@dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=o6gMSXG0vbeOPTE97ehz0Pr2mq6Br3A67PD//84dVFA=; b=ubk6V43LleWGTZN0eNXwQwNCtm sDEnIdZxjPudJjptgg3adk8UjAQgCtO5H6FclBBGPklkPkObpBhst9DzfGKojeaEHzpMUjbJ6h+cB Y/8+ojjDCTpjqTjkNGUtRQLk+Q4GtQ79N1IcHZG+kLj8ImyJepp9RIGSlGvZMeygJB+DmP9satUel HREmbEPS34xlo8I3zTCNAd1DrWnWTLxgF0I/Kh261EBd8VBMsW2nIr1BTtYjSm/kXFbA+layk3T/F CD4KEkQfaSk3fJEjD702h5StX2djp2bGbhMZCL7GINnoYsLM15dHOeidvrMNvpNRl/z+VFjw0KBDu AQM6SP5A==; Received: from [95.87.234.74] (port=33926 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jVHE9-0002UW-BL; Sun, 03 May 2020 19:12:28 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Subject: [PATCH v2 5/5] PRU: Remove TARGET_HARD_REGNO_CALL_PART_CLOBBERED Date: Sun, 3 May 2020 19:12:04 +0300 Message-Id: <20200503161204.18245-6-dimitar@dinux.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503161204.18245-1-dimitar@dinux.eu> References: <20200503161204.18245-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-25.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Per clarification in [1], macro is supposed to check for partial clobbering of single HW registers. Since PRU declares only 8-bit HW registers, and ABI does not define individual bit clobbering, it is safe to remove the implementation. [1] https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00778.html gcc/ChangeLog: 2020-05-03 Dimitar Dimitrov * config/pru/pru.c (pru_hard_regno_call_part_clobbered): Remove. (TARGET_HARD_REGNO_CALL_PART_CLOBBERED): Remove. Signed-off-by: Dimitar Dimitrov --- gcc/config/pru/pru.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/gcc/config/pru/pru.c b/gcc/config/pru/pru.c index 45b18ed6fe4..a715f6b07ce 100644 --- a/gcc/config/pru/pru.c +++ b/gcc/config/pru/pru.c @@ -556,37 +556,6 @@ pru_hard_regno_scratch_ok (unsigned int regno) } -/* Implement TARGET_HARD_REGNO_CALL_PART_CLOBBERED. */ - -static bool -pru_hard_regno_call_part_clobbered (unsigned, unsigned regno, - machine_mode mode) -{ - HARD_REG_SET caller_saved_set; - HARD_REG_SET callee_saved_set; - - CLEAR_HARD_REG_SET (caller_saved_set); - CLEAR_HARD_REG_SET (callee_saved_set); - - /* r0 and r1 are caller saved. */ - add_range_to_hard_reg_set (&caller_saved_set, 0, 2 * 4); - - add_range_to_hard_reg_set (&caller_saved_set, FIRST_ARG_REGNUM, - LAST_ARG_REGNUM + 1 - FIRST_ARG_REGNUM); - - /* Treat SP as callee saved. */ - add_range_to_hard_reg_set (&callee_saved_set, STACK_POINTER_REGNUM, 4); - - /* r3 to r13 are callee saved. */ - add_range_to_hard_reg_set (&callee_saved_set, FIRST_CALLEE_SAVED_REGNUM, - LAST_CALEE_SAVED_REGNUM + 1 - - FIRST_CALLEE_SAVED_REGNUM); - - return overlaps_hard_reg_set_p (caller_saved_set, mode, regno) - && overlaps_hard_reg_set_p (callee_saved_set, mode, regno); -} - - /* Worker function for `HARD_REGNO_RENAME_OK'. Return nonzero if register OLD_REG can be renamed to register NEW_REG. */ @@ -2935,9 +2904,6 @@ pru_unwind_word_mode (void) #undef TARGET_HARD_REGNO_SCRATCH_OK #define TARGET_HARD_REGNO_SCRATCH_OK pru_hard_regno_scratch_ok -#undef TARGET_HARD_REGNO_CALL_PART_CLOBBERED -#define TARGET_HARD_REGNO_CALL_PART_CLOBBERED \ - pru_hard_regno_call_part_clobbered #undef TARGET_FUNCTION_ARG #define TARGET_FUNCTION_ARG pru_function_arg