Re: [PATCH 4/4] match.pd: Add x + ((-x) m) - (x + m) ~m pattern

2015-04-30 Thread Richard Biener
On Wed, Jan 21, 2015 at 11:49 AM, Rasmus Villemoes r...@rasmusvillemoes.dk wrote: Generalizing the x+(x1) pattern, one can round up x to a multiple of a 2^k by adding the negative of x modulo 2^k. But it is fewer instructions, and presumably requires fewer registers, to do the more common

Re: [PATCH 4/4] match.pd: Add x + ((-x) m) - (x + m) ~m pattern

2015-04-30 Thread Marc Glisse
On Thu, 30 Apr 2015, Richard Biener wrote: On Wed, Jan 21, 2015 at 11:49 AM, Rasmus Villemoes r...@rasmusvillemoes.dk wrote: Generalizing the x+(x1) pattern, one can round up x to a multiple of a 2^k by adding the negative of x modulo 2^k. But it is fewer instructions, and presumably requires

Re: [PATCH 4/4] match.pd: Add x + ((-x) m) - (x + m) ~m pattern

2015-04-30 Thread Richard Biener
On Thu, Apr 30, 2015 at 1:44 PM, Marc Glisse marc.gli...@inria.fr wrote: On Thu, 30 Apr 2015, Richard Biener wrote: On Wed, Jan 21, 2015 at 11:49 AM, Rasmus Villemoes r...@rasmusvillemoes.dk wrote: Generalizing the x+(x1) pattern, one can round up x to a multiple of a 2^k by adding the

[PATCH 4/4] match.pd: Add x + ((-x) m) - (x + m) ~m pattern

2015-01-21 Thread Rasmus Villemoes
Generalizing the x+(x1) pattern, one can round up x to a multiple of a 2^k by adding the negative of x modulo 2^k. But it is fewer instructions, and presumably requires fewer registers, to do the more common (x+m)~m where m=2^k-1. Signed-off-by: Rasmus Villemoes r...@rasmusvillemoes.dk ---