diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-08 01:04:26 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-22 09:25:34 +0200 |
| commit | 9feb4b16da637978ce4abdfe23bf9779521a8b77 (patch) | |
| tree | f577fffd0bb7f2253eb5645e45a210bd4e053060 /validation/optim/sh-or-and1.c | |
| parent | 03e845221e1d4e7e43f43a91a1d5b3ee96e58c5c (diff) | |
| download | sparse-dev-9feb4b16da637978ce4abdfe23bf9779521a8b77.tar.gz | |
simplify SHL((x & M') | y, S)
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>
Diffstat (limited to 'validation/optim/sh-or-and1.c')
| -rw-r--r-- | validation/optim/sh-or-and1.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/optim/sh-or-and1.c b/validation/optim/sh-or-and1.c index 44a07ec5..7b79bbf3 100644 --- a/validation/optim/sh-or-and1.c +++ b/validation/optim/sh-or-and1.c @@ -11,7 +11,6 @@ unsigned shl_or_and1(unsigned x, unsigned b) /* * check-name: sh-or-and1 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-pattern(1): lsr\\. |
