This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: pr26026: udiv and umod optimization
- From: Falk Hueffner <falk at debian dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Mar 2006 08:42:12 +0100
- Subject: Re: pr26026: udiv and umod optimization
- References: <20060203122932.GB15321@bubble.grove.modra.org> <17379.30955.436649.904253@zapata.pink> <43E3835F.2090205@lu.unisi.ch> <20060205023311.GJ15321@bubble.grove.modra.org> <1139250389.3012.9.camel@localhost.localdomain> <20060209111511.GA18809@bubble.grove.modra.org> <1139499321.2874.110.camel@localhost.localdomain> <20060211055331.GD18809@bubble.grove.modra.org> <1142294192.22105.19.camel@localhost.localdomain> <20060324005314.GA16236@bubble.grove.modra.org>
Alan Modra <amodra@bigpond.net.au> writes:
> @@ -9121,8 +9121,27 @@ fold_binary (enum tree_code code, tree t
> return NULL_TREE;
>
> case TRUNC_DIV_EXPR:
> - case ROUND_DIV_EXPR:
> case FLOOR_DIV_EXPR:
> + /* Simplify A / (B << N) where A and B are positive and B is
> + a power of 2, to A >> (N + log2(B)). */
[...]
> + /* Fall thru */
> +
> + case ROUND_DIV_EXPR:
> case CEIL_DIV_EXPR:
> case EXACT_DIV_EXPR:
> if (integer_onep (arg1))
Shouldn't this optimization also be applicable to EXACT_DIV_EXPR?
--
Falk