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