This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: move a * (1 << b) -> a << b pattern from fold-const.c to match.pd


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)))

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.

(I think it is the first pattern using @letter and not @number)

--
Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]