-
- Downloads
Try to simplify (X >> C1) * (C2 << C1) -> X * C2
This patch adds a rule to simplify (X >> C1) * (C2 << C1) -> X * C2 when the low C1 bits of X are known to be zero. As with the earlier X >> C1 << (C2 + C1) patch, any single conversion is allowed between the shift and the multiplication. gcc/ * match.pd: Simplify (X >> C1) * (C2 << C1) -> X * C2 if the low C1 bits of X are zero. gcc/testsuite/ * gcc.dg/tree-ssa/shifts-3.c: New test. * gcc.dg/tree-ssa/shifts-4.c: Likewise. * gcc.target/aarch64/sve/cnt_fold_5.c: Likewise.
Showing
- gcc/match.pd 13 additions, 0 deletionsgcc/match.pd
- gcc/testsuite/gcc.dg/tree-ssa/shifts-3.c 65 additions, 0 deletionsgcc/testsuite/gcc.dg/tree-ssa/shifts-3.c
- gcc/testsuite/gcc.dg/tree-ssa/shifts-4.c 23 additions, 0 deletionsgcc/testsuite/gcc.dg/tree-ssa/shifts-4.c
- gcc/testsuite/gcc.target/aarch64/sve/cnt_fold_5.c 38 additions, 0 deletionsgcc/testsuite/gcc.target/aarch64/sve/cnt_fold_5.c
Loading
Please register or sign in to comment