From patchwork Sun Oct 13 08:44:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1175821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510863-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="SiXM9psr"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="Bgy3Ej9y"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46rZz8599Hz9sP4 for ; Sun, 13 Oct 2019 19:45:56 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=n8w 1Xaddw7kOUnX9ME8dGZX0eSmHosbqkXRUPWrn7kmZWqH7UQpy2wBW3qK+n+SnYtz h9kKAwOI2CCSkYmzwCSiU/ideN4ZZ7PpZL+nBy45Yr9d3DYWr6k/pw583rlAiVzp WUIDV+A0l+7NUfTrcq94Sv6Y2VSyYbImFrXPF1PY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=Xo8jbfMPx M/w4lsijesKxvOCTco=; b=SiXM9psrCg3IETMsdecRftD5oR2zvaA84RY+LHbmK TezvaI7I9Av41vRjb773RUsxTppXMEFdsdufCCoC9Rlbz3+8OSTRCSY6ATFouQvc yNhefboW6gpBIETennU5+5iLrJMOh1S1XsSxDb1YLuwmCDUE+9OpNw+mDMEYRzz1 2k= Received: (qmail 129098 invoked by alias); 13 Oct 2019 08:45:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 128961 invoked by uid 89); 13 Oct 2019 08:45:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:eu, HX-Languages-Length:731, H*F:D*eu, letter X-HELO: server28.superhosting.bg Received: from server28.superhosting.bg (HELO server28.superhosting.bg) (217.174.156.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2019 08:45:13 +0000 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=2q8NHTcjjJ6tNSm3298CTBdzG4+a+Wly9X2e1oMDav0=; b=Bgy3Ej9yyFnTsBZf63scB4DFaH G5H7oZI9lJ+SMclEqJ8N8bK3zQYVl2ABw5Nm/Za1Q+pU0m/JY6xtQNwBlw1I0XHX/mKl8y/Fzs73Y zX3ssITMnu6hi+R3lKvMSEC0voH7b10Wc7XBImShzrSoViQPMHuX60AZ5yzCMNpTs4JAYtKQ2g57+ lgMThahc/943T7D+qleUshYfQm2Mv7jK0pke+KvjqrrEqxL4tiEQxCGIw2QRjt981NqBUglb3/M8r 1FKviXqYPSKv+oQqJV5kJTe9utPhMN6D7BoDhK56YpeRHi/Oh++YVWu4flhnfR192R2saimSM/LIl ThplyOHg==; Received: from [95.87.234.74] (port=45180 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iJZUx-00041Y-BY; Sun, 13 Oct 2019 11:45:09 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH 1/5] PRU: Fix comment to avoid fall through warning Date: Sun, 13 Oct 2019 11:44:50 +0300 Message-Id: <20191013084454.13878-2-dimitar@dinux.eu> In-Reply-To: <20191013084454.13878-1-dimitar@dinux.eu> References: <20191013084454.13878-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-IsSubscribed: yes gcc/ChangeLog: 2019-10-13 Dimitar Dimitrov * config/pru/pru.c (pru_print_operand): Fix 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 16d1451262e..59b004b774f 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 Oct 13 08:44:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1175819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510862-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="C4ZpSuph"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="KLuBbpIq"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46rZyw2d4Dz9sP4 for ; Sun, 13 Oct 2019 19:45:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=Bg8 b5hkqbi6wwhCE2cjDLjDESkMS3/tWrFIvDlhNEiqaomX7bf7o8AQM3M1JvMeQKU/ 33xM/OaSfNZDp1ohxLRuYQTDB9BKbm2MUFCMSfCfMYWwwcvVeWklXReqbo4u06Zi HImf8nP5zz1Krn0az+nUlFlbejZBTwK0Cc9Y/fW8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=eeYVvIgUe 9gVf95jA8W22S7CCqc=; b=C4ZpSuphnVBDDC7u9WTCq6P1GjSoppgTi2Ed5+CBR svOUBkvIGfhDjaXZDUlQQmR/HpNTb8wjohEH0ECwxAlbxx0UE/YxhivR8s43Mn4y ej35vWQVhivEmcJKV9Gii3Q1oyLRYxJVUClFLJH5aDJPCA2PGcx70I/nt6UhV1I1 zQ= Received: (qmail 129045 invoked by alias); 13 Oct 2019 08:45:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 128963 invoked by uid 89); 13 Oct 2019 08:45:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:eu, H*F:D*eu, sk:nonimme, if_then_else X-HELO: server28.superhosting.bg Received: from server28.superhosting.bg (HELO server28.superhosting.bg) (217.174.156.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2019 08:45:13 +0000 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=tAare/2gXnv/TKKbw8RxiAXlq3LTPpmAsNsNlkYpdQM=; b=KLuBbpIqloV3aRzbD/4Ic5sIJY GrkfxW2iJUBkNojgH6diL2LP6KymFGXM0vC272a/CmJAYLFsY9PPK8UWP3v6ccTCJ99lfWKfIQtHl 8z9+5l+KkkA+rJvYBZdbPYgGJRL+kiQub+fz4ZrJmG/3e1Xp4L+qsPuG3tQFKVzDpfcFQTmvNgChE 68DTS8/IA4Rry2UsTgDP+4zN9mW8P9NKIMGmWAUhmZG2BfoFkoC+uyx+58t3pJEUrDfNYJ+eE9nrH sBqIJ0LudF9ocD3kUHipT9AHjheN7PPzB7xaQ4oOkBdxV/FSaunKOfazptljC6AcKVBqMHQ8BvQ24 y383s2VA==; Received: from [95.87.234.74] (port=45180 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iJZUz-00041Y-FW; Sun, 13 Oct 2019 11:45:11 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH 2/5] PRU: Simplify machine description Date: Sun, 13 Oct 2019 11:44:51 +0300 Message-Id: <20191013084454.13878-3-dimitar@dinux.eu> In-Reply-To: <20191013084454.13878-1-dimitar@dinux.eu> References: <20191013084454.13878-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-IsSubscribed: yes Use the new @insn syntax for simpler gen_* invocation. gcc/ChangeLog: 2019-10-13 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 59b004b774f..dabea2b59c8 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 53fa73dec03..567f41960b4 100644 --- a/gcc/config/pru/pru.md +++ b/gcc/config/pru/pru.md @@ -887,7 +887,7 @@ ;; 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 @@ ; 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 @@ 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 Oct 13 08:44:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1175822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510864-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="TQXa+vMY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="dFVYGXBY"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46rZzN5Gp7z9sP4 for ; Sun, 13 Oct 2019 19:46:08 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=fCv IyQZoG+uQqcm+L3UXx/buVWQa6ZKCjQBF/zyqcy6ufi6hsko0Az830Be+OQbmspo MfYeiyChusmTQJelBZaK2CFBGfPCpZwsF9E/pgJsRuySKUK7LZe/c3NL4Pg1g4CK OjjMv+1VDc2iosl6mYPwkqxTwrGaUEgY/sUYlsoI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=NBtapxvnQ oRnPLARvIeJBXH6Lmg=; b=TQXa+vMYWCaCTH2kvgNjMuJx9mMWIJfUKr+TmQWYe 1hFmabkA/tcAmtRUunaWWfifZN0OmOYLBl9btdmZP3vQjN7qAeExWZNuTFdnboW1 cSRbKCeRBXn3uWMk3GDptPrffggsCurWmTW9vb1HiO4oLfIoWGgRW9sfhusA521C xM= Received: (qmail 129121 invoked by alias); 13 Oct 2019 08:45:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 128964 invoked by uid 89); 13 Oct 2019 08:45:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:eu, ISA, H*F:D*eu, translate X-HELO: server28.superhosting.bg Received: from server28.superhosting.bg (HELO server28.superhosting.bg) (217.174.156.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2019 08:45:15 +0000 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=y17VywhYAait78AcnvX4U+8x5+i8bKAsPRaFvqXgPXE=; b=dFVYGXBYSVz44Rgt/omKnp/ud1 lHISIUMdnzFYqo7vM/hDD0dPIjcuN8o+ugy0qHzUYW7B9r5bza4Vovt+RdmHgGvbC78MflTAHVVhD WEhC5bnKnLTW29R7uTMGVjt6slVLdbX9I1H3BmNBerwJcQAJ1NHVOHE/vylAz8K4/35cEPgKmqi5O 8YNy6Xg2yldF7wpEWeSJQ/DkUOd4jYW+76Uv0an4015eFhS8V1iQE44kyvg83E1TAdbGy1J4yxPhk ZDllgz39vJdjw1VJXud3htnHRfqYy5sz/wTBlJk4Ud6kcxru+jhQ0heYClszPaL4ukurqO6TC4p8T +QQSaIVQ==; Received: from [95.87.234.74] (port=45180 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iJZV1-00041Y-Kl; Sun, 13 Oct 2019 11:45:13 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH 3/5] PRU: Fix comment about R3/RA Date: Sun, 13 Oct 2019 11:44:52 +0300 Message-Id: <20191013084454.13878-4-dimitar@dinux.eu> In-Reply-To: <20191013084454.13878-1-dimitar@dinux.eu> References: <20191013084454.13878-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-IsSubscribed: yes Comment had a typo. Fix it and clarify. gcc/ChangeLog: 2019-10-13 Dimitar Dimitrov * config/pru/pru.h: Clarify R3/RA ABI. Signed-off-by: Dimitar Dimitrov --- gcc/config/pru/pru.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/config/pru/pru.h b/gcc/config/pru/pru.h index 15fb637dec6..f2bdd1ef02b 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 ABI does not specify if it is caller or callee 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. @@ -148,6 +149,11 @@ of 8 bit sub-registers (e.g. RA starts at r12). When outputting assembly, GCC will take into account the RTL operand size (e.g. r12:HI) in order to translate to the conventional PRU ISA format expected by GAS (r3.w0). + + TI ISA documentation (SPRUHV7C) does not mark r3.w0 as neither + caller-saved nor callee-saved. So until TI clarifies, let's mark + it as fixed. + */ #define FIXED_REGISTERS \ From patchwork Sun Oct 13 08:44:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1175824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510866-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ozv6Cs9K"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="faGH/hWd"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46rZzr27Nrz9s7T for ; Sun, 13 Oct 2019 19:46:32 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=Tpc lMjUFlmb04BUz/LcYOex4UrOi7yrIfMF2b2AJhZ1q1chRU4DH8gE+wKgvDCLl5E2 rEjChJOaxzANECaRaGOSdzcm2VdvtlvF2Gv2CubdrJuXLjYQzBj571D/wBK7Pufr dtU0YzXqBISnmq9pyfmZ0BOmKJQaFJE08kDc73TM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=YFFjDbOkc qyP8UtqcRV4j9NeQTk=; b=Ozv6Cs9KiuNmIjWUbiIRob5ipgCmsEnrwN2IH3Lw3 YKAzasfG5FeoKy5zX3eA0PwCI0/GKKoiFNrJl+3rrFkvWA8CniDqG1ppSqh05VWb P38qUOUTcNZFk6Y5xWlMpcDx4X39yOj7y7owLolHGNvh6CFzp0OtdrcF/7y+ajhk mM= Received: (qmail 130208 invoked by alias); 13 Oct 2019 08:45:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 130138 invoked by uid 89); 13 Oct 2019 08:45:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=sk:stack_p, H*r:sk:DHE_RSA, HContent-Transfer-Encoding:8bit X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2019 08:45:25 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJZVD-0004qn-4B for gcc-patches@gcc.gnu.org; Sun, 13 Oct 2019 04:45:24 -0400 Received: from server28.superhosting.bg ([217.174.156.11]:56321) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJZVC-0004o6-GJ for gcc-patches@gcc.gnu.org; Sun, 13 Oct 2019 04:45:23 -0400 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=NoDDABiC8TA38l8L6AItFrFNCiiQEfOh8hpF9pdt/G8=; b=faGH/hWd8dLdJ08u3YRkFWdQt/ WyE0afpP1haACBvkB+egJcb3foLyWp+peN5ovn0wVuxmvE1PAnciAlJOo2/+c5f2Z1SDDW+X5Sdan Zc+MWxF4AGVLqSv03A/mlNnLzatqIS302X7p+kgX7IZrPoGQvnNs7CADHXHHPb6DjVVhXUURx/f9j OnHOxqMRyT7LzxeyCDHdu8j3VB6DtVc36ih45L75+SeCTaIix4n2j8Oz3Gycfm6GSG4AAZwjL2aT/ KQ8V4JWYyYzbPwKlYBVqKcBGXMzg1Q3AtfceNVovmYkfZQW055L8arXGFWWjvGSr6YsBytaJI/T+p zQX+/o/Q==; Received: from [95.87.234.74] (port=45180 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iJZV3-00041Y-MQ; Sun, 13 Oct 2019 11:45:16 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH 4/5] PRU: Remove TARGET_HARD_REGNO_CALL_PART_CLOBBERED Date: Sun, 13 Oct 2019 11:44:53 +0300 Message-Id: <20191013084454.13878-5-dimitar@dinux.eu> In-Reply-To: <20191013084454.13878-1-dimitar@dinux.eu> References: <20191013084454.13878-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.174.156.11 X-IsSubscribed: yes 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: 2019-10-13 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 dabea2b59c8..d66b989eb2d 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 From patchwork Sun Oct 13 08:44:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1175823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510865-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jI9/+4jY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.b="rMhuyDEN"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46rZzc5bRMz9s7T for ; Sun, 13 Oct 2019 19:46:20 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=Geg Ld1j5zNLLBWgBfiF7ZcznU8y34JpwdArQKAWMiIjra3rwhfaKBWmvccSflWRupGi PBNMWTFhbsCqjKl11B3JWA4GCmcfebf1m3A74cjGjxbh2TgkSETgSYsSTdGxWjVx 7fOohOPqGNou0xFMXrlp/chLx4ZOGgSNu0kNdmlM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=YkOJG3Zq9 oh45rpDcO9n/KUGjSs=; b=jI9/+4jYvcHYtfShbxJ7XmijYGx2xrkRnIAKj8meG vy4iE4nXnOt3q9TLW8bOdUrG6E9j82eiqgSrN0gML+/GOfoRu+SOqGga5TIfYzqZ ZNEqVaCo5s8ywivjhZL/J9GmapmhxslUu+e4S4dzzPpDdhioP1YFon0q5EwL0tuP d4= Received: (qmail 130178 invoked by alias); 13 Oct 2019 08:45:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 129775 invoked by uid 89); 13 Oct 2019 08:45:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=H*r:sk:DHE_RSA, HContent-Transfer-Encoding:8bit X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2019 08:45:25 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJZVD-0004qi-4K for gcc-patches@gcc.gnu.org; Sun, 13 Oct 2019 04:45:24 -0400 Received: from server28.superhosting.bg ([217.174.156.11]:45299) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iJZVC-0004pE-Fw for gcc-patches@gcc.gnu.org; Sun, 13 Oct 2019 04:45:23 -0400 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=nZH15yW6UYGsHaoRmRhaFZ16IOaEKgT60C8ucV2F+ig=; b=rMhuyDENmb8YMqs4xVdUpQ+Rgm rEEq2wPQMraVBzl5wZJSnlrcy+woEew1MdeyWL20i8L5DAESl01ZCIsOSlUiyWaXjFEJxfehBVekl c2z028a5Bw7PqojhDcZQ+9BjDthuEgnKGD7M8Dk5yIFdX49aIwykyO4LvjdNXypR4QCuO9rOa57Iq FcnN4DmN2WxQaUeVkx6JT8Mc6UKL1c/9Ec9IfEq2K0eJERINR4VZyHpZ1fnvQ0nKkdIYy1VAIM4L9 vceuAKv+H3lpLqy66xPursb29etlAqSQXviVcOHIu2xo4VKn/bFJhvK12bg8bHOtxJpdUQj2+uSKv 86VlWVzA==; Received: from [95.87.234.74] (port=45180 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iJZV6-00041Y-2k; Sun, 13 Oct 2019 11:45:18 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [PATCH 5/5] Add pru to compare-all-tests Date: Sun, 13 Oct 2019 11:44:54 +0300 Message-Id: <20191013084454.13878-6-dimitar@dinux.eu> In-Reply-To: <20191013084454.13878-1-dimitar@dinux.eu> References: <20191013084454.13878-1-dimitar@dinux.eu> MIME-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.174.156.11 X-IsSubscribed: yes contrib/ChangeLog: 2019-10-13 Dimitar Dimitrov * compare-all-tests (all_targets): Add pru target. Signed-off-by: Dimitar Dimitrov --- contrib/compare-all-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/compare-all-tests b/contrib/compare-all-tests index 502cc64f522..6d0f29e052f 100644 --- a/contrib/compare-all-tests +++ b/contrib/compare-all-tests @@ -34,7 +34,7 @@ s390_opts='-m31 -m31/-mzarch -m64' sh_opts='-m3 -m3e -m4 -m4a -m4al -m4/-mieee -m1 -m1/-mno-cbranchdi -m2a -m2a/-mieee -m2e -m2e/-mieee' sparc_opts='-mcpu=v8/-m32 -mcpu=v9/-m32 -m64' -all_targets='alpha arm avr bfin cris fr30 frv h8300 ia64 iq2000 m32c m32r m68k mcore mips mmix mn10300 pa pdp11 ppc sh sparc v850 vax xstormy16 xtensa' # e500 +all_targets='alpha arm avr bfin cris fr30 frv h8300 ia64 iq2000 m32c m32r m68k mcore mips mmix mn10300 pa pdp11 ppc pru sh sparc v850 vax xstormy16 xtensa' # e500 test_one_file () {