diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-08-15 11:24:01 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-23 07:46:40 +0200 |
| commit | 01951278a60490735677920c86f139d627b22dbf (patch) | |
| tree | 44e9168eacaf2053a4b96bc52a4fb38b288e07a2 /validation/optim/bool-simplify.c | |
| parent | bf21036518acf0c3069c9c9e12b13fd09c8cdceb (diff) | |
| download | sparse-dev-01951278a60490735677920c86f139d627b22dbf.tar.gz | |
cast: specialize integer casts
Casts to integer used to be done with only 2 instructions:
OP_CAST & OP_SCAST.
Those are not very convenient as they don't reflect the real
operations that need to be done.
This patch specialize these instructions in:
- OP_TRUNC, for casts to a smaller type
- OP_ZEXT, for casts that need a zero extension
- OP_SEXT, for casts that need a sign extension
- Integer-to-integer casts of the same size are considered as
a NOPs and are, in fact, never emitted.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim/bool-simplify.c')
| -rw-r--r-- | validation/optim/bool-simplify.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/validation/optim/bool-simplify.c b/validation/optim/bool-simplify.c index 05be1149..5b3cf449 100644 --- a/validation/optim/bool-simplify.c +++ b/validation/optim/bool-simplify.c @@ -33,7 +33,7 @@ and_1: .L2: <entry-point> setne.1 %r8 <- %arg1, $0 - cast.32 %r11 <- (1) %r8 + zext.32 %r11 <- (1) %r8 ret.32 %r11 @@ -41,7 +41,7 @@ or_0: .L4: <entry-point> setne.1 %r14 <- %arg1, $0 - cast.32 %r17 <- (1) %r14 + zext.32 %r17 <- (1) %r14 ret.32 %r17 |
