qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 16/30] tcg/loongarch: Implement shl/shr/sar/rotl/rotr ops


From: Richard Henderson
Subject: Re: [PATCH 16/30] tcg/loongarch: Implement shl/shr/sar/rotl/rotr ops
Date: Mon, 20 Sep 2021 09:13:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/20/21 1:04 AM, WANG Xuerui wrote:
+    case INDEX_op_rotl_i32:
+        /* transform into equivalent rotr_i32 */
+        if (c2) {
+            a2 = 32 - a2;
+        } else {
+            tcg_out_opc_sub_w(s, a2, TCG_REG_ZERO, a2);
+            tcg_out_opc_addi_w(s, a2, a2, 32);

You can't modify a2 here; need to use TCG_REG_TMP0.
You don't need the addi, because the negation is sufficient, mod 32.

Likewise for INDEX_op_rotl_i64.


r~



reply via email to

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