tcg: Add dbase argument to do_dup_store

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2024-03-06 11:44:59 -10:00
parent 43ba160cb4
commit e14236b30b

View file

@ -483,8 +483,8 @@ static TCGType choose_vector_type(const TCGOpcode *list, unsigned vece,
return 0; return 0;
} }
static void do_dup_store(TCGType type, uint32_t dofs, uint32_t oprsz, static void do_dup_store(TCGType type, TCGv_ptr dbase, uint32_t dofs,
uint32_t maxsz, TCGv_vec t_vec) uint32_t oprsz, uint32_t maxsz, TCGv_vec t_vec)
{ {
uint32_t i = 0; uint32_t i = 0;
@ -496,7 +496,7 @@ static void do_dup_store(TCGType type, uint32_t dofs, uint32_t oprsz,
* are misaligned wrt the maximum vector size, so do that first. * are misaligned wrt the maximum vector size, so do that first.
*/ */
if (dofs & 8) { if (dofs & 8) {
tcg_gen_stl_vec(t_vec, tcg_env, dofs + i, TCG_TYPE_V64); tcg_gen_stl_vec(t_vec, dbase, dofs + i, TCG_TYPE_V64);
i += 8; i += 8;
} }
@ -508,17 +508,17 @@ static void do_dup_store(TCGType type, uint32_t dofs, uint32_t oprsz,
* that e.g. size == 80 would be expanded with 2x32 + 1x16. * that e.g. size == 80 would be expanded with 2x32 + 1x16.
*/ */
for (; i + 32 <= oprsz; i += 32) { for (; i + 32 <= oprsz; i += 32) {
tcg_gen_stl_vec(t_vec, tcg_env, dofs + i, TCG_TYPE_V256); tcg_gen_stl_vec(t_vec, dbase, dofs + i, TCG_TYPE_V256);
} }
/* fallthru */ /* fallthru */
case TCG_TYPE_V128: case TCG_TYPE_V128:
for (; i + 16 <= oprsz; i += 16) { for (; i + 16 <= oprsz; i += 16) {
tcg_gen_stl_vec(t_vec, tcg_env, dofs + i, TCG_TYPE_V128); tcg_gen_stl_vec(t_vec, dbase, dofs + i, TCG_TYPE_V128);
} }
break; break;
case TCG_TYPE_V64: case TCG_TYPE_V64:
for (; i < oprsz; i += 8) { for (; i < oprsz; i += 8) {
tcg_gen_stl_vec(t_vec, tcg_env, dofs + i, TCG_TYPE_V64); tcg_gen_stl_vec(t_vec, dbase, dofs + i, TCG_TYPE_V64);
} }
break; break;
default: default:
@ -574,7 +574,7 @@ static void do_dup(unsigned vece, uint32_t dofs, uint32_t oprsz,
} else { } else {
tcg_gen_dupi_vec(vece, t_vec, in_c); tcg_gen_dupi_vec(vece, t_vec, in_c);
} }
do_dup_store(type, dofs, oprsz, maxsz, t_vec); do_dup_store(type, tcg_env, dofs, oprsz, maxsz, t_vec);
return; return;
} }
@ -1731,7 +1731,7 @@ void tcg_gen_gvec_dup_mem(unsigned vece, uint32_t dofs, uint32_t aofs,
if (type != 0) { if (type != 0) {
TCGv_vec t_vec = tcg_temp_new_vec(type); TCGv_vec t_vec = tcg_temp_new_vec(type);
tcg_gen_dup_mem_vec(vece, t_vec, tcg_env, aofs); tcg_gen_dup_mem_vec(vece, t_vec, tcg_env, aofs);
do_dup_store(type, dofs, oprsz, maxsz, t_vec); do_dup_store(type, tcg_env, dofs, oprsz, maxsz, t_vec);
} else if (vece <= MO_32) { } else if (vece <= MO_32) {
TCGv_i32 in = tcg_temp_ebb_new_i32(); TCGv_i32 in = tcg_temp_ebb_new_i32();
switch (vece) { switch (vece) {