From patchwork Tue Jul 17 11:24:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Shawcroft X-Patchwork-Id: 171395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 7711A2C01C6 for ; Tue, 17 Jul 2012 21:25:10 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343129110; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=uhcqg9w cjeckoRj0h5PRn2Wzobo=; b=CO1+y09YmaIEaAxukqyaVTvejy1JUItmyGncE8q PxccXJMPtg+8ZriUxgyv4LRWZ2gYx2H0ohJ39Ra+KQEGa5JSXcc0CWxjHWa4JXhD HXfE8doX6/LcnIL7DJOO8HdkxBTl4w3veIyBsKezxccxZiS1wENnKT9+YvSWIT1Y 6xUY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:X-MC-Unique:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tbcYN6yQRj6Hc9U0lWbsEEQxQ0+h8Q46++OAq7ytVq+OPymkiYC9mBopX59EGg V7cp2BMUzvbPto+93K8/jKpVcdrdCTbembPJOWlg15skjlIK5Yi9el2Tb7XKUwPB mqrVW4HasD6anKiXrPUKniU74KmkvvWAHOo9m7876Zplc=; Received: (qmail 32421 invoked by alias); 17 Jul 2012 11:25:06 -0000 Received: (qmail 32403 invoked by uid 22791); 17 Jul 2012 11:25:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, TW_MV X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 11:24:47 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 17 Jul 2012 12:24:45 +0100 Received: from [10.1.72.50] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Jul 2012 12:25:54 +0100 Message-ID: <50054B7A.2020507@arm.com> Date: Tue, 17 Jul 2012 12:24:42 +0100 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [aarch64] Omit lsl #0 on movi and movn X-MC-Unique: 112071712244502101 X-IsSubscribed: yes 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 I've committed this patch to the aarch64 branch to suppress the output of an lsl #0 suffix on movi and mvni instructions. Marcus Index: gcc/ChangeLog.aarch64 =================================================================== --- gcc/ChangeLog.aarch64 (revision 189570) +++ gcc/ChangeLog.aarch64 (working copy) @@ -1,3 +1,9 @@ +2012-07-17 Marcus Shawcroft + + * config/aarch64/aarch64-simd.md (*aarch64_simd_mov): + Do not emit lsl for a shift of 0. + (*aarch64_simd_mov): Likwise. + 2012-07-04 Tejas Belagod * config/aarch64/aarch64-linux.h (LINUX_TARGET_LINK_SPEC): Rename Index: gcc/config/aarch64/aarch64-simd.md =================================================================== --- gcc/config/aarch64/aarch64-simd.md (revision 189570) +++ gcc/config/aarch64/aarch64-simd.md (working copy) @@ -398,23 +398,26 @@ int width; static char templ[40]; int shift = 0, mvn = 0; + const char *mnemonic; + int length = 0; is_valid = aarch64_simd_immediate_valid_for_move (operands[1], mode, &operands[1], &width, &widthc, &mvn, &shift); gcc_assert (is_valid != 0); - if (mvn == 0) - { - if (widthc != 'd') - snprintf (templ, sizeof (templ), "movi\t%%0.%d%c, %%1, lsl %d ", - 64 / width, widthc, shift); - else - snprintf (templ, sizeof (templ), "movi\t%%d0, %%1"); - } + + mnemonic = mvn ? "mvni" : "movi"; + if (widthc != 'd') + length += snprintf (templ, sizeof (templ), + "%s\t%%0.%d%c, %%1", + mnemonic, 64 / width, widthc); else - snprintf (templ, sizeof (templ), "mvni\t%%0.%d%c, %%1, lsl %d", - 64 / width, widthc, shift); + length += snprintf (templ, sizeof (templ), "%s\t%%d0, %%1", mnemonic); + + if (shift != 0) + length += snprintf (templ + length, sizeof (templ) - length, + ", lsl %d", shift); return templ; } default: gcc_unreachable (); @@ -454,12 +457,14 @@ &operands[1], &width, &widthc, &mvn, &shift); gcc_assert (is_valid != 0); - if (mvn == 0) - snprintf (templ, sizeof (templ), "movi\t%%0.%d%c, %%1, lsl %d ", + if (shift) + snprintf (templ, sizeof (templ), "%s\t%%0.%d%c, %%1, lsl %d", + mvn ? "mvni" : "movi", 128 / width, widthc, shift); else - snprintf (templ, sizeof (templ), "mvni\t%%0.%d%c, %%1, lsl %d", - 128 / width, widthc, shift); + snprintf (templ, sizeof (templ), "%s\t%%0.%d%c, %%1", + mvn ? "mvni" : "movi", + 128 / width, widthc); return templ; } default: gcc_unreachable ();