diff options
| -rw-r--r-- | simplify.c | 13 | ||||
| -rw-r--r-- | validation/optim/bool-simplify.c | 9 | ||||
| -rw-r--r-- | validation/optim/setne0-zext.c | 1 | ||||
| -rw-r--r-- | validation/optim/trunc-seteq0.c | 1 |
4 files changed, 16 insertions, 8 deletions
@@ -1189,6 +1189,19 @@ static int simplify_cast(struct instruction *insn) return REPEAT_CSE; } break; + case OP_FPCMP ... OP_BINCMP_END: + switch (insn->opcode) { + case OP_ZEXT: + // simplify: + // setcc.n %t <- %a, %b + // zext.m %r <- (n) %t + // into: + // setcc.m %r <- %a, %b + insn->opcode = def->opcode; + use_pseudo(insn, def->src2, &insn->src2); + return replace_pseudo(insn, &insn->src1, def->src1); + } + break; case OP_TRUNC: osize = def->orig_type->bit_size; if (insn->opcode == OP_ZEXT && size == osize) { diff --git a/validation/optim/bool-simplify.c b/validation/optim/bool-simplify.c index 68aabb78..b872764c 100644 --- a/validation/optim/bool-simplify.c +++ b/validation/optim/bool-simplify.c @@ -43,16 +43,14 @@ and_0: and_1: .L2: <entry-point> - setne.1 %r8 <- %arg1, $0 - zext.32 %r11 <- (1) %r8 + setne.32 %r11 <- %arg1, $0 ret.32 %r11 or_0: .L4: <entry-point> - setne.1 %r14 <- %arg1, $0 - zext.32 %r17 <- (1) %r14 + setne.32 %r17 <- %arg1, $0 ret.32 %r17 @@ -65,8 +63,7 @@ or_1: and_2: .L8: <entry-point> - setne.1 %r26 <- %arg1, $0 - zext.32 %r29 <- (1) %r26 + setne.32 %r29 <- %arg1, $0 ret.32 %r29 diff --git a/validation/optim/setne0-zext.c b/validation/optim/setne0-zext.c index fc6615be..8a074f03 100644 --- a/validation/optim/setne0-zext.c +++ b/validation/optim/setne0-zext.c @@ -3,7 +3,6 @@ unsigned long foo(int a) { return (unsigned int) (a != 0); } /* * check-name: setne0-zext * check-command: test-linearize -m64 -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: zext\\. diff --git a/validation/optim/trunc-seteq0.c b/validation/optim/trunc-seteq0.c index 321c045e..5994b17c 100644 --- a/validation/optim/trunc-seteq0.c +++ b/validation/optim/trunc-seteq0.c @@ -10,7 +10,6 @@ int ou(int i, struct S *b) { return i || b->u; } /* * check-name: trunc-seteq0 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: trunc\\. |
