tcg: Eliminate one store for in-place 128-bit dup_mem

Do not store back to the exact memory from which we just loaded.

Backports 6a17646176e011ddc463a2870a64c7aaccfe9c50
This commit is contained in:
Richard Henderson 2021-03-01 18:06:06 -05:00 committed by Lioncash
parent c9dc750058
commit b478ce5052

View file

@ -1582,7 +1582,7 @@ void tcg_gen_gvec_dup_mem(TCGContext *s, unsigned vece, uint32_t dofs, uint32_t
TCGv_vec in = tcg_temp_new_vec(s, TCG_TYPE_V128);
tcg_gen_ld_vec(s, in, s->cpu_env, aofs);
for (i = 0; i < oprsz; i += 16) {
for (i = (aofs == dofs) * 16; i < oprsz; i += 16) {
tcg_gen_st_vec(s, in, s->cpu_env, dofs + i);
}
tcg_temp_free_vec(s, in);
@ -1592,7 +1592,7 @@ void tcg_gen_gvec_dup_mem(TCGContext *s, unsigned vece, uint32_t dofs, uint32_t
tcg_gen_ld_i64(s, in0, s->cpu_env, aofs);
tcg_gen_ld_i64(s, in1, s->cpu_env, aofs + 8);
for (i = 0; i < oprsz; i += 16) {
for (i = (aofs == dofs) * 16; i < oprsz; i += 16) {
tcg_gen_st_i64(s, in0, s->cpu_env, dofs + i);
tcg_gen_st_i64(s, in1, s->cpu_env, dofs + i + 8);
}