public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Use std::swap instead of manually swapping
@ 2014-11-13  9:45 Kyrill Tkachov
  2014-11-27 16:59 ` Kyrill Tkachov
  0 siblings, 1 reply; 5+ messages in thread
From: Kyrill Tkachov @ 2014-11-13  9:45 UTC (permalink / raw)
  To: GCC Patches, Marcus Shawcroft, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

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  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead
     of manual swapping implementation.
     (aarch64_expand_vec_perm_const_1): Likewise.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: aarch64-swap.patch --]
[-- Type: text/x-patch; name=aarch64-swap.patch, Size: 1354 bytes --]

commit 20ce59f52c26f99ad3939597c5cd41a0cdc8a751
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Use std::swap instead of manually swapping
  2014-11-13  9:45 [PATCH][AArch64] Use std::swap instead of manually swapping Kyrill Tkachov
@ 2014-11-27 16:59 ` Kyrill Tkachov
  2014-12-05 16:40   ` Kyrill Tkachov
  0 siblings, 1 reply; 5+ messages in thread
From: Kyrill Tkachov @ 2014-11-27 16:59 UTC (permalink / raw)
  To: GCC Patches, Marcus Shawcroft, Richard Earnshaw

Ping.

Thanks,
Kyrill

On 13/11/14 09:42, Kyrill Tkachov wrote:
> 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  <kyrylo.tkachov@arm.com>
>
>       * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead
>       of manual swapping implementation.
>       (aarch64_expand_vec_perm_const_1): Likewise.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Use std::swap instead of manually swapping
  2014-11-27 16:59 ` Kyrill Tkachov
@ 2014-12-05 16:40   ` Kyrill Tkachov
  2014-12-12 11:36     ` Kyrill Tkachov
  0 siblings, 1 reply; 5+ messages in thread
From: Kyrill Tkachov @ 2014-12-05 16:40 UTC (permalink / raw)
  To: GCC Patches, Marcus Shawcroft, Richard Earnshaw

Ping.

https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01426.html

Thanks,
Kyrill

On 27/11/14 15:37, Kyrill Tkachov wrote:
> Ping.
>
> Thanks,
> Kyrill
>
> On 13/11/14 09:42, Kyrill Tkachov wrote:
>> 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  <kyrylo.tkachov@arm.com>
>>
>>        * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead
>>        of manual swapping implementation.
>>        (aarch64_expand_vec_perm_const_1): Likewise.
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Use std::swap instead of manually swapping
  2014-12-05 16:40   ` Kyrill Tkachov
@ 2014-12-12 11:36     ` Kyrill Tkachov
  2014-12-12 21:18       ` Mike Stump
  0 siblings, 1 reply; 5+ messages in thread
From: Kyrill Tkachov @ 2014-12-12 11:36 UTC (permalink / raw)
  To: GCC Patches, Marcus Shawcroft, Richard Earnshaw

Ping.

Marcus: Uros pointed out to me that these kinds of changes are 
considered obvious
(with precedent athttps://gcc.gnu.org/ml/gcc-patches/2014-12/msg00309.html)
but did you have some concerns about backporting to other branches?

Kyrill

On 05/12/14 16:40, Kyrill Tkachov wrote:
> Ping.
>
> https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01426.html
>
> Thanks,
> Kyrill
>
> On 27/11/14 15:37, Kyrill Tkachov wrote:
>> Ping.
>>
>> Thanks,
>> Kyrill
>>
>> On 13/11/14 09:42, Kyrill Tkachov wrote:
>>> 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  <kyrylo.tkachov@arm.com>
>>>
>>>         * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead
>>>         of manual swapping implementation.
>>>         (aarch64_expand_vec_perm_const_1): Likewise.
>>
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][AArch64] Use std::swap instead of manually swapping
  2014-12-12 11:36     ` Kyrill Tkachov
@ 2014-12-12 21:18       ` Mike Stump
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Stump @ 2014-12-12 21:18 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: GCC Patches, Marcus Shawcroft, Richard Earnshaw

On Dec 12, 2014, at 3:36 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Marcus: Uros pointed out to me that these kinds of changes are considered obvious
> (with precedent athttps://gcc.gnu.org/ml/gcc-patches/2014-12/msg00309.html)
> but did you have some concerns about backporting to other branches?

So in general, there is no need to back port this to a previous release branch.  Unless it fixed a compelling bug in that release branch, or was possibly incidental to some other fix that did, it should not be back ported.  A private vendor release branch or a personal branch, well, they can do what they want on it, the owner would have to weigh in.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-12 21:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-13  9:45 [PATCH][AArch64] Use std::swap instead of manually swapping Kyrill Tkachov
2014-11-27 16:59 ` Kyrill Tkachov
2014-12-05 16:40   ` Kyrill Tkachov
2014-12-12 11:36     ` Kyrill Tkachov
2014-12-12 21:18       ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).