This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fold-const.c: Fold (A & ~3) - (A & 3) into (A ^ 3) - 3.
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: kazu at cs dot umass dot edu
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Sep 03 08:48:36 EDT
- Subject: 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.