combine_simplify_rtx (doesn't) commute XOR and ASHIFTRT ???

Jeff Law law@redhat.com
Tue Jun 24 17:28:00 GMT 2014


On 06/24/14 07:42, Alan Lawrence wrote:
> I'm looking at git commit ea1ac559 / svn r76965, January 2014 (archive:
> https://gcc.gnu.org/ml/gcc-patches/2004-01/msg03406.html), which prevents
>
> (ashiftrt (xor A C1) C2)
>
> from being commuted to
>
> (xor (ashiftrt A C2) (ashiftrt C1 C2))
>
> and wondering if anyone can explain to me what's wrong with this
> transformation. Having worked through all four cases of A and C1
> positive and negative, it seems to me that the extra bits 'fed in' to
> the most-significant end of the result are the same either way (i.e. the
> XOR of the sign bits of A and C1).
>
> Re-enabling this transformation improves rtx simplification and codegen on
> AArch64, for one.
>
> (I don't have easy access to Alpha/VMS machine on which to test Ada
> s-crc32.adb.)
You might be able to set up a cross compiler to see if/how this changes 
the generated code.

Probably best to start with a compiler from that era since lots of stuff 
may have changed and effectively hidden the issue Kenner was trying to 
deal with.

I haven't heard from Kenner in a while, but you could always try to 
contact him directly and see if he can recall the issue.  It was a long 
time ago though...

jeff



More information about the Gcc mailing list