From patchwork Mon Oct 7 20:35:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jozef Lawrynowicz X-Patchwork-Id: 1172958 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-510423-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mittosystems.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="KdB1KGqx"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mittosystems.com header.i=@mittosystems.com header.b="jLhdzFbp"; 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 46nC0Z3kJLz9sP7 for ; Tue, 8 Oct 2019 07:35:24 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=JEhOe5IUBxwwH0GvcV6JMUyYcYy4/3DAQR4LGqxCbJZ5bGqnYwFRz lq0VXycgDb+FSGmDLJwbLK95GBDKQQN6GYnhhicm7VKjWQ7hAmyxyOTO8shwUDHo KHYxw/i58paCAJaJ2vvhxKqeJao2A8ZnK99x8q0MQWG4419G09fIco= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=J+S0peJJ8r80ie0+4IhTfxEO8Io=; b=KdB1KGqxwcyV/SP7pUAD TR+mUjDKxxc8Pe7U2vxqKosWt0NoakCC+WA1jGv9Mlt/qPuIai8+TUadyUvS0x6N vjfeFVSSA0f/7MYLOpTw9nSMDDDHNleg7dV/1QZ/RzWSh2fOF+tB3+W4eMgNoPBo pYw9Wsk5WSR0d2eFKzB5TBM= Received: (qmail 57847 invoked by alias); 7 Oct 2019 20:35:17 -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 57836 invoked by uid 89); 7 Oct 2019 20:35:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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=HX-Languages-Length:4434 X-HELO: mail-wm1-f46.google.com Received: from mail-wm1-f46.google.com (HELO mail-wm1-f46.google.com) (209.85.128.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 20:35:15 +0000 Received: by mail-wm1-f46.google.com with SMTP id a6so817835wma.5 for ; Mon, 07 Oct 2019 13:35:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mittosystems.com; s=google; h=date:from:to:subject:message-id:mime-version; bh=DAGRb/BuuYRjNebDLn8dkpdvGWGRePfKHnSgafgFeBA=; b=jLhdzFbpEjR7MOGsCwyGg42lQUye7Sy8gTJHcnf4pN+BZ0VCfPdyg+NKS/CTsUWNvs 1icefsc2ihUphNoHcCIzEB8C0A74MUtDIV2uWclI3tMcv1bSIDyWb2w8e1Up2ZGZCaU7 FRODkFSW6BSuARkymavqeASQrSz8L9bze+CNjU/R4qKOGBDHcrDv5a4hHKYoFtR0M0Gu /0keyMMlBbMRFva4a3egwBvK1LWmsa762QFHlXcH0+JLQIMuprlMdvIiU8bo9ds5egAI yPiaVQKKPTo/Xor0VRQl9OPZZww7d+6Csl4MTCb7rStIruK5NzxtNro0Zeglop6VRTQY xU2g== Received: from jozef-kubuntu ([2a01:4b00:87fd:900:906b:6db5:b3f5:8817]) by smtp.gmail.com with ESMTPSA id g3sm33087425wro.14.2019.10.07.13.35.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Oct 2019 13:35:12 -0700 (PDT) Date: Mon, 7 Oct 2019 21:35:11 +0100 From: Jozef Lawrynowicz To: "gcc-patches@gcc.gnu.org" Subject: [COMMITTED][MSP430] Move C code for addsi define_split to its own function Message-ID: <20191007213511.5c5b817f@jozef-kubuntu> MIME-Version: 1.0 X-IsSubscribed: yes In preparation for upcoming changes to the addsi splitter, the attached patch puts C code to perform the splitting in its own function. Regtested on trunk. Committed as obvious. From 41e73d742fda612b0978cf84ae8732b430c4ef5a Mon Sep 17 00:00:00 2001 From: jozefl Date: Mon, 7 Oct 2019 20:05:30 +0000 Subject: [PATCH] 2019-10-07 Jozef Lawrynowicz * config/msp430/msp430-protos.h (msp430_split_addsi): New prototype. * config/msp430/msp430.c (msp430_split_addsi): New. * config/msp430/msp430.md: Call msp430_split_addsi () instead of using a block of C code for splitting addsi. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276670 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/config/msp430/msp430-protos.h | 1 + gcc/config/msp430/msp430.c | 23 +++++++++++++++++++++++ gcc/config/msp430/msp430.md | 20 +++----------------- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bbdce86a0f8..91ebb5a114c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-10-07 Jozef Lawrynowicz + + * config/msp430/msp430-protos.h (msp430_split_addsi): New prototype. + * config/msp430/msp430.c (msp430_split_addsi): New. + * config/msp430/msp430.md: Call msp430_split_addsi () instead of using + a block of C code for splitting addsi. + 2019-10-07 Uroš Bizjak * config/i386/i386-expand.c (ix86_expand_floorceildf_32, diff --git a/gcc/config/msp430/msp430-protos.h b/gcc/config/msp430/msp430-protos.h index 1c1757fc7ab..37ca48297ac 100644 --- a/gcc/config/msp430/msp430-protos.h +++ b/gcc/config/msp430/msp430-protos.h @@ -44,6 +44,7 @@ void msp430_output_labelref (FILE *, const char *); void msp430_register_pragmas (void); rtx msp430_return_addr_rtx (int); void msp430_split_movsi (rtx *); +int msp430_split_addsi (rtx *); void msp430_start_function (FILE *, const char *, tree); rtx msp430_subreg (machine_mode, rtx, machine_mode, int); bool msp430_use_f5_series_hwmult (void); diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c index 354b4ddb419..add19bdb97c 100644 --- a/gcc/config/msp430/msp430.c +++ b/gcc/config/msp430/msp430.c @@ -2841,6 +2841,29 @@ msp430_subreg (machine_mode mode, rtx r, machine_mode omode, int byte) return rv; } +int +msp430_split_addsi (rtx *operands) +{ + operands[3] = msp430_subreg (HImode, operands[0], SImode, 0); + operands[4] = msp430_subreg (HImode, operands[1], SImode, 0); + operands[5] = msp430_subreg (HImode, operands[2], SImode, 0); + operands[6] = msp430_subreg (HImode, operands[0], SImode, 2); + operands[7] = msp430_subreg (HImode, operands[1], SImode, 2); + operands[8] = msp430_subreg (HImode, operands[2], SImode, 2); + + /* BZ 64160: Do not use this splitter when the dest partially overlaps the + source. */ + if (reg_overlap_mentioned_p (operands[3], operands[7]) + || reg_overlap_mentioned_p (operands[3], operands[8])) + return 1; + + if (GET_CODE (operands[5]) == CONST_INT) + operands[9] = GEN_INT (INTVAL (operands[5]) & 0xffff); + else + operands[9] = gen_rtx_ZERO_EXTEND (SImode, operands[5]); + return 0; +} + /* Called by movsi_x to generate the HImode operands. */ void msp430_split_movsi (rtx *operands) diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md index c72f7aade30..e1c61f5ea3d 100644 --- a/gcc/config/msp430/msp430.md +++ b/gcc/config/msp430/msp430.md @@ -423,23 +423,9 @@ (zero_extend:HI (reg:BI CARRY)))) ] " - operands[3] = msp430_subreg (HImode, operands[0], SImode, 0); - operands[4] = msp430_subreg (HImode, operands[1], SImode, 0); - operands[5] = msp430_subreg (HImode, operands[2], SImode, 0); - operands[6] = msp430_subreg (HImode, operands[0], SImode, 2); - operands[7] = msp430_subreg (HImode, operands[1], SImode, 2); - operands[8] = msp430_subreg (HImode, operands[2], SImode, 2); - - /* BZ 64160: Do not use this splitter when the dest partially overlaps the source. */ - if (reg_overlap_mentioned_p (operands[3], operands[7]) - || reg_overlap_mentioned_p (operands[3], operands[8])) - FAIL; - - if (GET_CODE (operands[5]) == CONST_INT) - operands[9] = GEN_INT (INTVAL (operands[5]) & 0xffff); - else - operands[9] = gen_rtx_ZERO_EXTEND (SImode, operands[5]); - " + if (msp430_split_addsi (operands)) + FAIL; + " ) -- 2.17.1