This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: "xordi3" pattern in arm.md


>> 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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]