qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 20/30] tcg/loongarch64: Implement setcond ops


From: WANG Xuerui
Subject: Re: [PATCH v2 20/30] tcg/loongarch64: Implement setcond ops
Date: Thu, 23 Sep 2021 01:26:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Thunderbird/94.0a1

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

[Prev in Thread] Current Thread [Next in Thread]