aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/sh-or-and0.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-22simplify SHL((x & M') | y, S)Luc Van Oostenryck1-1/+0
The same simplifications done for LSR can be done for SHL (with the appropriate mask). For example, code like: int foo(int a, int b) { return ((a & 0xfff00000) | b) << 12; } is now optimized into: foo: shl.32 %r5 <- %arg2, $12 ret.32 %r5 while previously it was: foo: and.32 %r2 <- %arg1, $0xfff00000 or.32 %r4 <- %r2, %arg2 shl.32 %r5 <- %r4, $12 ret.32 %r5 Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-08-22add testcases for bitfield & AND/OR simplificationLuc Van Oostenryck1-0/+21
The extraction & insertion of bitfields is made of relatively complex combinations of SHL/LSR/AND/OR and TRUNC/ZEXT/SEXT. Add a few testcases showing the effectiveness of their simplification and to catch possible future regressions. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>