This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Tue, 10 Nov 2015 22:04:30 +0100
- Subject: Re: [PATCH 1/2] simplify-rtx: Simplify trunc of and of shiftrt
- Authentication-results: sourceware.org; auth=none
- References: <1d3e9ff999e20e4eb13a5825ac084074bd05a397 dot 1447053652 dot git dot segher at kernel dot crashing dot org> <5641D1F9 dot 3090104 at redhat dot com> <20151110174411 dot GB23305 at gate dot crashing dot 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