Re: [PATCH] Small optimization for emit_case_bit_tests (PR tree-optimization/63464)

2014-10-10 Thread Richard Biener
On Fri, 10 Oct 2014, Jakub Jelinek wrote: > On Fri, Oct 10, 2014 at 12:55:21PM +0200, Richard Biener wrote: > > On Fri, 10 Oct 2014, Jakub Jelinek wrote: > > > This patch adds a small optimization to emit_case_bit_tests, > > > instead of emitting (for high, low, mask all constants) > > > (x - low)

Re: [PATCH] Small optimization for emit_case_bit_tests (PR tree-optimization/63464)

2014-10-10 Thread Jakub Jelinek
On Fri, Oct 10, 2014 at 12:55:21PM +0200, Richard Biener wrote: > On Fri, 10 Oct 2014, Jakub Jelinek wrote: > > This patch adds a small optimization to emit_case_bit_tests, > > instead of emitting (for high, low, mask all constants) > > (x - low) <= (high - low) && ((1 << (x - low)) & mask) > > if

Re: [PATCH] Small optimization for emit_case_bit_tests (PR tree-optimization/63464)

2014-10-10 Thread Richard Biener
On Fri, 10 Oct 2014, Jakub Jelinek wrote: > Hi! > > This patch adds a small optimization to emit_case_bit_tests, > instead of emitting (for high, low, mask all constants) > (x - low) <= (high - low) && ((1 << (x - low)) & mask) > if high is smaller than BITS_PER_WORD and low > 0 we can emit > x <

[PATCH] Small optimization for emit_case_bit_tests (PR tree-optimization/63464)

2014-10-10 Thread Jakub Jelinek
Hi! This patch adds a small optimization to emit_case_bit_tests, instead of emitting (for high, low, mask all constants) (x - low) <= (high - low) && ((1 << (x - low)) & mask) if high is smaller than BITS_PER_WORD and low > 0 we can emit x <= high && ((1 << x) & (mask << low)) and avoid subtractio