diff --git a/qemu/tcg/tcg-op-vec.c b/qemu/tcg/tcg-op-vec.c index 6cd71dd6..b246c579 100644 --- a/qemu/tcg/tcg-op-vec.c +++ b/qemu/tcg/tcg-op-vec.c @@ -254,10 +254,10 @@ TCGv_vec tcg_const_ones_vec_matching(TCGContext *s, TCGv_vec m) void tcg_gen_dup64i_vec(TCGContext *s, TCGv_vec r, uint64_t a) { - if (TCG_TARGET_REG_BITS == 32 && a == deposit64(a, 32, 32, a)) { - do_dupi_vec(s, r, MO_32, a); - } else if (TCG_TARGET_REG_BITS == 64 || a == (uint64_t)(int32_t)a) { + if (TCG_TARGET_REG_BITS == 64) { do_dupi_vec(s, r, MO_64, a); + } else if (a == dup_const(MO_32, a)) { + do_dupi_vec(s, r, MO_32, a); } else { TCGv_i64 c = tcg_const_i64(s, a); tcg_gen_dup_i64_vec(s, MO_64, r, c); @@ -282,7 +282,11 @@ void tcg_gen_dup8i_vec(TCGContext *s, TCGv_vec r, uint32_t a) void tcg_gen_dupi_vec(TCGContext *s, unsigned vece, TCGv_vec r, uint64_t a) { - do_dupi_vec(s, r, MO_REG, dup_const(vece, a)); + if (vece == MO_64) { + tcg_gen_dup64i_vec(s, r, a); + } else { + do_dupi_vec(s, r, MO_REG, dup_const(vece, a)); + } } void tcg_gen_dup_i64_vec(TCGContext *s, unsigned vece, TCGv_vec r, TCGv_i64 a)