On Thu, 9 Jul 2015, Marek Polacek wrote: > On Tue, Jul 07, 2015 at 07:47:50AM +0200, Marc Glisse wrote: > > On Tue, 7 Jul 2015, Prathamesh Kulkarni wrote: > > > > >+/* a * (1 << b) -> a << b */ > > >+(simplify > > >+ (mult:c @a (lshift integer_onep @b)) > > >+ (if (!FLOAT_TYPE_P (type)) > > >+ (lshift @a @b))) > > Just a nit: the last line is wrongly formatted. > > > The test FLOAT_TYPE_P seems unnecessary, 'type' is (up to a useless > > conversion) the result of a shift, so integer, fixed-point or vector. Its > > lhs is integer_onep, which rules out fixed-point. > > Right. > > > (I think it is the first pattern using @letter and not @number) > > Yea, I think we should be consistent and use @0 and @1 here.
I've added support for non-digit names to allow more descriptive patterns. Like when we have /* Fold (X << C1) & C2 into (X << C1) & (C2 | ((1 << C1) - 1)) (X >> C1) & C2 into (X >> C1) & (C2 | ~((type) -1 >> C1)) if the new mask might be further optimized. */ (for shift (lshift rshift) (simplify (bit_and (convert?@4 (shift@5 (convert1?@3 @0) INTEGER_CST@1)) INTEGER_CST@2) using @andop2 instead of @2 and @shift instead of @5 (etc.) might make the following code easier to follow. That everything uses digits right now is historic mostly (and my habit of using digits just because I got used to it). But yes, with @a, @b vs. @0, @1 we should standardize on something (digits). Richard.