public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Kai Tietz <ktietz70@googlemail.com>
Cc: Kai Tietz <ktietz@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [patch tree-ssa-math-opts]: Improve bswap detection
Date: Mon, 27 Jun 2011 10:16:00 -0000	[thread overview]
Message-ID: <BANLkTinkqwahiP0K_ynF8b9vLbp7sH=VQw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimkd9-8xiqQT5fBGoo7-vKUnEk0rg@mail.gmail.com>

On Mon, Jun 27, 2011 at 11:50 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2011/6/27 Richard Guenther <richard.guenther@gmail.com>:
>> On Mon, Jun 27, 2011 at 10:06 AM, Kai Tietz <ktietz@redhat.com> wrote:
>>> Hello,
>>>
>>> this patch improves the bswap (32/64) detection and fixes an issue about shifted bit values out of type-size precision.
>>>
>>> ChangeLog
>>>
>>> 2011-06-27  Kai Tietz  <ktietz@redhat.com>
>>>
>>>        * tree-ssa-math-opts.c (do_shift_rotate): Zero bits
>>>        out of type precision after operation.
>>>        (find_bswap): Take for limit value the integer auto-
>>>        promotion into account.
>>>
>>> ChangeLog
>>>
>>> 2011-06-27  Kai Tietz  <ktietz@redhat.com>
>>>
>>>        * gcc.dg/optimize-bswapdi-2.c: New test.
>>>
>>> Bootstrapped and regression tested for x86_64-pc-linux-gnu. Ok for apply?
>>
>> The do_shift_rotate hunk is ok.  Where did you get the testcase from?
>> I can easily construct testcases that go via an intermediate SImode step
>> and the still won't be recongized.  Thus, is the testcase practically
>> relevant?  If so we should add 1 + log2 (byte-size) instead of 3 to also
>> cover the SImode -> HImode intermediate case.
>>
>> Thanks,
>> Richard.
>
> Ok, I can adjust it to use here 1 + 3 (for byte-size covering the
> SImode -> HImode intermediate case).  I was seen a regression for
> bswap detection by doing in forward-propagate a type-sinking on (type)
> X op (type) Y (for X and Y with compatible type), and (type) X op CST
> (for ((type) (type-x) CST) == CST case.  I will sent soon a patch for
> this optimization related thing. By this I detected that bswap
> algorithm didn't zero'ed upper bits out of size-range.
>
> Ok with that change?

Ok with using 1 + ceil_log2 (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (...))),
CSE that TREE_INT_CST_LOW.

Thanks,
Richard.

> Regards,
> Kai
>

      reply	other threads:[~2011-06-27 10:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1518076949.779173.1309161963786.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com>
2011-06-27  8:50 ` Kai Tietz
2011-06-27 10:08   ` Richard Guenther
2011-06-27 10:13     ` Kai Tietz
2011-06-27 10:16       ` Richard Guenther [this message]

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='BANLkTinkqwahiP0K_ynF8b9vLbp7sH=VQw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ktietz70@googlemail.com \
    --cc=ktietz@redhat.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).