diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-12 11:56:52 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-22 09:25:34 +0200 |
| commit | 03e845221e1d4e7e43f43a91a1d5b3ee96e58c5c (patch) | |
| tree | 478b2c7edc4cc11b129ea6a4d8a4eb2c8f074ba4 /validation/__func__.c | |
| parent | 8ef6a1d0cac7fdbf5f0c0f70f5c3a25cc1e88670 (diff) | |
| download | sparse-dev-03e845221e1d4e7e43f43a91a1d5b3ee96e58c5c.tar.gz | |
simplify OP((x | C), K) when (C & M) != C
If the effective mask (M) corresponding to OP(_, K) is different
than the combined mask (C & M), then the inner mask (C) can be
replaced by the smaller (C & M), giving:
OP((x | M'), K) with M' == (C & M).
For example, code like:
int foo(int x)
{
return (x | 0xfffffff0) & 0xfff;
}
is now simplified into:
foo:
or.32 %r2 <- %arg1, $0xff0
and.32 %r3 <- %r2, $0xfff
ret.32 %r3
while previously, the constant was not reduced:
foo:
or.32 %r2 <- %arg1, $0xfffffff0
and.32 %r3 <- %r2, $0xfff
ret.32 %r3
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/__func__.c')
0 files changed, 0 insertions, 0 deletions
