Skip to contentSkip to conversation

Fix constant folding logic of setcond2_i32

PATCH In review Liren Wei 1 participant 2 messages Oct 21, 2021

lore
Share & tools
lore

Liren Wei

author
#0 lore raw

PATCH 1/1 Fix constant folding logic of setcond2_i32

For setcond2_i32 DST, A_low, A_high, B_low, B_high, TCG_COND_EQ, DST should be 0 as long as either half of A and B are not equal.

---
 tcg/optimize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/optimize.c +1 -1
index c239c3bd07..45a10e5e72 100644
@@ -1492,7 +1492,7 @@ void tcg_optimize(TCGContext *s)
                                                op->args[2], op->args[4],
                                                TCG_COND_EQ);
                 if (tmp == 0) {
-                    goto do_setcond_high;
+                    goto do_setcond_const;
                 } else if (tmp != 1) {
                     goto do_default;
                 }
Signature · 1 line
2.33.0
author
#1 lore raw
Quoted 13 lines · Liren Wei

For setcond2_i32 DST, A_low, A_high, B_low, B_high, TCG_COND_EQ, DST should be 0 as long as either half of A and B are not equal.

---
  tcg/optimize.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tcg/optimize.c +0 -0
index c239c3bd07..45a10e5e72 100644

tcg/optimize.c void tcg_optimize(TCGContext *s) · line 1498

Quoted 8 lines
tcg/optimize.c +1 -1
@@ -1492,7 +1492,7 @@ void tcg_optimize(TCGContext *s)
                                                 op->args[2], op->args[4],
                                                 TCG_COND_EQ);
                  if (tmp == 0) {
-                    goto do_setcond_high;
+                    goto do_setcond_const;
                  } else if (tmp != 1) {
                      goto do_default;
                  }

Just noticed that this has been fixed in new patch series by others, please ignore this. Sorry about that...