This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [patch] fold-const.c: Fold (A & ~3) - (A & 3) into (A ^ 3) - 3.


    By the marked step, do you mean a step from (2) to (3)?  

No.

    Isn't it always true that ~B + 1 = -B for any B?

Yes.

    For a step from (1) to (2), 

That's the one.

    a bit-wise truth table suffices because (~A&B)+~B generates no carry
    in any bit.

I see.  OK, you've convinced me.


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