"xordi3" pattern in arm.md

Philip Blundell philb@gnu.org
Wed May 16 02:58:00 GMT 2001


>> void g (unsigned long long);
>> f(unsigned long long l)
>> { g(l ^ 0x1000000010000000ULL); }
>
>Right, but that constant is somewhat unusual in that both halves of it are 
>valid immediate ARM constants.

Yeah.  Though actually, a particular case of this (one half zero, the other half 
some other valid constant) does seem to crop up quite often - inverting just 
one bit, for example.

>Without it, I suspect that we would miss the optimization altogether. 

Right.  I tried it without and got:

x:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, current_function_anonymous_args = 0
        @ link register save eliminated.
        str     r4, [sp, #-4]!
        mov     r4, #0
        mov     r3, #1
        mvn     r0, r0
        adds    r0, r0, r3
        mvn     r1, r1
        adc     r1, r1, r4
        ldmfd   sp!, {r4} 
        mov     pc, lr

p.





More information about the Gcc mailing list