qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 26/46] target/loongarch: Implement xvsllwil xvextl


From: Richard Henderson
Subject: Re: [PATCH v2 26/46] target/loongarch: Implement xvsllwil xvextl
Date: Sat, 8 Jul 2023 08:10:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 6/30/23 08:58, Song Gao wrote:
+#define VSLLWIL(NAME, BIT, E1, E2)                                     \
+void HELPER(NAME)(CPULoongArchState *env, uint32_t oprsz,              \
+                  uint32_t vd, uint32_t vj, uint32_t imm)              \
+{                                                                      \
+    int i, max;                                                        \
+    VReg temp;                                                         \
+    VReg *Vd = &(env->fpr[vd].vreg);                                   \
+    VReg *Vj = &(env->fpr[vj].vreg);                                   \
+    typedef __typeof(temp.E1(0)) TD;                                   \
+                                                                       \
+    temp.Q(0) = int128_zero();                                         \
+                                                                       \
+    if (oprsz == 32) {                                                 \
+        temp.Q(1) = int128_zero();                                     \
+    }                                                                  \
+                                                                       \
+    max = LSX_LEN / BIT;                                               \
+    for (i = 0; i < max; i++) {                                        \
+        temp.E1(i) = (TD)Vj->E2(i) << (imm % BIT);                     \
+        if (oprsz == 32) {                                             \
+            temp.E1(i + max) = (TD)Vj->E2(i + max * 2) << (imm % BIT); \
+        }                                                              \
+    }                                                                  \
+    *Vd = temp;                                                        \
+}

Function parameters using void* and desc.

    VReg temp = { };

instead of conditional partial assignment.

Fix iteration, as previously discussed.


r~



reply via email to

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