qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH 40/43] target/loongarch: Implement vreplve vpack vpick


From: Richard Henderson
Subject: Re: [RFC PATCH 40/43] target/loongarch: Implement vreplve vpack vpick
Date: Tue, 21 Mar 2023 08:55:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/21/23 04:31, gaosong wrote:
but for this case.
e.g
vreplve_b  vd vj, rk
index  = gpr[rk] % (128/8);
Vd->B(i) = Vj->B(index);
tcg_gen_gvec_dup_mem(MO_8, vreg_full_offset(a->vd), offsetof(CPULoongArchState, fpr[a->vj].vreg.B(index))), 16, 16 );

How can we get the index with cpu_env? or  need env->gpr[rk]?
The index type is not TCGv.

For this case you would load the value Vj->B(index) into a TCGv_i32,

        tcg_gen_andi_i64(t0, gpr_src(rk), 15);

        // Handle endian adjustment on t0, e.g. xor 15 for big-endian?

        tcg_gen_trunc_i64_ptr(t1, t0);
        tcg_gen_add_ptr(t1, t1, cpu_env);
        tcg_gen_ld8u_i32(t2, t1, vreg_full_offset(vj));

        // At this point t2 contains Vj->B(index)

        tcg_gen_gvec_dup_i32(MO_8, vreg_full_offset(vd), 16, 16, t2);



r~



reply via email to

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