qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 43/44] target/loongarch: Implement vldi


From: Richard Henderson
Subject: Re: [RFC PATCH v2 43/44] target/loongarch: Implement vldi
Date: Mon, 3 Apr 2023 20:39:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 3/27/23 20:06, Song Gao wrote:
+static bool trans_vldi(DisasContext *ctx, arg_vldi *a)
+{
+    int sel, vece;
+    uint64_t value;
+    CHECK_SXE;
+
+    sel = (a->imm >> 12) & 0x1;
+
+    if (sel) {
+        /* VSETI.D */
+        value = vldi_get_value(ctx, a->imm);
+        vece = MO_64;
+    } else {
+       /*
+        * VLDI.B/H/W/D
+        *  a->imm bit [11:10] is vece.
+        *  a->imm bit [9:0] is value;
+        */
+       value = ((int32_t)(a->imm << 22)) >> 22;
+       vece = (a->imm >> 10) & 0x3;
+    }
+
+    tcg_gen_gvec_dup_i64(vece, vreg_full_offset(a->vd), 16, 16,
+                         tcg_constant_i64(value));
+    return true;
+}

I think you should finish this decode in insns.decode,
especially since we are using that for disassembly.


r~



reply via email to

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