Hi Jakub,
On Sat, Jan 11, 2020 at 05:30:52PM +0100, Jakub Jelinek wrote:
> On Sat, Jan 11, 2020 at 05:24:19PM +0100, Andreas Schwab wrote:
> > ../../gcc/tree-ssa-forwprop.c: In function 'bool
> > simplify_count_trailing_zeroes(gimple_stmt_iterator*)':
> > ../../gcc/tree-ssa-forwprop.c:1925:23: er
On Mon, 13 Jan 2020, Jakub Jelinek wrote:
> On Sat, Jan 11, 2020 at 05:30:52PM +0100, Jakub Jelinek wrote:
> > On Sat, Jan 11, 2020 at 05:24:19PM +0100, Andreas Schwab wrote:
> > > ../../gcc/tree-ssa-forwprop.c: In function 'bool
> > > simplify_count_trailing_zeroes(gimple_stmt_iterator*)':
> > >
On Sat, Jan 11, 2020 at 05:30:52PM +0100, Jakub Jelinek wrote:
> On Sat, Jan 11, 2020 at 05:24:19PM +0100, Andreas Schwab wrote:
> > ../../gcc/tree-ssa-forwprop.c: In function 'bool
> > simplify_count_trailing_zeroes(gimple_stmt_iterator*)':
> > ../../gcc/tree-ssa-forwprop.c:1925:23: error: variab
Hi!
On Fri, Jan 10, 2020 at 10:35:04PM +0100, Jakub Jelinek wrote:
> On Thu, Jan 09, 2020 at 02:26:10PM +0100, Richard Biener wrote:
> > > >> + tree lhs = gimple_assign_lhs (stmt);
> > > >> + bool zero_ok = CTZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (type),
> > > >> val);
> > > >
> > > > sinc
On Sat, Jan 11, 2020 at 05:24:19PM +0100, Andreas Schwab wrote:
> ../../gcc/tree-ssa-forwprop.c: In function 'bool
> simplify_count_trailing_zeroes(gimple_stmt_iterator*)':
> ../../gcc/tree-ssa-forwprop.c:1925:23: error: variable 'mode' set but not
> used [-Werror=unused-but-set-variable]
> 1925
../../gcc/tree-ssa-forwprop.c: In function 'bool
simplify_count_trailing_zeroes(gimple_stmt_iterator*)':
../../gcc/tree-ssa-forwprop.c:1925:23: error: variable 'mode' set but not used
[-Werror=unused-but-set-variable]
1925 | scalar_int_mode mode = SCALAR_INT_TYPE_MODE (type);
|
On Thu, Jan 09, 2020 at 02:26:10PM +0100, Richard Biener wrote:
> > >> + tree lhs = gimple_assign_lhs (stmt);
> > >> + bool zero_ok = CTZ_DEFINED_VALUE_AT_ZERO (TYPE_MODE (type), val);
> > >
> > > since we're using the optab entry shouldn't you check for == 2 here?
> >
> > Yes, that looks
On Thu, Jan 09, 2020 at 02:26:10PM +0100, Richard Biener wrote:
> > 2019-12-11 Wilco Dijkstra
> >
> > PR tree-optimization/90838
> > * tree-ssa-forwprop.c (check_ctz_array): Add new function.
> > (check_ctz_string): Likewise.
> > (optimize_count_trailing_zeroes):
On Wed, Dec 11, 2019 at 5:55 PM Wilco Dijkstra wrote:
>
> Hi Richard,
>
> >> +(match (ctz_table_index @1 @2 @3)
> >> + (rshift (mult (bit_and (negate @1) @1) INTEGER_CST@2) INTEGER_CST@3))
> >
> > You need a :c on the bit_and
>
> Fixed.
>
> > + unsigned HOST_WIDE_INT val = tree_to_uhwi (mulc);
>
Hi Richard,
>> +(match (ctz_table_index @1 @2 @3)
>> + (rshift (mult (bit_and (negate @1) @1) INTEGER_CST@2) INTEGER_CST@3))
>
> You need a :c on the bit_and
Fixed.
> + unsigned HOST_WIDE_INT val = tree_to_uhwi (mulc);
> + unsigned shiftval = tree_to_uhwi (tshift);
> + unsigned input_bits =
On Fri, Nov 15, 2019 at 4:24 PM Wilco Dijkstra wrote:
>
> Hi Richard,
>
> > Uh. Well. I think that the gimple-match-head.c hunk isn't something we
> > want. Instead,
> > since this optimizes a memory access, the handling should move
> > to tree-ssa-forwprop.c where you _may_ use a (match ...)
ping
Hi Richard,
> Uh. Well. I think that the gimple-match-head.c hunk isn't something we
> want. Instead,
> since this optimizes a memory access, the handling should move
> to tree-ssa-forwprop.c where you _may_ use a (match ...)
> match.pd pattern to do the (rshift (mult (bit_and (negate @1
Hi Richard,
> Uh. Well. I think that the gimple-match-head.c hunk isn't something we
> want. Instead,
> since this optimizes a memory access, the handling should move
> to tree-ssa-forwprop.c where you _may_ use a (match ...)
> match.pd pattern to do the (rshift (mult (bit_and (negate @1) @1)
On Tue, Nov 12, 2019 at 3:36 PM Wilco Dijkstra wrote:
>
> Hi,
>
> Support common idioms for count trailing zeroes using an array lookup.
> The canonical form is array[((x & -x) * C) >> SHIFT] where C is a magic
> constant which when multiplied by a power of 2 contains a unique value
> in the top 5
Hi Segher,
> Out of interest, what uses this? I have never seen it before.
It's used in sjeng in SPEC and gives a 2% speedup on Cortex-A57.
Tricks like this used to be very common 20 years ago since a loop or binary
search
is way too slow and few CPUs supported fast clz/ctz instructions. It's o
Hi!
On Tue, Nov 12, 2019 at 02:35:54PM +, Wilco Dijkstra wrote:
> Support common idioms for count trailing zeroes using an array lookup.
> The canonical form is array[((x & -x) * C) >> SHIFT] where C is a magic
> constant which when multiplied by a power of 2 contains a unique value
> in the t
16 matches
Mail list logo