aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/select-and-shift.c
AgeCommit message (Collapse)AuthorFilesLines
2020-11-27convert SEL(x & BIT1, BIT2, 0) into SHIFT(x & BIT1, S)Luc Van Oostenryck1-1/+0
Convert an expression like: (x & (1 << A)) ? (1 << B) : 0 into: (x & (1 << A)) << (B - A) or: (x & (1 << A)) >> (A - B) Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2020-11-27add testscases for 'bits translation' optimizationLuc Van Oostenryck1-0/+18
Add some testcase related to the simplification of expressions like: if (val1 & BIT1) val2 |= BIT2; into val2 |= (val1 & BIT1) {SHL/LSR} |BIT2-BIT1|; Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>