diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-01 22:21:28 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-23 13:11:20 +0200 |
| commit | 45e70ebf4685004ad3cf31c8acf5b8c834933379 (patch) | |
| tree | 1923af6d99a88757de82b64f20ce8cb9299cf345 /validation/optim | |
| parent | c1715a15efc63174218266f400ffb535ee9c5e16 (diff) | |
| download | sparse-dev-45e70ebf4685004ad3cf31c8acf5b8c834933379.tar.gz | |
cast: preserve the sizes of TRUNC(AND(x,M),N)
sparse contains some code to simplify an AND masking
followed by a truncating cast.
However, this simplification is problematic because it
doesn't keep the sizes consistent. For example, code like:
and.32 %r3 <- %r2, $0x7fff
trunc.16 %r4 <- (32) %r3
will be discarded with %r3 used in place of %r4.
This is correct in the mathematical sense but %r4 had a size
of 16 while %r3 has a size of 32, so using %r3 in place of %r4
will make the sizes inconsistent with unexpected consequences.
We can more or less fix this by using another transformation
that preserve the sizes:
trunc.16 %r3 <- (32) %r2
and.16 %r4 <- %r3, $0x7fff
which in itself doesn't optimize anything but:
1) the mask may be smaller
2) may trigger other simplification with the TRUNC or the AND.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/and-trunc.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/optim/and-trunc.c b/validation/optim/and-trunc.c index bcb80bbe..df1e4d03 100644 --- a/validation/optim/and-trunc.c +++ b/validation/optim/and-trunc.c @@ -11,7 +11,6 @@ short umask(unsigned short x) /* * check-name: and-trunc * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: sext\\. |
