qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 14/30] tcg/loongarch64: Implement bswap32_i32/bswap32_i64/


From: WANG Xuerui
Subject: Re: [PATCH v2 14/30] tcg/loongarch64: Implement bswap32_i32/bswap32_i64/bswap64_i64
Date: Thu, 23 Sep 2021 01:24:36 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Thunderbird/94.0a1

Hi Richard,

On 9/22/21 22:54, Richard Henderson wrote:
On 9/21/21 1:18 PM, WANG Xuerui wrote:
+    case INDEX_op_bswap32_i32:
+        /* All 32-bit values are computed sign-extended in the register.  */
+        a2 = TCG_BSWAP_OS;
+        /* fallthrough */
+    case INDEX_op_bswap32_i64:
+        tcg_out_opc_revb_2w(s, a0, a1);
+        if (a2 & TCG_BSWAP_OS) {
+            tcg_out_ext32s(s, a0, a0);
+        } else if ((a2 & (TCG_BSWAP_IZ | TCG_BSWAP_OZ)) == TCG_BSWAP_OZ) {
+            tcg_out_ext32u(s, a0, a0);
+        }
+        break;

Looks good so far, so:
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

We'll also want INDEX_op_bswap16_{i32,i64}.  This should look just like bswap32_i64, except with revb_2h and ext16{s,u}.
Thanks for the suggestion; I'll add these in v3, since they're relatively light-weight to implement.


r~



reply via email to

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