On 10/20/21 3:27 PM, Luis Fernando Fujita Pires wrote:
From: Richard Henderson <richard.hender...@linaro.org>
Reduce some code duplication by folding the NE and EQ cases.

Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
  tcg/optimize.c | 161 +++++++++++++++++++++++++------------------------
  1 file changed, 83 insertions(+), 78 deletions(-)

+    case TCG_COND_NE:
+        inv = 1;
+        QEMU_FALLTHROUGH;
+    case TCG_COND_EQ:
+        /*
+         * Simplify EQ/NE comparisons where one of the pairs
+         * can be simplified.
+         */
+        i = do_constant_folding_cond(INDEX_op_brcond_i32, op->args[0],
+                                     op->args[2], cond);
+        switch (i ^ inv) {
+        case 0:
+            goto do_brcond_false;

I believe this should go to do_brcond_true when cond==TCG_COND_NE.

Good eyes, thanks.
This needs to be more like setcond2, with do_brcond_const.

r~

Reply via email to