From patchwork Thu Nov 13 09:42:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 410332 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0B4BD1400AB for ; Thu, 13 Nov 2014 20:42:52 +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 :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=BJIs8HKc8NMNDOGgA4Z0K/qPDMHwNtegDDyuNP+vE/KUt3 ihcMLvAaXkTsvB8UPM5CaxO6qBFPfx9awyPee9C0Cn5i759ELtFni4mXfUnRCzor dst76qUQGAGIsQy7in+uDCNKcywXMsvP7XEdCg54lWL/VEOCEPve2eqmSeF+o= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=L8Mot0GonnRxuprcvc+E0OateCg=; b=HpDEmvDCHb2JiBxpvtzy g3LlfvOvJ/c4xpkI+UdeZ7+OhIHGIZyyIOMSiMWUY0Z1FDMqetSec00Pak0evQFi Djg/mXT4PMITUEeURJIfhii2+84/JgpqhNwavYi4sSbAvMAqSY1h8xctlvvK2BVQ plA/jCU5xZLutblb/fi5VuI= Received: (qmail 17010 invoked by alias); 13 Nov 2014 09:42:34 -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 16870 invoked by uid 89); 13 Nov 2014 09:42:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Nov 2014 09:42:32 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 13 Nov 2014 09:42:30 +0000 Received: from [10.1.207.43] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 13 Nov 2014 09:42:27 +0000 Message-ID: <54647D03.10803@arm.com> Date: Thu, 13 Nov 2014 09:42:27 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches , Marcus Shawcroft , Richard Earnshaw Subject: [PATCH][AArch64] Use std::swap instead of manually swapping X-MC-Unique: 114111309423000301 X-IsSubscribed: yes Hi all, Following the trend in i386 and alpha, this patch uses std::swap to perform swapping of values in the aarch64 backend instead of declaring temporaries. Tested and bootstrapped on aarch64-linux. Ok for trunk? Thanks, Kyrill 2014-11-13 Kyrylo Tkachov * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead of manual swapping implementation. (aarch64_expand_vec_perm_const_1): Likewise. commit 20ce59f52c26f99ad3939597c5cd41a0cdc8a751 Author: Kyrylo Tkachov Date: Wed Nov 12 15:41:05 2014 +0000 [AArch64] Use std::swap diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index d1f5673..f92b23a 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -9428,9 +9428,7 @@ aarch64_evpc_ext (struct expand_vec_perm_d *d) /* After setup, we want the high elements of the first vector (stored at the LSB end of the register), and the low elements of the second vector (stored at the MSB end of the register). So swap. */ - rtx temp = d->op0; - d->op0 = d->op1; - d->op1 = temp; + std::swap (d->op0, d->op1); /* location != 0 (above), so safe to assume (nelt - location) < nelt. */ location = nelt - location; } @@ -9601,15 +9599,12 @@ aarch64_expand_vec_perm_const_1 (struct expand_vec_perm_d *d) if (d->perm[0] >= d->nelt) { unsigned i, nelt = d->nelt; - rtx x; gcc_assert (nelt == (nelt & -nelt)); for (i = 0; i < nelt; ++i) d->perm[i] ^= nelt; /* Keep the same index, but in the other vector. */ - x = d->op0; - d->op0 = d->op1; - d->op1 = x; + std::swap (d->op0, d->op1); } if (TARGET_SIMD)