aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparse.1
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-18 18:43:38 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-08-22 09:26:18 +0200
commit729be196bb860270de32ec076873c6d327f592a0 (patch)
tree9dca57c34c6a1a934a986726d347e16a0b46e55d /sparse.1
parentc68bfab0e487452d17534393efaa0c8da165aff0 (diff)
downloadsparse-dev-729be196bb860270de32ec076873c6d327f592a0.tar.gz
simplify ((x & M) >> S) when (M >> S) == (-1 >> S)
The instructions LSR(AND(x, M), S) are already simplified into AND(LSR(x, S), (M >> S)) but only if AND(x, M) has a single user. However, if (M >> S) == (-1 >> S), the AND part is redundant and the whole can always directly be simplified into LSR(x, S). For example, code like: unsigned foo(unsigned x) { unsigned t = (x & 0xfffff000); return ((t >> 12) ^ (x >> 12)) & t; } is now optimized into: foo: ret.32 $0 because (t >> 12) is simplified into (x >> 12). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.1')
0 files changed, 0 insertions, 0 deletions