Skip to content

Commit c76ec8d

Browse files
rth7680Michael Tokarev
authored andcommitted
target/arm: Fix 128-bit element ZIP, UZP, TRN
We missed the instructions UDEF when the vector size is too small. We missed marking the instructions non-streaming with SME. Cc: [email protected] Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Richard Henderson <[email protected]> Message-id: [email protected] Signed-off-by: Peter Maydell <[email protected]> (cherry picked from commit e6ffd009c7710a8cc98094897fa0af609c114683) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 0e5f0d8 commit c76ec8d

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

target/arm/tcg/translate-sve.c

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,23 @@ TRANS_FEAT(PUNPKHI, aa64_sve, do_perm_pred2, a, 1, gen_helper_sve_punpk_p)
23522352
*** SVE Permute - Interleaving Group
23532353
*/
23542354

2355+
static bool do_interleave_q(DisasContext *s, gen_helper_gvec_3 *fn,
2356+
arg_rrr_esz *a, int data)
2357+
{
2358+
if (sve_access_check(s)) {
2359+
unsigned vsz = vec_full_reg_size(s);
2360+
if (vsz < 32) {
2361+
unallocated_encoding(s);
2362+
} else {
2363+
tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd),
2364+
vec_full_reg_offset(s, a->rn),
2365+
vec_full_reg_offset(s, a->rm),
2366+
vsz, vsz, data, fn);
2367+
}
2368+
}
2369+
return true;
2370+
}
2371+
23552372
static gen_helper_gvec_3 * const zip_fns[4] = {
23562373
gen_helper_sve_zip_b, gen_helper_sve_zip_h,
23572374
gen_helper_sve_zip_s, gen_helper_sve_zip_d,
@@ -2361,11 +2378,11 @@ TRANS_FEAT(ZIP1_z, aa64_sve, gen_gvec_ool_arg_zzz,
23612378
TRANS_FEAT(ZIP2_z, aa64_sve, gen_gvec_ool_arg_zzz,
23622379
zip_fns[a->esz], a, vec_full_reg_size(s) / 2)
23632380

2364-
TRANS_FEAT(ZIP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
2365-
gen_helper_sve2_zip_q, a, 0)
2366-
TRANS_FEAT(ZIP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
2367-
gen_helper_sve2_zip_q, a,
2368-
QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2)
2381+
TRANS_FEAT_NONSTREAMING(ZIP1_q, aa64_sve_f64mm, do_interleave_q,
2382+
gen_helper_sve2_zip_q, a, 0)
2383+
TRANS_FEAT_NONSTREAMING(ZIP2_q, aa64_sve_f64mm, do_interleave_q,
2384+
gen_helper_sve2_zip_q, a,
2385+
QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2)
23692386

23702387
static gen_helper_gvec_3 * const uzp_fns[4] = {
23712388
gen_helper_sve_uzp_b, gen_helper_sve_uzp_h,
@@ -2377,10 +2394,10 @@ TRANS_FEAT(UZP1_z, aa64_sve, gen_gvec_ool_arg_zzz,
23772394
TRANS_FEAT(UZP2_z, aa64_sve, gen_gvec_ool_arg_zzz,
23782395
uzp_fns[a->esz], a, 1 << a->esz)
23792396

2380-
TRANS_FEAT(UZP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
2381-
gen_helper_sve2_uzp_q, a, 0)
2382-
TRANS_FEAT(UZP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
2383-
gen_helper_sve2_uzp_q, a, 16)
2397+
TRANS_FEAT_NONSTREAMING(UZP1_q, aa64_sve_f64mm, do_interleave_q,
2398+
gen_helper_sve2_uzp_q, a, 0)
2399+
TRANS_FEAT_NONSTREAMING(UZP2_q, aa64_sve_f64mm, do_interleave_q,
2400+
gen_helper_sve2_uzp_q, a, 16)
23842401

23852402
static gen_helper_gvec_3 * const trn_fns[4] = {
23862403
gen_helper_sve_trn_b, gen_helper_sve_trn_h,
@@ -2392,10 +2409,10 @@ TRANS_FEAT(TRN1_z, aa64_sve, gen_gvec_ool_arg_zzz,
23922409
TRANS_FEAT(TRN2_z, aa64_sve, gen_gvec_ool_arg_zzz,
23932410
trn_fns[a->esz], a, 1 << a->esz)
23942411

2395-
TRANS_FEAT(TRN1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
2396-
gen_helper_sve2_trn_q, a, 0)
2397-
TRANS_FEAT(TRN2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
2398-
gen_helper_sve2_trn_q, a, 16)
2412+
TRANS_FEAT_NONSTREAMING(TRN1_q, aa64_sve_f64mm, do_interleave_q,
2413+
gen_helper_sve2_trn_q, a, 0)
2414+
TRANS_FEAT_NONSTREAMING(TRN2_q, aa64_sve_f64mm, do_interleave_q,
2415+
gen_helper_sve2_trn_q, a, 16)
23992416

24002417
/*
24012418
*** SVE Permute Vector - Predicated Group

0 commit comments

Comments
 (0)