@samitouri / QOSamiQemu / commits / 53c3d4906c

target/arm: Implement FCVT (FP16 to FP8) for SME

Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260609192110.752384-20-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Richard Henderson committed Jun 9, 2026 at 12:20 UTC 53c3d4906c84c59af30173b86af9093348ebbb02
2 files changed +18
target/arm/tcg/sme.decode
+2
@@ -863,6 +863,8 @@ BF2CVT 11000001 111 00110 111000 ..... ....0 @zz_2x1
863 BF1CVTL 11000001 011 00110 111000 ..... ....1 @zz_2x1
864 BF2CVTL 11000001 111 00110 111000 ..... ....1 @zz_2x1
865
866 +FCVT_bh 11000001 001 00100 111000 ....0 ..... @zz_1x2
867 +
868 ZIP_4 11000001 esz:2 1 10110 111000 ...00 ... 00 \
869 &zz_e zd=%zd_ax4 zn=%zn_ax4
870 ZIP_4 11000001 001 10111 111000 ...00 ... 00 \
target/arm/tcg/translate-sme.c
+16
@@ -1556,6 +1556,22 @@ TRANS_FEAT(BF2CVT, aa64_sme2_f8cvt, do_f8cvt, a, gen_helper_sme2_bfcvt_hb, 1)
1556 TRANS_FEAT(BF1CVTL, aa64_sme2_f8cvt, do_f8cvt, a, gen_helper_sme2_bfcvtl_hb, 0)
1557 TRANS_FEAT(BF2CVTL, aa64_sme2_f8cvt, do_f8cvt, a, gen_helper_sme2_bfcvtl_hb, 1)
1558
1559 +static bool trans_FCVT_bh(DisasContext *s, arg_zz_n *a)
1560 +{
1561 + if (!dc_isar_feature(aa64_sme2_f8cvt, s)) {
1562 + return false;
1563 + }
1564 + if (fpmr_access_check(s) && sme_sm_enabled_check(s)) {
1565 + int svl = streaming_vec_reg_size(s);
1566 + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->zd),
1567 + vec_full_reg_offset(s, a->zn),
1568 + vec_full_reg_offset(s, a->zn + 1),
1569 + tcg_env, svl, svl,
1570 + FPST_ZA << 2, gen_helper_gvec_fcvt_bh);
1571 + }
1572 + return true;
1573 +}
1574 +
1575 static bool do_zipuzp_4(DisasContext *s, arg_zz_e *a,
1576 gen_helper_gvec_2 * const fn[5])
1577 {