Hi Richard,

On 9/22/21 23:13, Richard Henderson wrote:
On 9/21/21 1:19 PM, WANG Xuerui wrote:
+static void tcg_out_setcond(TCGContext *s, TCGCond cond, TCGReg ret,
+                            TCGReg arg1, TCGReg arg2, bool c1, bool c2)
+{
+    TCGReg tmp;
+
+    if (c1) {
+        tcg_debug_assert(arg1 == 0);
+    }
+    if (c2) {
+        tcg_debug_assert(arg2 == 0);
+    }

You don't need to work quite this hard.  Only the second argument will be constant.  If both are constant, we will have folded the operation away.  If the first argument was constant, we will swap the condition.
Thanks for the clarification; again something I didn't discover during my (often cursory) read of tcg middle-end code. I'll drop all the c1 thing in v3.

Reply via email to