Skip to content

Commit

Permalink
target/arm: Fix do_predset for large VL
Browse files Browse the repository at this point in the history
Use MAKE_64BIT_MASK instead of open-coding.  Remove an odd
vector size check that is unlikely to be more profitable
than 3 64-bit integer stores.  Correct the iteration for WORD
to avoid writing too much data.

Fixes RISU tests of PTRUE for VL 256.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20180705191929.30773-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
rth7680 authored and pm215 committed Jul 9, 2018
1 parent 499748d commit 973558a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions target/arm/translate-sve.c
Expand Up @@ -1438,7 +1438,7 @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag)
setsz = numelem << esz;
lastword = word = pred_esz_masks[esz];
if (setsz % 64) {
lastword &= ~(-1ull << (setsz % 64));
lastword &= MAKE_64BIT_MASK(0, setsz % 64);
}
}

Expand All @@ -1457,19 +1457,13 @@ static bool do_predset(DisasContext *s, int esz, int rd, int pat, bool setflag)
tcg_gen_gvec_dup64i(ofs, oprsz, maxsz, word);
goto done;
}
if (oprsz * 8 == setsz + 8) {
tcg_gen_gvec_dup64i(ofs, oprsz, maxsz, word);
tcg_gen_movi_i64(t, 0);
tcg_gen_st_i64(t, cpu_env, ofs + oprsz - 8);
goto done;
}
}

setsz /= 8;
fullsz /= 8;

tcg_gen_movi_i64(t, word);
for (i = 0; i < setsz; i += 8) {
for (i = 0; i < QEMU_ALIGN_DOWN(setsz, 8); i += 8) {
tcg_gen_st_i64(t, cpu_env, ofs + i);
}
if (lastword != word) {
Expand Down

0 comments on commit 973558a

Please sign in to comment.