target/riscv/vector_helper.c: avoid env_archcpu() when reading RISCVCPUConfig
This file has several uses of env_archcpu() that are used solely to read cfg->vlen. Use the new riscv_cpu_cfg() inline instead. Suggested-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Weiwei Li<liweiwei@iscas.ac.cn> Message-ID: <20230226170514.588071-3-dbarboza@ventanamicro.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
parent
e130683ffb
commit
86247c51ff
@ -272,7 +272,7 @@ static void vext_set_tail_elems_1s(CPURISCVState *env, target_ulong vl,
|
||||
uint32_t esz, uint32_t max_elems)
|
||||
{
|
||||
uint32_t total_elems = vext_get_total_elems(env, desc, esz);
|
||||
uint32_t vlenb = env_archcpu(env)->cfg.vlen >> 3;
|
||||
uint32_t vlenb = riscv_cpu_cfg(env)->vlen >> 3;
|
||||
uint32_t vta = vext_vta(desc);
|
||||
uint32_t registers_used;
|
||||
int k;
|
||||
@ -671,7 +671,7 @@ vext_ldst_whole(void *vd, target_ulong base, CPURISCVState *env, uint32_t desc,
|
||||
{
|
||||
uint32_t i, k, off, pos;
|
||||
uint32_t nf = vext_nf(desc);
|
||||
uint32_t vlenb = env_archcpu(env)->cfg.vlen >> 3;
|
||||
uint32_t vlenb = riscv_cpu_cfg(env)->vlen >> 3;
|
||||
uint32_t max_elems = vlenb >> log2_esz;
|
||||
|
||||
k = env->vstart / max_elems;
|
||||
@ -1141,7 +1141,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void *vs2, \
|
||||
{ \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t i; \
|
||||
\
|
||||
@ -1177,7 +1177,7 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, \
|
||||
{ \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t i; \
|
||||
\
|
||||
@ -1376,7 +1376,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void *vs2, \
|
||||
{ \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t vma = vext_vma(desc); \
|
||||
uint32_t i; \
|
||||
@ -1439,7 +1439,7 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, void *vs2, \
|
||||
{ \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t vma = vext_vma(desc); \
|
||||
uint32_t i; \
|
||||
@ -4152,7 +4152,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void *vs2, \
|
||||
{ \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t vma = vext_vma(desc); \
|
||||
uint32_t i; \
|
||||
@ -4190,7 +4190,7 @@ void HELPER(NAME)(void *vd, void *v0, uint64_t s1, void *vs2, \
|
||||
{ \
|
||||
uint32_t vm = vext_vm(desc); \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t vma = vext_vma(desc); \
|
||||
uint32_t i; \
|
||||
@ -4721,7 +4721,7 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, \
|
||||
uint32_t desc) \
|
||||
{ \
|
||||
uint32_t vl = env->vl; \
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen; \
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen; \
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc); \
|
||||
uint32_t i; \
|
||||
int a, b; \
|
||||
@ -4808,7 +4808,7 @@ static void vmsetm(void *vd, void *v0, void *vs2, CPURISCVState *env,
|
||||
{
|
||||
uint32_t vm = vext_vm(desc);
|
||||
uint32_t vl = env->vl;
|
||||
uint32_t total_elems = env_archcpu(env)->cfg.vlen;
|
||||
uint32_t total_elems = riscv_cpu_cfg(env)->vlen;
|
||||
uint32_t vta_all_1s = vext_vta_all_1s(desc);
|
||||
uint32_t vma = vext_vma(desc);
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user