+/* Optimize (x >> c) << c into x & (-1<<c).  */
+(simplify
+ (lshift (rshift @0 INTEGER_CST@1) @1)
+ (if (tree_fits_uhwi_p (@1)
+      && tree_to_uhwi (@1) < TYPE_PRECISION (type))
+  (bit_and @0 (lshift { build_minus_one_cst (type); } @1))))

It looks like vectors might match, so please use element_precision instead of TYPE_PRECISION, as in the fold-const.c code you are converting from.

--
Marc Glisse

Reply via email to