public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@linaro.org>
To: "Thomas Preud'homme" <thomas.preudhomme@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fix PR63266: Keep track of impact of sign extension in bswap
Date: Thu, 25 Sep 2014 14:08:00 -0000	[thread overview]
Message-ID: <CAKdteOaJc6qgWZXBa-wb3WSKKrASZP8CuKG8MzEP2MdQ+JR2ew@mail.gmail.com> (raw)
In-Reply-To: <002b01cfd88b$76644410$632ccc30$@arm.com>

On 25 September 2014 08:39, Thomas Preud'homme
<thomas.preudhomme@arm.com> wrote:
>> From: Christophe Lyon [mailto:christophe.lyon@linaro.org]
>> Sent: Thursday, September 25, 2014 4:28 AM
>
>>
>> Hi Thomas,
>
> Hi Christophe,
>
>>
>> Although I could notice the improvement:
>> Pass disappears           [PASS =>     ]:
>>   gcc.dg/optimize-bswapsi-1.c scan-tree-dump-times bswap "32 bit
>> bswap
>> implementation found at" 3
>> New pass                  [     => PASS]:
>>   gcc.dg/optimize-bswapsi-1.c scan-tree-dump-times bswap "32 bit
>> bswap
>> implementation found at" 4
>>
>> for arm-*, armeb-* and aarch64-* targets, there is no change for
>> aarch64_be: is this expected?
>
> No, but neither is this:
>
> @@ -1905,11 +1913,10 @@ find_bswap_or_nop_1 (gimple stmt, struct symbolic_number *n, int limit)
>
>             /* Sign extension: result is dependent on the value.  */
>             old_type_size = TYPE_PRECISION (n->type) / BITS_PER_UNIT;
> -           if (!TYPE_UNSIGNED (n->type)
> -               && type_size > old_type_size
> -               && n->n & ((uint64_t) 0xff << ((old_type_size - 1)
> -                                              * BITS_PER_MARKER)))
> -             return NULL;
> +           if (!TYPE_UNSIGNED (n->type) && type_size > old_type_size
> +               && HEAD_MARKER (n->n, old_type_size))
> +             for (i = 0; i < type_size - old_type_size; i++)
> +               n->n |= MARKER_BYTE_UNKNOWN << (type_size - 1 - i);
>
>             if (type_size < 64 / BITS_PER_MARKER)
>               {
>
> type_size - 1 - I gives a number of marker bytes to shift. I forgot to multiply by the number of bits in a marker. Can you do the change locally and tell me if the test now succeed for aarch64_be?
>

While attempting to try this, I noticed that more precisely the test
is currently UNSUPPORTED on aarch64_be,
which is because check_effective_target_bswap only accepts istarget aarch64-*-*.

I didn't try yet to change it into istarget aarch64*-*-*.


> Best regards,
>
> Thomas
>
>
>
>

  reply	other threads:[~2014-09-25 14:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 10:27 Thomas Preud'homme
2014-09-24  1:57 ` Thomas Preud'homme
2014-09-24  8:01 ` Richard Biener
2014-09-24 20:27   ` Christophe Lyon
2014-09-25  6:41     ` Thomas Preud'homme
2014-09-25 14:08       ` Christophe Lyon [this message]
2014-09-26  2:27         ` Thomas Preud'homme
2014-09-26 16:12           ` Christophe Lyon
2014-10-21  9:30   ` Thomas Preud'homme
2014-10-21 11:50     ` Richard Biener
2014-10-21 21:06     ` Christophe Lyon
2014-10-22  8:57       ` Thomas Preud'homme
2014-10-26 16:50         ` Christophe Lyon
2014-10-27 12:16           ` Thomas Preud'homme
2014-10-28 12:28     ` [PATCH] Fix up " Jakub Jelinek
2014-10-28 13:00       ` Richard Biener
2014-10-29  9:36       ` Thomas Preud'homme
2014-10-29  9:40         ` Thomas Preud'homme
2014-10-29  9:43           ` Jakub Jelinek
2014-10-29 10:37             ` Thomas Preud'homme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKdteOaJc6qgWZXBa-wb3WSKKrASZP8CuKG8MzEP2MdQ+JR2ew@mail.gmail.com \
    --to=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=thomas.preudhomme@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).