aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/shl-and0.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-22simplify ((x & M) << S) when (M << S) == 0Luc Van Oostenryck1-1/+0
The instructions SHL(AND(x, M), S) can be simplified to 0 if (M << S) == 0. For example code like: unsigned foo(unsigned x) { return (x & 0xfff00000) << 12; } is now simplified into: foo: ret.32 $0 Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-08-22add testcases for {LSR,SHL}(AND(x, M), S) with shared AND(x, M)Luc Van Oostenryck1-0/+14
The pattern LSR(AND(x, M), S) is already generically simplified into ((x >> S) & (M >> S)) but only if the sub-expression AND(x, M) is not shared with some other expressions because the simplification modify it. But for some special cases the expression can be simplified even if the sub-expression is shared because the simplification doesn't need to modify this AND(x, M) part. Add the testcases for LSR and the incoming SHL. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>