From patchwork Fri Jun 19 10:50:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 486661 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 F06E81401DE for ; Fri, 19 Jun 2015 20:51:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=xjTMkf7I; dkim-atps=neutral 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=W/Nmck8M/x5YLe8qT5KZ4ucon14HxSjvPIv8FPnG8NebbF 23uNNwl5Qug2c+Vuu4lPv0MspaaQh9UX+/a2bd3+OAbcRi0vEWbiGWOwaf3cOyYk bHxG8UQCBZk3jxxwo1DjLXRArvUUoUKHQKJ3K/DSRuAn/73acWPOvQxWwQj80= 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=0cz6IjHejktOLg1DhxFi5lLYGPI=; b=xjTMkf7IQiqpZLUi2aQf candL8a+vPqso7RUM5QQdcNeoqitZWlGp/lLFgGk76FMjh4nmDLdtq9aF2NeXIkV Et0qowC6/IB7C1PESQ6xrThMWWeWVH7ydRIdt1uSrMwv1PgJqhCI7kZIOM/va4Ut diXOzZi77NBnBGGVhIL8JPc= Received: (qmail 6877 invoked by alias); 19 Jun 2015 10:51:03 -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 6865 invoked by uid 89); 19 Jun 2015 10:51:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jun 2015 10:51:00 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-23-9rDCF7U9QiOCRV-7b7IQyQ-1 Received: from [10.2.207.50] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 19 Jun 2015 11:50:57 +0100 Message-ID: <5583F411.8000909@arm.com> Date: Fri, 19 Jun 2015 11:50:57 +0100 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 Subject: [PATCH][i386][obvious] Use std::swap instead of manually swapping in a couple of places X-MC-Unique: 9rDCF7U9QiOCRV-7b7IQyQ-1 X-IsSubscribed: yes Hi all, Bootstrapped and tested on x86_64-linx. Will commit shortly as obvious. Thanks, Kyrill 2015-06-19 Kyrylo Tkachov * config/i386/i386.c (ix86_function_versions): Use std::swap instead of manually swapping. (expand_vec_perm_interleave2): Likewise. commit c4e17657d5557ec58e910b9cdecdda85f9bb196a Author: Kyrylo Tkachov Date: Fri Jun 19 10:45:52 2015 +0100 [i386] Use std::swap instead of manually swapping in a couple of places diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 622c5f5..4cb8fe8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -34903,9 +34903,7 @@ ix86_function_versions (tree fn1, tree fn2) { if (attr2 != NULL_TREE) { - tree tem = fn1; - fn1 = fn2; - fn2 = tem; + std::swap (fn1, fn2); attr1 = attr2; } error_at (DECL_SOURCE_LOCATION (fn2), @@ -47911,9 +47909,7 @@ expand_vec_perm_interleave2 (struct expand_vec_perm_d *d) { /* Attempt to increase the likelihood that dfinal shuffle will be intra-lane. */ - char tmph = nonzero_halves[0]; - nonzero_halves[0] = nonzero_halves[1]; - nonzero_halves[1] = tmph; + std::swap (nonzero_halves[0], nonzero_halves[1]); } /* vperm2f128 or vperm2i128. */