mirror of https://github.com/xemu-project/xemu.git
target/arm: Use tcg_gen_gvec_dup_imm
In a few cases, we're able to remove some manual replication. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
36af59d062
commit
8711e71f9c
|
@ -502,7 +502,7 @@ static void clear_vec_high(DisasContext *s, bool is_q, int rd)
|
|||
tcg_temp_free_i64(tcg_zero);
|
||||
}
|
||||
if (vsz > 16) {
|
||||
tcg_gen_gvec_dup8i(ofs + 16, vsz - 16, vsz - 16, 0);
|
||||
tcg_gen_gvec_dup_imm(MO_64, ofs + 16, vsz - 16, vsz - 16, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7785,8 +7785,8 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn)
|
|||
|
||||
if (!((cmode & 0x9) == 0x1 || (cmode & 0xd) == 0x9)) {
|
||||
/* MOVI or MVNI, with MVNI negation handled above. */
|
||||
tcg_gen_gvec_dup64i(vec_full_reg_offset(s, rd), is_q ? 16 : 8,
|
||||
vec_full_reg_size(s), imm);
|
||||
tcg_gen_gvec_dup_imm(MO_64, vec_full_reg_offset(s, rd), is_q ? 16 : 8,
|
||||
vec_full_reg_size(s), imm);
|
||||
} else {
|
||||
/* ORR or BIC, with BIC negation to AND handled above. */
|
||||
if (is_neg) {
|
||||
|
@ -10214,8 +10214,8 @@ static void handle_vec_simd_shri(DisasContext *s, bool is_q, bool is_u,
|
|||
if (is_u) {
|
||||
if (shift == 8 << size) {
|
||||
/* Shift count the same size as element size produces zero. */
|
||||
tcg_gen_gvec_dup8i(vec_full_reg_offset(s, rd),
|
||||
is_q ? 16 : 8, vec_full_reg_size(s), 0);
|
||||
tcg_gen_gvec_dup_imm(size, vec_full_reg_offset(s, rd),
|
||||
is_q ? 16 : 8, vec_full_reg_size(s), 0);
|
||||
} else {
|
||||
gen_gvec_fn2i(s, is_q, rd, rn, shift, tcg_gen_gvec_shri, size);
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ static bool do_mov_z(DisasContext *s, int rd, int rn)
|
|||
static void do_dupi_z(DisasContext *s, int rd, uint64_t word)
|
||||
{
|
||||
unsigned vsz = vec_full_reg_size(s);
|
||||
tcg_gen_gvec_dup64i(vec_full_reg_offset(s, rd), vsz, vsz, word);
|
||||
tcg_gen_gvec_dup_imm(MO_64, vec_full_reg_offset(s, rd), vsz, vsz, word);
|
||||
}
|
||||
|
||||
/* Invoke a vector expander on two Pregs. */
|
||||
|
@ -1453,7 +1453,7 @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag)
|
|||
unsigned oprsz = size_for_gvec(setsz / 8);
|
||||
|
||||
if (oprsz * 8 == setsz) {
|
||||
tcg_gen_gvec_dup64i(ofs, oprsz, maxsz, word);
|
||||
tcg_gen_gvec_dup_imm(MO_64, ofs, oprsz, maxsz, word);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
@ -2044,7 +2044,7 @@ static bool trans_DUP_x(DisasContext *s, arg_DUP_x *a)
|
|||
unsigned nofs = vec_reg_offset(s, a->rn, index, esz);
|
||||
tcg_gen_gvec_dup_mem(esz, dofs, nofs, vsz, vsz);
|
||||
} else {
|
||||
tcg_gen_gvec_dup64i(dofs, vsz, vsz, 0);
|
||||
tcg_gen_gvec_dup_imm(esz, dofs, vsz, vsz, 0);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -3260,9 +3260,7 @@ static bool trans_FDUP(DisasContext *s, arg_FDUP *a)
|
|||
|
||||
/* Decode the VFP immediate. */
|
||||
imm = vfp_expand_imm(a->esz, a->imm);
|
||||
imm = dup_const(a->esz, imm);
|
||||
|
||||
tcg_gen_gvec_dup64i(dofs, vsz, vsz, imm);
|
||||
tcg_gen_gvec_dup_imm(a->esz, dofs, vsz, vsz, imm);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -3276,7 +3274,7 @@ static bool trans_DUP_i(DisasContext *s, arg_DUP_i *a)
|
|||
unsigned vsz = vec_full_reg_size(s);
|
||||
int dofs = vec_full_reg_offset(s, a->rd);
|
||||
|
||||
tcg_gen_gvec_dup64i(dofs, vsz, vsz, dup_const(a->esz, a->imm));
|
||||
tcg_gen_gvec_dup_imm(a->esz, dofs, vsz, vsz, a->imm);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5209,7 +5209,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
|||
MIN(shift, (8 << size) - 1),
|
||||
vec_size, vec_size);
|
||||
} else if (shift >= 8 << size) {
|
||||
tcg_gen_gvec_dup8i(rd_ofs, vec_size, vec_size, 0);
|
||||
tcg_gen_gvec_dup_imm(MO_8, rd_ofs, vec_size,
|
||||
vec_size, 0);
|
||||
} else {
|
||||
tcg_gen_gvec_shri(size, rd_ofs, rm_ofs, shift,
|
||||
vec_size, vec_size);
|
||||
|
@ -5260,7 +5261,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
|||
* architecturally valid and results in zero.
|
||||
*/
|
||||
if (shift >= 8 << size) {
|
||||
tcg_gen_gvec_dup8i(rd_ofs, vec_size, vec_size, 0);
|
||||
tcg_gen_gvec_dup_imm(size, rd_ofs,
|
||||
vec_size, vec_size, 0);
|
||||
} else {
|
||||
tcg_gen_gvec_shli(size, rd_ofs, rm_ofs, shift,
|
||||
vec_size, vec_size);
|
||||
|
@ -5606,7 +5608,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
|||
}
|
||||
tcg_temp_free_i64(t64);
|
||||
} else {
|
||||
tcg_gen_gvec_dup32i(reg_ofs, vec_size, vec_size, imm);
|
||||
tcg_gen_gvec_dup_imm(MO_32, reg_ofs, vec_size,
|
||||
vec_size, imm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue