public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bschmidt@redhat.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com
Subject: Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt
Date: Tue, 10 Nov 2015 21:04:00 -0000	[thread overview]
Message-ID: <56425BDE.9040604@redhat.com> (raw)
In-Reply-To: <20151110174411.GB23305@gate.crashing.org>

On 11/10/2015 06:44 PM, Segher Boessenkool wrote:

> Yes I know.  All the rest of the code around is it like this though.
> Do you want this written in a saner way?

I won't object to leaving it as-is for now, but in the future it would 
be good to keep this in mind.

>> I'm not entirely sure what the
>> last condition here is supposed to test.
>
> It tests whether moving the truncate inside will give the same result.
> It essentially looks if it works for an x with all bits set; if that
> works, it works for any x.

Yeah, I figured afterwards that must have been the purpose of the test 
but I was thinking of other constants because of the trunc_int_for_mode 
thing. (I probably would have written "(and_const >> shift_amount) & 
~small_mask == 0" but yours should be ok too). You might want to use 
your description as a comment.

>> ... the fact that here I think you'd have to trunc_int_for_mode the AND
>> amount for the smaller mode?
>
> Ugh yes, I still have to do that for it to be valid RTL in all cases.
> Thanks for catching it.

So FAOD the patch is OK with that change.


Bernd

  reply	other threads:[~2015-11-10 21:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  7:33 Segher Boessenkool
2015-11-09  7:33 ` [PATCH 2/2] rs6000: Extend 20050603-3.c testcase to 64-bit Segher Boessenkool
2015-11-09 16:22   ` David Edelsohn
2015-11-10 11:16 ` [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt Bernd Schmidt
2015-11-10 17:44   ` Segher Boessenkool
2015-11-10 21:04     ` Bernd Schmidt [this message]
2015-11-11 14:15       ` Segher Boessenkool
2015-11-13 10:03 Uros Bizjak
2015-11-13 14:36 ` Segher Boessenkool
2015-11-13 15:57   ` Uros Bizjak

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=56425BDE.9040604@redhat.com \
    --to=bschmidt@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /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).