diff options
| -rw-r--r-- | simplify.c | 8 | ||||
| -rw-r--r-- | validation/optim/and-or-trunc0.c | 1 | ||||
| -rw-r--r-- | validation/optim/and-or-trunc1.c | 1 | ||||
| -rw-r--r-- | validation/optim/and-or-trunc2.c | 1 | ||||
| -rw-r--r-- | validation/optim/and-or-truncx.c | 1 |
5 files changed, 8 insertions, 4 deletions
@@ -632,6 +632,7 @@ static int simplify_mask_or_and(struct instruction *insn, unsigned long long mas // * if OP(x, K) == AND(x, M), @mask M is K // * if OP(x, K) == LSR(x, S), @mask M is (-1 << S) // * if OP(x, K) == SHL(x, S), @mask M is (-1 >> S) +// * if OP(x, K) == TRUNC(x, N), @mask M is $mask(N) static int simplify_mask_or(struct instruction *insn, unsigned long long mask, struct instruction *or) { pseudo_t src1 = or->src1; @@ -1399,6 +1400,13 @@ static int simplify_cast(struct instruction *insn) return replace_pseudo(insn, &insn->src1, def->src1); } break; + case OP_OR: + switch (insn->opcode) { + case OP_TRUNC: + mask = bits_mask(insn->size); + return simplify_mask_or(insn, mask, def); + } + break; case OP_TRUNC: switch (insn->opcode) { case OP_TRUNC: diff --git a/validation/optim/and-or-trunc0.c b/validation/optim/and-or-trunc0.c index 873cb2d5..3d326b6a 100644 --- a/validation/optim/and-or-trunc0.c +++ b/validation/optim/and-or-trunc0.c @@ -6,7 +6,6 @@ char foo(int x, int y) /* * check-name: and-or-trunc0 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: and\\. diff --git a/validation/optim/and-or-trunc1.c b/validation/optim/and-or-trunc1.c index 84c20317..6bbe8a8c 100644 --- a/validation/optim/and-or-trunc1.c +++ b/validation/optim/and-or-trunc1.c @@ -6,7 +6,6 @@ char foo(int x, int y) /* * check-name: and-or-trunc1 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: and\\. diff --git a/validation/optim/and-or-trunc2.c b/validation/optim/and-or-trunc2.c index 04cb57e7..e66c1f14 100644 --- a/validation/optim/and-or-trunc2.c +++ b/validation/optim/and-or-trunc2.c @@ -6,7 +6,6 @@ char foo(int x, int y) /* * check-name: and-or-trunc2 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-pattern(1): and\\. diff --git a/validation/optim/and-or-truncx.c b/validation/optim/and-or-truncx.c index 47d80dae..ef8249a1 100644 --- a/validation/optim/and-or-truncx.c +++ b/validation/optim/and-or-truncx.c @@ -6,7 +6,6 @@ char foo(int x, int y, int b) /* * check-name: and-or-truncx * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-pattern(1): and\\. |
