|
From: | Richard Henderson |
Subject: | Re: [RFC PATCH 01/43] target/loongarch: Add vector data type vec_t |
Date: | Sat, 24 Dec 2022 09:24:49 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 |
On 12/24/22 00:15, Song Gao wrote:
+union fpr_t { + uint64_t d; + vec_t vec; +}; + struct LoongArchTLB { uint64_t tlb_misc; /* Fields corresponding to CSR_TLBELO0/1 */ @@ -251,7 +267,7 @@ typedef struct CPUArchState { uint64_t gpr[32]; uint64_t pc;- uint64_t fpr[32];+ fpr_t fpr[32];
I didn't spot it right away, because you didn't add ".d" to the tcg register allocation, but if you use tcg/tcg-op-gvec.h (and you really should), then you will also have to remove
for (i = 0; i < 32; i++) { int off = offsetof(CPULoongArchState, fpr[i]); cpu_fpr[i] = tcg_global_mem_new_i64(cpu_env, off, fregnames[i]); }
because one cannot modify global_mem variables with gvec.I strongly suggest that you introduce wrappers to load/store fpr values from their env slots. I would name them similarly to gpr_{src,dst}, gen_set_gpr.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |