diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-18 18:43:38 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-22 09:26:18 +0200 |
| commit | 3d30b78ec7efa501ad3ea4c5f077ef653ed5b231 (patch) | |
| tree | 0a0d1b722f8473f3c73b94cd50f537de81baa42e /validation/optim | |
| parent | cb4bed63e19e64d62364337cca20285f782ac6fd (diff) | |
| download | sparse-dev-3d30b78ec7efa501ad3ea4c5f077ef653ed5b231.tar.gz | |
simplify ((x & M) << S) when (M << S) == (-1 << S)
The instructions SHL(AND(x, M), S) can be simplified into SHL(x, S)
if (M << S) == (-1 << S).
For example, code like:
unsigned foo(unsigned x)
{
return (x & 0x000fffff) << 12;
}
is now optimized into:
foo:
shl.32 %r3 <- %arg1, $12
ret.32 %r3
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/shl-and1.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/optim/shl-and1.c b/validation/optim/shl-and1.c index 5f4fdcb1..13a1675b 100644 --- a/validation/optim/shl-and1.c +++ b/validation/optim/shl-and1.c @@ -12,7 +12,6 @@ unsigned shl_and1(unsigned x) /* * check-name: shl-and1 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-contains: ret\\..*\\$0$ |
