target/arm: Implement FSCALE for SME
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260522220306.235200-22-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Richard Henderson committed
May 22, 2026 at 15:02 UTC
d4c27fe91f819f7fbe2cf96c7a369243179f338b
3 files changed
+24
-2
target/arm/cpu-features.h
+5
@@ -1622,6 +1622,11 @@ static inline bool isar_feature_aa64_sme2_faminmax(const ARMISARegisters *id)
1622
return isar_feature_aa64_sme2(id) && isar_feature_aa64_faminmax(id);
1623
}
1624
1625
+static inline bool isar_feature_aa64_sme2_f8cvt(const ARMISARegisters *id)
1626
+{
1627
+ return isar_feature_aa64_sme2(id) && isar_feature_aa64_f8cvt(id);
1628
+}
1629
+
1630
static inline bool isar_feature_aa64_sve_i8mm(const ARMISARegisters *id)
1631
{
1632
return isar_feature_aa64_sve(id) && isar_feature_aa64_sme_sve_i8mm(id);
target/arm/tcg/sme.decode
+6
@@ -250,6 +250,9 @@ ADD_n1 1100000 1 .. 10 .... 1010.0 11000 .... 0 @z2z_4x1
250
SQDMULH_n1 1100000 1 .. 10 .... 1010.1 00000 .... 0 @z2z_2x1
251
SQDMULH_n1 1100000 1 .. 10 .... 1010.1 00000 .... 0 @z2z_4x1
252
253
+FSCALE_n1 1100000 1 .. 10 .... 1010.0 01100 .... 0 @z2z_2x1
254
+FSCALE_n1 1100000 1 .. 10 .... 1010.0 01100 .... 0 @z2z_4x1
255
+
256
### SME2 Multi-vector Multiple Vectors SVE Destructive
257
258
%zm_ax2 17:4 !function=times_2
@@ -291,6 +294,9 @@ FAMAX_nn 1100000 1 .. 1 ..... 1011.0 01010 .... 0 @z2z_4x4
294
FAMIN_nn 1100000 1 .. 1 ..... 1011.0 01010 .... 1 @z2z_2x2
295
FAMIN_nn 1100000 1 .. 1 ..... 1011.0 01010 .... 1 @z2z_4x4
296
297
+FSCALE_nn 1100000 1 .. 1 ..... 1011.0 01100 .... 0 @z2z_2x2
298
+FSCALE_nn 1100000 1 .. 1 ..... 1011.0 01100 .... 0 @z2z_4x4
299
+
300
### SME2 Multi-vector Multiple and Single Array Vectors
301
302
&azz_n n off rv zn zm
target/arm/tcg/translate-sme.c
+13
-2
@@ -707,9 +707,12 @@ static bool do_z2z_n1_fpst(DisasContext *s, arg_z2z_en *a,
707
{
708
int esz = a->esz, n, dn, vsz, mofs;
709
bool overlap = false;
710
- gen_helper_gvec_3_ptr *fn;
710
+ gen_helper_gvec_3_ptr *fn = fns[esz];
711
TCGv_ptr fpst;
712
713
+ if (fn == NULL) {
714
+ return false;
715
+ }
716
/* These insns use MO_8 to encode BFloat16. */
717
if (esz == MO_8 && !dc_isar_feature(aa64_sme_b16b16, s)) {
718
return false;
@@ -719,7 +722,6 @@ static bool do_z2z_n1_fpst(DisasContext *s, arg_z2z_en *a,
722
}
723
724
fpst = fpstatus_ptr(esz == MO_16 ? FPST_A64_F16 : FPST_A64);
722
- fn = fns[esz];
725
n = a->n;
726
dn = a->zdn;
727
mofs = vec_full_reg_offset(s, a->zm);
@@ -831,6 +833,15 @@ static gen_helper_gvec_3_ptr * const f_vector_famin[4] = {
833
};
834
TRANS_FEAT(FAMIN_nn, aa64_sme2_faminmax, do_z2z_nn_fpst, a, f_vector_famin)
835
836
+static gen_helper_gvec_3_ptr * const f_vector_fscale[4] = {
837
+ NULL,
838
+ gen_helper_gvec_fscale_h,
839
+ gen_helper_gvec_fscale_s,
840
+ gen_helper_gvec_fscale_d,
841
+};
842
+TRANS_FEAT(FSCALE_n1, aa64_sme2_f8cvt, do_z2z_n1_fpst, a, f_vector_fscale)
843
+TRANS_FEAT(FSCALE_nn, aa64_sme2_f8cvt, do_z2z_nn_fpst, a, f_vector_fscale)
844
+
845
/* Add/Sub vector Z[m] to each Z[n*N] with result in ZA[d*N]. */
846
static bool do_azz_n1(DisasContext *s, arg_azz_n *a, int esz,
847
GVecGen3FnVar *fn)