target/arm: Implement FEAT_SVE2p2
cover target/arm: Implement FEAT_SVE2p2
Based-on: [email protected] ("[PATCH v9 00/45] target/arm: Implement FEAT_FP8")
Another batch of code on the way toward FEAT_SME2p2.
r~
Richard Henderson (25):
target/arm: Add feature predicates for SVE2.2 and SME2.2 target/arm: Rename sve unary predicated patterns target/arm: Enable zeroing in DO_ZPZ macros in sve_helper.c target/arm: Expand DO_ZPZ in translate-sve.c
target/arm: Implement SVE integer unary operations (predicated,
zeroing)
target/arm: Implement SVE bitwise unary operations (predicated,
zeroing)
target/arm: Implement SVE reverse within elements (zeroing) target/arm: Implement SVE reverse doublewords (zeroing) target/arm: Implement SVE2 integer unary operations (predicated,
zeroing)
target/arm: Add data argument to do_frint_mode
target/arm: Implement Floating-point round to integral value
(predicated, zeroing)
target/arm: Implement Floating-point convert (predicated, zeroing) target/arm: Implement Floating-point square root (predicated, zeroing) target/arm: Implement SCVTF, UCVTF (predicated, zeroing) target/arm: Implement FRINT{32,64}{X,Z}
target/arm: Enable zeroing in DO_FCVT{N,L}T macros in sve_helper.c target/arm: Implement SVE floating-point convert (top, predicated,
zeroing)
target/arm: Implement floating-point log and convert to integer
(zeroing)
target/arm: Implement EXPAND
target/arm: Generalize sve_compact_[sd]
target/arm: Implement COMPACT for byte/halfword target/arm: Implement FIRSTP, LASTP
target/arm: Enable FEAT_SVE2p2 for -cpu max
target/arm: Implement FEAT_SSVE_AES
target/arm: Use expand_pred_N for helper_sve_not_zpz_N
target/arm/cpu-features.h | 22 +- target/arm/tcg/helper-sve-defs.h | 19 + linux-user/aarch64/elfload.c | 2 + target/arm/tcg/cpu64.c | 3 +- target/arm/tcg/sve_helper.c | 184 ++++++++-- target/arm/tcg/translate-sve.c | 576 ++++++++++++++++++++++++------- docs/system/arm/emulation.rst | 2 + target/arm/tcg/sve.decode | 267 +++++++++----- 8 files changed, 841 insertions(+), 234 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/25 target/arm: Add feature predicates for SVE2.2 and SME2.2
--- target/arm/cpu-features.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
target/arm/cpu-features.h +16 -1
@@ -1501,7 +1501,12 @@ static inline bool isar_feature_aa64_sve2(const ARMISARegisters *id)static inline bool isar_feature_aa64_sve2p1 (const ARMISARegisters *id) { -return FIELD_EX64_IDREG (id,ID_AA64ZFR0 ,SVEVER ) >=2 ; +return FIELD_EX64_IDREG (id,ID_AA64ZFR0 ,SVEVER ) >=2 ; +} + +static inline bool isar_feature_aa64_sve2p2 (const ARMISARegisters *id) +{ +return FIELD_EX64_IDREG (id,ID_AA64ZFR0 ,SVEVER ) >=3 ; }static inline bool isar_feature_aa64_sve2_aes (const ARMISARegisters *id)
@@ -1610,6 +1615,11 @@ static inline bool isar_feature_aa64_sme2p1(const ARMISARegisters *id)return FIELD_EX64_IDREG (id,ID_AA64SMFR0 ,SMEVER ) >=2 ; } +static inline bool isar_feature_aa64_sme2p2 (const ARMISARegisters *id) +{ +return FIELD_EX64_IDREG (id,ID_AA64SMFR0 ,SMEVER ) >=3 ; +} +static inline bool isar_feature_aa64_f8cvt (const ARMISARegisters *id) {return FIELD_EX64_IDREG (id,ID_AA64FPFR0 ,F8CVT );
@@ -1673,6 +1683,11 @@ static inline bool isar_feature_aa64_sme2p1_or_sve2p1(const ARMISARegisters *id)return isar_feature_aa64_sme2p1 (id) ||isar_feature_aa64_sve2p1 (id); } +static inline bool isar_feature_aa64_sme2p2_or_sve2p2 (const ARMISARegisters *id) +{ +return isar_feature_aa64_sme2p2 (id) ||isar_feature_aa64_sve2p2 (id); +} +static inline bool isar_feature_aa64_sme2_i16i64 (const ARMISARegisters *id) {return isar_feature_aa64_sme2 (id) &&isar_feature_aa64_sme_i16i64 (id);
Signature · 1 line
2.43.0
Re: [PATCH 01/25] target/arm: Add feature predicates for SVE2.2 and SME2.2
Quoted 6 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/cpu-features.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
thanks
-- PMM
PATCH 2/25 target/arm: Rename sve unary predicated patterns
In reply to Richard HendersonAdd an "_m" suffix to indicate merging, in preparation for adding new predicated zeroing instructions.
--- target/arm/tcg/translate-sve.c | 169 +++++++++++++++++---------------- target/arm/tcg/sve.decode | 152 ++++++++++++++--------------- 2 files changed, 165 insertions(+), 156 deletions(-)
target/arm/tcg/translate-sve.c +89 -80
@@ -783,14 +783,14 @@ TRANS_FEAT(SEL_zpzz, aa64_sme_or_sve, do_sel_z, a->rd, a->rn, a->rm, a->pg, a->e }; \ TRANS_FEAT(NAME, FEAT, gen_gvec_ool_arg_zpz, name##_fns[a->esz], a, 0) -DO_ZPZ(CLS, aa64_sme_or_sve, sve_cls) -DO_ZPZ(CLZ, aa64_sme_or_sve, sve_clz) -DO_ZPZ(CNT_zpz, aa64_sme_or_sve, sve_cnt_zpz) -DO_ZPZ(CNOT, aa64_sme_or_sve, sve_cnot) -DO_ZPZ(NOT_zpz, aa64_sme_or_sve, sve_not_zpz) -DO_ZPZ(ABS, aa64_sme_or_sve, sve_abs) -DO_ZPZ(NEG, aa64_sme_or_sve, sve_neg) -DO_ZPZ(RBIT, aa64_sme_or_sve, sve_rbit) +DO_ZPZ(CLS_m, aa64_sme_or_sve, sve_cls) +DO_ZPZ(CLZ_m, aa64_sme_or_sve, sve_clz) +DO_ZPZ(CNT_zpz_m, aa64_sme_or_sve, sve_cnt_zpz) +DO_ZPZ(CNOT_m, aa64_sme_or_sve, sve_cnot) +DO_ZPZ(NOT_zpz_m, aa64_sme_or_sve, sve_not_zpz) +DO_ZPZ(ABS_m, aa64_sme_or_sve, sve_abs) +DO_ZPZ(NEG_m, aa64_sme_or_sve, sve_neg) +DO_ZPZ(RBIT_m, aa64_sme_or_sve, sve_rbit) DO_ZPZ(ORQV, aa64_sme2p1_or_sve2p1, sve2p1_orqv) DO_ZPZ(EORQV, aa64_sme2p1_or_sve2p1, sve2p1_eorqv)DO_ZPZ (ANDQV , aa64_sme2p1_or_sve2p1, sve2p1_andqv)
@@ -803,7 +803,7 @@ static gen_helper_gvec_3 * const fabs_ah_fns[4] = {NULL , gen_helper_sve_ah_fabs_h, gen_helper_sve_ah_fabs_s, gen_helper_sve_ah_fabs_d, }; -TRANS_FEAT (FABS , aa64_sme_or_sve, gen_gvec_ool_arg_zpz, +TRANS_FEAT (FABS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, s->fpcr_ah ? fabs_ah_fns[a->esz] : fabs_fns[a->esz], a, 0) static gen_helper_gvec_3 * const fneg_fns[4] = {
@@ -814,34 +814,38 @@ static gen_helper_gvec_3 * const fneg_ah_fns[4] = {NULL , gen_helper_sve_ah_fneg_h, gen_helper_sve_ah_fneg_s, gen_helper_sve_ah_fneg_d, }; -TRANS_FEAT (FNEG , aa64_sme_or_sve, gen_gvec_ool_arg_zpz, +TRANS_FEAT (FNEG_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, s->fpcr_ah ? fneg_ah_fns[a->esz] : fneg_fns[a->esz], a, 0)static gen_helper_gvec_3 *const sxtb_fns[4 ] = {NULL , gen_helper_sve_sxtb_h, gen_helper_sve_sxtb_s, gen_helper_sve_sxtb_d, }; -TRANS_FEAT(SXTB, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sxtb_fns[a->esz], a, 0) +TRANS_FEAT (SXTB_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + sxtb_fns[a->esz], a, 0)static gen_helper_gvec_3 *const uxtb_fns[4 ] = {NULL , gen_helper_sve_uxtb_h, gen_helper_sve_uxtb_s, gen_helper_sve_uxtb_d, }; -TRANS_FEAT(UXTB, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, uxtb_fns[a->esz], a, 0) +TRANS_FEAT (UXTB_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + uxtb_fns[a->esz], a, 0)static gen_helper_gvec_3 *const sxth_fns[4 ] = {NULL ,NULL , gen_helper_sve_sxth_s, gen_helper_sve_sxth_d }; -TRANS_FEAT(SXTH, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sxth_fns[a->esz], a, 0) +TRANS_FEAT (SXTH_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + sxth_fns[a->esz], a, 0)static gen_helper_gvec_3 *const uxth_fns[4 ] = {NULL ,NULL , gen_helper_sve_uxth_s, gen_helper_sve_uxth_d }; -TRANS_FEAT(UXTH, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, uxth_fns[a->esz], a, 0) +TRANS_FEAT (UXTH_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + uxth_fns[a->esz], a, 0) -TRANS_FEAT (SXTW , aa64_sme_or_sve, gen_gvec_ool_arg_zpz, +TRANS_FEAT (SXTW_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_sxtw_d : NULL, a, 0) -TRANS_FEAT (UXTW , aa64_sme_or_sve, gen_gvec_ool_arg_zpz, +TRANS_FEAT (UXTW_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_uxtw_d : NULL, a, 0) static gen_helper_gvec_3 * const addqv_fns[4] = {
@@ -2984,17 +2988,19 @@ static gen_helper_gvec_3 * const revb_fns[4] = {NULL , gen_helper_sve_revb_h, gen_helper_sve_revb_s, gen_helper_sve_revb_d, }; -TRANS_FEAT(REVB, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, revb_fns[a->esz], a, 0) +TRANS_FEAT (REVB_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + revb_fns[a->esz], a, 0)static gen_helper_gvec_3 *const revh_fns[4 ] = {NULL ,NULL , gen_helper_sve_revh_s, gen_helper_sve_revh_d, }; -TRANS_FEAT(REVH, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, revh_fns[a->esz], a, 0) +TRANS_FEAT (REVH_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + revh_fns[a->esz], a, 0) -TRANS_FEAT (REVW , aa64_sme_or_sve, gen_gvec_ool_arg_zpz, +TRANS_FEAT (REVW_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 0) -TRANS_FEAT (REVD , aa64_sme_or_sve2p1, gen_gvec_ool_arg_zpz, +TRANS_FEAT (REVD_m, aa64_sme_or_sve2p1, gen_gvec_ool_arg_zpz, gen_helper_sme_revd_q, a, 0) TRANS_FEAT(SPLICE, aa64_sme_or_sve, gen_gvec_ool_arg_zpzz,
@@ -4491,53 +4497,53 @@ TRANS_FEAT(FCMLA_zzxz, aa64_sme_or_sve, gen_gvec_fpst_zzzz, fcmla_idx_fns[a->esz*** SVE Floating Point Unary Operations Predicated Group */ -TRANS_FEAT (FCVT_sh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVT_sh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_sh, a, 0, FPST_A64) -TRANS_FEAT (FCVT_hs, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVT_hs_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_hs, a, 0, FPST_A64_F16) -TRANS_FEAT (BFCVT , aa64_sme_sve_bf16, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (BFCVT_m, aa64_sme_sve_bf16, gen_gvec_fpst_arg_zpz, gen_helper_sve_bfcvt, a,0 , s->fpcr_ah ? FPST_AH : FPST_A64) -TRANS_FEAT (FCVT_dh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVT_dh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_dh, a, 0, FPST_A64) -TRANS_FEAT (FCVT_hd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVT_hd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_hd, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVT_ds, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVT_ds_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_ds, a, 0, FPST_A64) -TRANS_FEAT (FCVT_sd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVT_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_sd, a, 0, FPST_A64) -TRANS_FEAT (FCVTZS_hh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_hh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_hh, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTZU_hh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_hh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_hh, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTZS_hs, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_hs_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_hs, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTZU_hs, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_hs_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_hs, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTZS_hd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_hd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_hd, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTZU_hd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_hd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_hd, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTZS_ss, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_ss_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_ss, a, 0, FPST_A64) -TRANS_FEAT (FCVTZU_ss, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_ss_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_ss, a, 0, FPST_A64) -TRANS_FEAT (FCVTZS_sd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_sd, a, 0, FPST_A64) -TRANS_FEAT (FCVTZU_sd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_sd, a, 0, FPST_A64) -TRANS_FEAT (FCVTZS_ds, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_ds_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_ds, a, 0, FPST_A64) -TRANS_FEAT (FCVTZU_ds, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_ds_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_ds, a, 0, FPST_A64) -TRANS_FEAT (FCVTZS_dd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZS_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_dd, a, 0, FPST_A64) -TRANS_FEAT (FCVTZU_dd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTZU_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_dd, a, 0, FPST_A64)static gen_helper_gvec_3_ptr *const frint_fns[] = {
@@ -4546,8 +4552,9 @@ static gen_helper_gvec_3_ptr * const frint_fns[] = { gen_helper_sve_frint_s, gen_helper_sve_frint_d }; -TRANS_FEAT (FRINTI , aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, frint_fns[a->esz], - a, 0, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) +TRANS_FEAT (FRINTI_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, + frint_fns[a->esz], a,0 , + a->esz == MO_16 ? FPST_A64_F16 : FPST_A64)static gen_helper_gvec_3_ptr *const frintx_fns[] = { NULL,
@@ -4555,8 +4562,9 @@ static gen_helper_gvec_3_ptr * const frintx_fns[] = { gen_helper_sve_frintx_s, gen_helper_sve_frintx_d }; -TRANS_FEAT (FRINTX , aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, frintx_fns[a->esz], - a,0 , a->esz ==MO_16 ?FPST_A64_F16 :FPST_A64 ); +TRANS_FEAT (FRINTX_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, + frintx_fns[a->esz], a,0 , + a->esz ==MO_16 ?FPST_A64_F16 :FPST_A64 );static bool do_frint_mode (DisasContext *s,arg_rpr_esz *a,ARMFPRounding mode,gen_helper_gvec_3_ptr *fn)
@@ -4585,63 +4593,64 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a,return true; } -TRANS_FEAT (FRINTN , aa64_sme_or_sve, do_frint_mode, a, +TRANS_FEAT (FRINTN_m, aa64_sme_or_sve, do_frint_mode, a, FPROUNDING_TIEEVEN, frint_fns[a->esz]) -TRANS_FEAT (FRINTP , aa64_sme_or_sve, do_frint_mode, a, +TRANS_FEAT (FRINTP_m, aa64_sme_or_sve, do_frint_mode, a, FPROUNDING_POSINF, frint_fns[a->esz]) -TRANS_FEAT (FRINTM , aa64_sme_or_sve, do_frint_mode, a, +TRANS_FEAT (FRINTM_m, aa64_sme_or_sve, do_frint_mode, a, FPROUNDING_NEGINF, frint_fns[a->esz]) -TRANS_FEAT (FRINTZ , aa64_sme_or_sve, do_frint_mode, a, +TRANS_FEAT (FRINTZ_m, aa64_sme_or_sve, do_frint_mode, a, FPROUNDING_ZERO, frint_fns[a->esz]) -TRANS_FEAT (FRINTA , aa64_sme_or_sve, do_frint_mode, a, +TRANS_FEAT (FRINTA_m, aa64_sme_or_sve, do_frint_mode, a, FPROUNDING_TIEAWAY, frint_fns[a->esz])static gen_helper_gvec_3_ptr *const frecpx_fns[] = {NULL , gen_helper_sve_frecpx_h, gen_helper_sve_frecpx_s, gen_helper_sve_frecpx_d, }; -TRANS_FEAT (FRECPX , aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, frecpx_fns[a->esz], - a, 0, select_ah_fpst(s, a->esz)) +TRANS_FEAT (FRECPX_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, + frecpx_fns[a->esz], a, 0, select_ah_fpst(s, a->esz))static gen_helper_gvec_3_ptr *const fsqrt_fns[] = {NULL , gen_helper_sve_fsqrt_h, gen_helper_sve_fsqrt_s, gen_helper_sve_fsqrt_d, }; -TRANS_FEAT (FSQRT , aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, fsqrt_fns[a->esz], - a, 0, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) +TRANS_FEAT (FSQRT_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, + fsqrt_fns[a->esz], a,0 , + a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) -TRANS_FEAT (SCVTF_hh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_hh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_hh, a, 0, FPST_A64_F16) -TRANS_FEAT (SCVTF_sh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_sh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_sh, a, 0, FPST_A64_F16) -TRANS_FEAT (SCVTF_dh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_dh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_dh, a, 0, FPST_A64_F16) -TRANS_FEAT (SCVTF_ss, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_ss_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_ss, a, 0, FPST_A64) -TRANS_FEAT (SCVTF_ds, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_ds_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_ds, a, 0, FPST_A64) -TRANS_FEAT (SCVTF_sd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_sd, a, 0, FPST_A64) -TRANS_FEAT (SCVTF_dd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (SCVTF_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_dd, a, 0, FPST_A64) -TRANS_FEAT (UCVTF_hh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_hh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_hh, a, 0, FPST_A64_F16) -TRANS_FEAT (UCVTF_sh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_sh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_sh, a, 0, FPST_A64_F16) -TRANS_FEAT (UCVTF_dh, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_dh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_dh, a, 0, FPST_A64_F16) -TRANS_FEAT (UCVTF_ss, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_ss_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_ss, a, 0, FPST_A64) -TRANS_FEAT (UCVTF_ds, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_ds_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_ds, a, 0, FPST_A64) -TRANS_FEAT (UCVTF_sd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_sd, a, 0, FPST_A64) -TRANS_FEAT (UCVTF_dd, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (UCVTF_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_dd, a,0 ,FPST_A64 )/*
@@ -6691,23 +6700,23 @@ TRANS_FEAT(UADALP_zpzz, aa64_sme_or_sve2, gen_gvec_ool_arg_zpzz,* SVE2 integer unary operations (predicated) */ -TRANS_FEAT (URECPE , aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, +TRANS_FEAT (URECPE_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, a->esz == 2 ? gen_helper_sve2_urecpe_s : NULL, a, 0) -TRANS_FEAT (URSQRTE , aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, +TRANS_FEAT (URSQRTE_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, a->esz == 2 ? gen_helper_sve2_ursqrte_s : NULL, a, 0)static gen_helper_gvec_3 *const sqabs_fns[4 ] = { gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h, gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d, }; -TRANS_FEAT(SQABS, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 0) +TRANS_FEAT(SQABS_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 0)static gen_helper_gvec_3 *const sqneg_fns[4 ] = { gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h, gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d, }; -TRANS_FEAT(SQNEG, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) +TRANS_FEAT(SQNEG_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) DO_ZPZZ(SQSHL, aa64_sme_or_sve2, sve2_sqshl)DO_ZPZZ (SQRSHL , aa64_sme_or_sve2, sve2_sqrshl)
@@ -7879,30 +7888,30 @@ static bool trans_RAX1(DisasContext *s, arg_RAX1 *a)return gen_gvec_fn_arg_zzz (s, gen_gvec_rax1, a); } -TRANS_FEAT (FCVTNT_sh, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTNT_sh_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtnt_sh, a, 0, FPST_A64) -TRANS_FEAT (FCVTNT_ds, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTNT_ds_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtnt_ds, a, 0, FPST_A64) -TRANS_FEAT (BFCVTNT , aa64_sme_sve_bf16, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (BFCVTNT_m, aa64_sme_sve_bf16, gen_gvec_fpst_arg_zpz, gen_helper_sve_bfcvtnt, a,0 , s->fpcr_ah ? FPST_AH : FPST_A64) -TRANS_FEAT (FCVTLT_hs, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTLT_hs_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_hs, a, 0, FPST_A64_F16) -TRANS_FEAT (FCVTLT_sd, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, +TRANS_FEAT (FCVTLT_sd_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_sd, a, 0, FPST_A64) -TRANS_FEAT (FCVTX_ds, aa64_sme_or_sve2, do_frint_mode, a, +TRANS_FEAT (FCVTX_ds_m, aa64_sme_or_sve2, do_frint_mode, a, FPROUNDING_ODD, gen_helper_sve_fcvt_ds) -TRANS_FEAT (FCVTXNT_ds, aa64_sme_or_sve2, do_frint_mode, a, +TRANS_FEAT (FCVTXNT_ds_m, aa64_sme_or_sve2, do_frint_mode, a, FPROUNDING_ODD, gen_helper_sve2_fcvtnt_ds)static gen_helper_gvec_3_ptr *const flogb_fns[] = {NULL , gen_helper_flogb_h, gen_helper_flogb_s, gen_helper_flogb_d }; -TRANS_FEAT (FLOGB , aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, flogb_fns[a->esz], +TRANS_FEAT (FLOGB_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, flogb_fns[a->esz], a, 0, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64)static bool do_FMLAL_zzzw (DisasContext *s,arg_rrrr_esz *a,bool sub,bool sel)
target/arm/tcg/sve.decode +76 -76
196 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH 02/25] target/arm: Rename sve unary predicated patterns
Quoted 5 lines · Richard Henderson
Add an "_m" suffix to indicate merging, in preparation for adding new predicated zeroing instructions.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 3/25 target/arm: Enable zeroing in DO_ZPZ macros in sve_helper.c
In reply to Richard HendersonUse the low bit of simd_data to hold a 'zeroing' bit. The simd_data field is currently unused and always 0.
--- target/arm/tcg/sve_helper.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
target/arm/tcg/sve_helper.c +12 -3
@@ -823,18 +823,20 @@ DO_ZPZW(sve_lsl_zpzw_s, uint32_t, uint64_t, H1_4, DO_LSL)#undef DO_ZPZW -/* Fully general two-operand expander, controlled by a predicate. -*/ +/* Fully general two-operand expander, controlled by a predicate. */ #define DO_ZPZ (NAME ,TYPE ,H ,OP ) \ void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ { \ intptr_t i, opr_sz = simd_oprsz(desc); \ + bool zeroing = simd_data(desc) & 1; \ for (i = 0; i < opr_sz; ) { \ uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ do { \ if (pg & 1) { \ TYPE nn = *(TYPE *)(vn + H(i)); \ *(TYPE *)(vd + H(i)) = OP(nn); \ + } else if (zeroing) { \ + *(TYPE *)(vd + H(i)) = 0; \ } \ i += sizeof(TYPE), pg >>= sizeof(TYPE); \ } while (i & 15); \
@@ -846,12 +848,15 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \void HELPER (NAME )(void *vd,void *vn,void *vg,uint32_t desc) \ { \intptr_t i, opr_sz =simd_oprsz (desc) /8 ; \ +bool zeroing =simd_data (desc) &1 ; \TYPE *d = vd, *n = vn; \uint8_t *pg = vg; \for (i =0 ; i < opr_sz; i +=1 ) { \if (pg[H1 (i)] &1 ) { \TYPE nn = n[i]; \ d[i] =OP (nn); \ + }else if (zeroing) { \ + d[i] =0 ; \ } \ } \ }
@@ -4831,7 +4836,8 @@ DO_ZPZS_FP(sve_ah_fmins_h, float16, H1_2, helper_vfp_ah_minh) DO_ZPZS_FP(sve_ah_fmins_s, float32, H1_4, helper_vfp_ah_mins)DO_ZPZS_FP (sve_ah_fmins_d, float64,H1_8 , helper_vfp_ah_mind) -/* Fully general two-operand expander, controlled by a predicate, +/* +* Fully general two-operand expander, controlled by a predicate, * With the extra float_status parameter. */#define DO_ZPZ_FP (NAME ,TYPE ,H ,OP ) \
@@ -4839,6 +4845,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \ float_status *status, uint32_t desc) \ { \intptr_t i =simd_oprsz (desc); \ +bool zeroing =simd_data (desc) &1 ; \uint64_t *g = vg; \ do { \ uint64_t pg = g[(i - 1) >> 6]; \
@@ -4847,6 +4854,8 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \if (likely ((pg >> (i &63 )) &1 )) { \TYPE nn = *(TYPE *)(vn +H (i)); \ *(TYPE *)(vd +H (i)) =OP (nn, status); \ + }else if (zeroing) { \ + *(TYPE *)(vd +H (i)) =0 ; \ } \ }while (i &63 ); \ }while (i !=0 ); \
Signature · 1 line
2.43.0
Re: [PATCH 03/25] target/arm: Enable zeroing in DO_ZPZ macros in sve_helper.c
Quoted 9 lines · Richard Henderson
Use the low bit of
simd_datato hold a 'zeroing' bit. Thesimd_datafield is currently unused and always 0.Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/sve_helper.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
thanks
-- PMM
PATCH 4/25 target/arm: Expand DO_ZPZ in translate-sve.c
In reply to Richard HendersonPrepare for adding zeroing instructions for some of these.
--- target/arm/tcg/translate-sve.c | 84 +++++++++++++++++++++++++++------- 1 file changed, 67 insertions(+), 17 deletions(-)
target/arm/tcg/translate-sve.c +67 -17
@@ -776,24 +776,74 @@ TRANS_FEAT(SEL_zpzz, aa64_sme_or_sve, do_sel_z, a->rd, a->rn, a->rm, a->pg, a->e*** SVE Integer Arithmetic - Unary Predicated Group */ -#define DO_ZPZ (NAME ,FEAT , name) \ - static gen_helper_gvec_3 * const name##_fns[4] = { \ - gen_helper_##name##_b, gen_helper_##name##_h, \ - gen_helper_##name##_s, gen_helper_##name##_d, \ - }; \ - TRANS_FEAT(NAME, FEAT, gen_gvec_ool_arg_zpz, name##_fns[a->esz], a, 0) +static gen_helper_gvec_3 *const sve_cls_fns[4 ] = { + gen_helper_sve_cls_b, gen_helper_sve_cls_h, + gen_helper_sve_cls_s, gen_helper_sve_cls_d, +}; +TRANS_FEAT(CLS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cls_fns[a->esz], a, 0) -DO_ZPZ(CLS_m, aa64_sme_or_sve, sve_cls) -DO_ZPZ(CLZ_m, aa64_sme_or_sve, sve_clz) -DO_ZPZ(CNT_zpz_m, aa64_sme_or_sve, sve_cnt_zpz) -DO_ZPZ(CNOT_m, aa64_sme_or_sve, sve_cnot) -DO_ZPZ(NOT_zpz_m, aa64_sme_or_sve, sve_not_zpz) -DO_ZPZ(ABS_m, aa64_sme_or_sve, sve_abs) -DO_ZPZ(NEG_m, aa64_sme_or_sve, sve_neg) -DO_ZPZ(RBIT_m, aa64_sme_or_sve, sve_rbit) -DO_ZPZ(ORQV, aa64_sme2p1_or_sve2p1, sve2p1_orqv) -DO_ZPZ(EORQV, aa64_sme2p1_or_sve2p1, sve2p1_eorqv) -DO_ZPZ(ANDQV, aa64_sme2p1_or_sve2p1, sve2p1_andqv) +static gen_helper_gvec_3 *const sve_clz_fns[4 ] = { + gen_helper_sve_clz_b, gen_helper_sve_clz_h, + gen_helper_sve_clz_s, gen_helper_sve_clz_d, +}; +TRANS_FEAT(CLZ_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_clz_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve_cnt_zpz_fns[4 ] = { + gen_helper_sve_cnt_zpz_b, gen_helper_sve_cnt_zpz_h, + gen_helper_sve_cnt_zpz_s, gen_helper_sve_cnt_zpz_d, +}; +TRANS_FEAT(CNT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cnt_zpz_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve_cnot_fns[4 ] = { + gen_helper_sve_cnot_b, gen_helper_sve_cnot_h, + gen_helper_sve_cnot_s, gen_helper_sve_cnot_d, +}; +TRANS_FEAT(CNOT_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cnot_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve_not_zpz_fns[4 ] = { + gen_helper_sve_not_zpz_b, gen_helper_sve_not_zpz_h, + gen_helper_sve_not_zpz_s, gen_helper_sve_not_zpz_d, +}; +TRANS_FEAT(NOT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_not_zpz_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve_abs_fns[4 ] = { + gen_helper_sve_abs_b, gen_helper_sve_abs_h, + gen_helper_sve_abs_s, gen_helper_sve_abs_d, +}; +TRANS_FEAT(ABS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_abs_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve_neg_fns[4 ] = { + gen_helper_sve_neg_b, gen_helper_sve_neg_h, + gen_helper_sve_neg_s, gen_helper_sve_neg_d, +}; +TRANS_FEAT(NEG_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_neg_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve_rbit_fns[4 ] = { + gen_helper_sve_rbit_b, gen_helper_sve_rbit_h, + gen_helper_sve_rbit_s, gen_helper_sve_rbit_d, +}; +TRANS_FEAT(RBIT_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_rbit_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve2p1_orqv_fns[4 ] = { + gen_helper_sve2p1_orqv_b, gen_helper_sve2p1_orqv_h, + gen_helper_sve2p1_orqv_s, gen_helper_sve2p1_orqv_d, +}; +TRANS_FEAT (ORQV , aa64_sme2p1_or_sve2p1, gen_gvec_ool_arg_zpz, + sve2p1_orqv_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve2p1_eorqv_fns[4 ] = { + gen_helper_sve2p1_eorqv_b, gen_helper_sve2p1_eorqv_h, + gen_helper_sve2p1_eorqv_s, gen_helper_sve2p1_eorqv_d, +}; +TRANS_FEAT (EORQV , aa64_sme2p1_or_sve2p1, gen_gvec_ool_arg_zpz, + sve2p1_eorqv_fns[a->esz], a, 0) + +static gen_helper_gvec_3 *const sve2p1_andqv_fns[4 ] = { + gen_helper_sve2p1_andqv_b, gen_helper_sve2p1_andqv_h, + gen_helper_sve2p1_andqv_s, gen_helper_sve2p1_andqv_d, +}; +TRANS_FEAT (ANDQV , aa64_sme2p1_or_sve2p1, gen_gvec_ool_arg_zpz, + sve2p1_andqv_fns[a->esz], a, 0)static gen_helper_gvec_3 *const fabs_fns[4 ] = {NULL , gen_helper_sve_fabs_h,
Signature · 1 line
2.43.0
Re: [PATCH 04/25] target/arm: Expand DO_ZPZ in translate-sve.c
Quoted 4 lines · Richard Henderson
Prepare for adding zeroing instructions for some of these.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 5/25 target/arm: Implement SVE integer unary operations (predicated, zeroing)
In reply to Richard HendersonThis includes ABS, NEG, SXT{B,H,W}.
--- target/arm/tcg/translate-sve.c | 15 +++++++++++++++ target/arm/tcg/sve.decode | 9 +++++++++ 2 files changed, 24 insertions(+)
target/arm/tcg/translate-sve.c +15 -0
@@ -811,12 +811,14 @@ static gen_helper_gvec_3 * const sve_abs_fns[4] = { gen_helper_sve_abs_s, gen_helper_sve_abs_d, }; TRANS_FEAT(ABS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_abs_fns[a->esz], a, 0) +TRANS_FEAT(ABS_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_abs_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_neg_fns[4 ] = { gen_helper_sve_neg_b, gen_helper_sve_neg_h, gen_helper_sve_neg_s, gen_helper_sve_neg_d, }; TRANS_FEAT(NEG_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_neg_fns[a->esz], a, 0) +TRANS_FEAT(NEG_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_neg_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_rbit_fns[4 ] = { gen_helper_sve_rbit_b, gen_helper_sve_rbit_h,
@@ -873,6 +875,8 @@ static gen_helper_gvec_3 * const sxtb_fns[4] = { };TRANS_FEAT (SXTB_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sxtb_fns[a->esz], a, 0) +TRANS_FEAT (SXTB_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + sxtb_fns[a->esz], a, 1)static gen_helper_gvec_3 *const uxtb_fns[4 ] = {NULL , gen_helper_sve_uxtb_h,
@@ -880,23 +884,34 @@ static gen_helper_gvec_3 * const uxtb_fns[4] = { };TRANS_FEAT (UXTB_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, uxtb_fns[a->esz], a, 0) +TRANS_FEAT (UXTB_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + uxtb_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sxth_fns[4 ] = {NULL ,NULL , gen_helper_sve_sxth_s, gen_helper_sve_sxth_d };TRANS_FEAT (SXTH_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sxth_fns[a->esz], a, 0) +TRANS_FEAT (SXTH_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + sxth_fns[a->esz], a, 1)static gen_helper_gvec_3 *const uxth_fns[4 ] = {NULL ,NULL , gen_helper_sve_uxth_s, gen_helper_sve_uxth_d };TRANS_FEAT (UXTH_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, uxth_fns[a->esz], a, 0) +TRANS_FEAT (UXTH_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + uxth_fns[a->esz], a, 1)TRANS_FEAT (SXTW_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_sxtw_d : NULL, a, 0) +TRANS_FEAT (SXTW_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + a->esz == 3 ? gen_helper_sve_sxtw_d : NULL, a, 1) +TRANS_FEAT (UXTW_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_uxtw_d : NULL, a, 0) +TRANS_FEAT (UXTW_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + a->esz == 3 ? gen_helper_sve_uxtw_d : NULL, a, 1)static gen_helper_gvec_3 *const addqv_fns[4 ] = { gen_helper_sve2p1_addqv_b, gen_helper_sve2p1_addqv_h,
target/arm/tcg/sve.decode +9 -0
@@ -411,6 +411,15 @@ UXTH_m 00000100 .. 010 011 101 ... ..... ..... @rd_pg_rn SXTW_m 00000100 .. 010 100 101 ... ..... ..... @rd_pg_rn UXTW_m 00000100 .. 010 101 101 ... ..... ..... @rd_pg_rn +ABS_z 00000100 .. 000 110 101 ... ..... ..... @rd_pg_rn +NEG_z 00000100 .. 000 111 101 ... ..... ..... @rd_pg_rn +SXTB_z 00000100 .. 000 000 101 ... ..... ..... @rd_pg_rn +UXTB_z 00000100 .. 000 001 101 ... ..... ..... @rd_pg_rn +SXTH_z 00000100 .. 000 010 101 ... ..... ..... @rd_pg_rn +UXTH_z 00000100 .. 000 011 101 ... ..... ..... @rd_pg_rn +SXTW_z 00000100 .. 000 100 101 ... ..... ..... @rd_pg_rn +UXTW_z 00000100 .. 000 101 101 ... ..... ..... @rd_pg_rn + ### SVE Floating Point Compare - Vectors Group # SVE floating-point compare vectors
Signature · 1 line
2.43.0
Re: [PATCH 05/25] target/arm: Implement SVE integer unary operations (predicated, zeroing)
Quoted 8 lines · Richard Henderson
This includes ABS, NEG, SXT{B,H,W}.
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/translate-sve.c | 15 +++++++++++++++ target/arm/tcg/sve.decode | 9 +++++++++ 2 files changed, 24 insertions(+)
thanks
-- PMM
PATCH 6/25 target/arm: Implement SVE bitwise unary operations (predicated, zeroing)
In reply to Richard HendersonThis includes CLS, CLZ, CNT, CNOT, NOT, FABS, FNEG.
--- target/arm/tcg/translate-sve.c | 21 ++++++++++++++++++--- target/arm/tcg/sve.decode | 8 ++++++++ 2 files changed, 26 insertions(+), 3 deletions(-)
target/arm/tcg/translate-sve.c +18 -3
@@ -781,30 +781,41 @@ static gen_helper_gvec_3 * const sve_cls_fns[4] = { gen_helper_sve_cls_s, gen_helper_sve_cls_d, }; TRANS_FEAT(CLS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cls_fns[a->esz], a, 0) +TRANS_FEAT(CLS_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_cls_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_clz_fns[4 ] = { gen_helper_sve_clz_b, gen_helper_sve_clz_h, gen_helper_sve_clz_s, gen_helper_sve_clz_d, }; TRANS_FEAT(CLZ_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_clz_fns[a->esz], a, 0) +TRANS_FEAT(CLZ_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_clz_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_cnt_zpz_fns[4 ] = { gen_helper_sve_cnt_zpz_b, gen_helper_sve_cnt_zpz_h, gen_helper_sve_cnt_zpz_s, gen_helper_sve_cnt_zpz_d, }; -TRANS_FEAT(CNT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cnt_zpz_fns[a->esz], a, 0) +TRANS_FEAT (CNT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + sve_cnt_zpz_fns[a->esz], a, 0) +TRANS_FEAT (CNT_zpz_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + sve_cnt_zpz_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_cnot_fns[4 ] = { gen_helper_sve_cnot_b, gen_helper_sve_cnot_h, gen_helper_sve_cnot_s, gen_helper_sve_cnot_d, }; -TRANS_FEAT(CNOT_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cnot_fns[a->esz], a, 0) +TRANS_FEAT (CNOT_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + sve_cnot_fns[a->esz], a, 0) +TRANS_FEAT (CNOT_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + sve_cnot_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_not_zpz_fns[4 ] = { gen_helper_sve_not_zpz_b, gen_helper_sve_not_zpz_h, gen_helper_sve_not_zpz_s, gen_helper_sve_not_zpz_d, }; -TRANS_FEAT(NOT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_not_zpz_fns[a->esz], a, 0) +TRANS_FEAT (NOT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + sve_not_zpz_fns[a->esz], a, 0) +TRANS_FEAT (NOT_zpz_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + sve_not_zpz_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_abs_fns[4 ] = { gen_helper_sve_abs_b, gen_helper_sve_abs_h,
@@ -857,6 +868,8 @@ static gen_helper_gvec_3 * const fabs_ah_fns[4] = { };TRANS_FEAT (FABS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, s->fpcr_ah ? fabs_ah_fns[a->esz] : fabs_fns[a->esz], a, 0) +TRANS_FEAT (FABS_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + s->fpcr_ah ? fabs_ah_fns[a->esz] : fabs_fns[a->esz], a, 1)static gen_helper_gvec_3 *const fneg_fns[4 ] = {NULL , gen_helper_sve_fneg_h,
@@ -868,6 +881,8 @@ static gen_helper_gvec_3 * const fneg_ah_fns[4] = { };TRANS_FEAT (FNEG_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, s->fpcr_ah ? fneg_ah_fns[a->esz] : fneg_fns[a->esz], a, 0) +TRANS_FEAT (FNEG_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + s->fpcr_ah ? fneg_ah_fns[a->esz] : fneg_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sxtb_fns[4 ] = {NULL , gen_helper_sve_sxtb_h,
target/arm/tcg/sve.decode +8 -0
@@ -400,6 +400,14 @@ NOT_zpz_m 00000100 .. 011 110 101 ... ..... ..... @rd_pg_rn FABS_m 00000100 .. 011 100 101 ... ..... ..... @rd_pg_rn FNEG_m 00000100 .. 011 101 101 ... ..... ..... @rd_pg_rn +CLS_z 00000100 .. 001 000 101 ... ..... ..... @rd_pg_rn +CLZ_z 00000100 .. 001 001 101 ... ..... ..... @rd_pg_rn +CNT_zpz_z 00000100 .. 001 010 101 ... ..... ..... @rd_pg_rn +CNOT_z 00000100 .. 001 011 101 ... ..... ..... @rd_pg_rn +NOT_zpz_z 00000100 .. 001 110 101 ... ..... ..... @rd_pg_rn +FABS_z 00000100 .. 001 100 101 ... ..... ..... @rd_pg_rn +FNEG_z 00000100 .. 001 101 101 ... ..... ..... @rd_pg_rn + # SVE integer unary operations (predicated) # Note esz > original size for extensions. ABS_m 00000100 .. 010 110 101 ... ..... ..... @rd_pg_rn
Signature · 1 line
2.43.0
Re: [PATCH 06/25] target/arm: Implement SVE bitwise unary operations (predicated, zeroing)
Quoted 25 lines · Richard Henderson
This includes CLS, CLZ, CNT, CNOT, NOT, FABS, FNEG.
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/translate-sve.c | 21 ++++++++++++++++++--- target/arm/tcg/sve.decode | 8 ++++++++ 2 files changed, 26 insertions(+), 3 deletions(-)target/arm/tcg/translate-sve.c +2
-0@@ -781,30 +781,41 @@ static gen_helper_gvec_3 * const sve_cls_fns[4] = { gen_helper_sve_cls_s, gen_helper_sve_cls_d, }; TRANS_FEAT(CLS_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cls_fns[a->esz], a, 0) +TRANS_FEAT(CLS_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_cls_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve_clz_fns[4 ] = { gen_helper_sve_clz_b, gen_helper_sve_clz_h, gen_helper_sve_clz_s, gen_helper_sve_clz_d, }; TRANS_FEAT(CLZ_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_clz_fns[a->esz], a, 0) +TRANS_FEAT (CLZ_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_clz_fns[a->esz], a,1 )
target/arm/tcg/translate-sve.c static gen_helper_gvec_3 * const sve_cls_fns[4] = { · line 800
Quoted 10 lines
target/arm/tcg/translate-sve.c +4
-1static gen_helper_gvec_3 *const sve_cnt_zpz_fns[4 ] = { gen_helper_sve_cnt_zpz_b, gen_helper_sve_cnt_zpz_h, gen_helper_sve_cnt_zpz_s, gen_helper_sve_cnt_zpz_d, }; -TRANS_FEAT (CNT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_cnt_zpz_fns[a->esz], a,0 ) +TRANS_FEAT (CNT_zpz_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, + sve_cnt_zpz_fns[a->esz], a, 0) +TRANS_FEAT (CNT_zpz_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + sve_cnt_zpz_fns[a->esz], a,1 )
With this and the others below, if we want to wrap then we should wrap the CNT_zpz_m line in the earlier patch where we added it, not add it unwrapped and then wrap here.
(If there's nothing else in the series that needs a respin, it's not worth respinning just for this.)
thanks
-- PMM
PATCH 7/25 target/arm: Implement SVE reverse within elements (zeroing)
In reply to Richard HendersonThis includes REVB, REVH, REVW, RBIT.
--- target/arm/tcg/translate-sve.c | 7 +++++++ target/arm/tcg/sve.decode | 5 +++++ 2 files changed, 12 insertions(+)
target/arm/tcg/translate-sve.c +7 -0
@@ -836,6 +836,7 @@ static gen_helper_gvec_3 * const sve_rbit_fns[4] = { gen_helper_sve_rbit_s, gen_helper_sve_rbit_d, }; TRANS_FEAT(RBIT_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, sve_rbit_fns[a->esz], a, 0) +TRANS_FEAT(RBIT_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sve_rbit_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sve2p1_orqv_fns[4 ] = { gen_helper_sve2p1_orqv_b, gen_helper_sve2p1_orqv_h,
@@ -3070,15 +3071,21 @@ static gen_helper_gvec_3 * const revb_fns[4] = { };TRANS_FEAT (REVB_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, revb_fns[a->esz], a, 0) +TRANS_FEAT (REVB_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + revb_fns[a->esz], a, 1)static gen_helper_gvec_3 *const revh_fns[4 ] = {NULL ,NULL , gen_helper_sve_revh_s, gen_helper_sve_revh_d, };TRANS_FEAT (REVH_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, revh_fns[a->esz], a, 0) +TRANS_FEAT (REVH_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + revh_fns[a->esz], a, 1)TRANS_FEAT (REVW_m, aa64_sme_or_sve, gen_gvec_ool_arg_zpz, a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 0) +TRANS_FEAT (REVW_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + a->esz == 3 ? gen_helper_sve_revw_d : NULL, a, 1)TRANS_FEAT (REVD_m, aa64_sme_or_sve2p1, gen_gvec_ool_arg_zpz, gen_helper_sme_revd_q, a,0 )
target/arm/tcg/sve.decode +5 -0
@@ -730,6 +730,11 @@ REVW_m 00000101 .. 1001 10 100 ... ..... ..... @rd_pg_rn RBIT_m 00000101 .. 1001 11 100 ... ..... ..... @rd_pg_rn REVD_m 00000101 00 1011 10 100 ... ..... ..... @rd_pg_rn_e0 +REVB_z 00000101 .. 1001 00 101 ... ..... ..... @rd_pg_rn +REVH_z 00000101 .. 1001 01 101 ... ..... ..... @rd_pg_rn +REVW_z 00000101 .. 1001 10 101 ... ..... ..... @rd_pg_rn +RBIT_z 00000101 .. 1001 11 101 ... ..... ..... @rd_pg_rn + # SVE vector splice (predicated, destructive) SPLICE 00000101 .. 101 100 100 ... ..... ..... @rdn_pg_rm
Signature · 1 line
2.43.0
Re: [PATCH 07/25] target/arm: Implement SVE reverse within elements (zeroing)
Quoted 4 lines · Richard Henderson
This includes REVB, REVH, REVW, RBIT.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 8/25 target/arm: Implement SVE reverse doublewords (zeroing)
In reply to Richard Henderson--- target/arm/tcg/sve_helper.c | 4 ++++ target/arm/tcg/translate-sve.c | 2 ++ target/arm/tcg/sve.decode | 1 + 3 files changed, 7 insertions(+)
target/arm/tcg/sve_helper.c +4 -0
@@ -971,6 +971,7 @@ DO_ZPZ_D(sve_revw_d, uint64_t, wswap64)void HELPER (sme_revd_q )(void *vd,void *vn,void *vg,uint32_t desc) {intptr_t i, opr_sz =simd_oprsz (desc) /8 ; +bool zeroing =simd_data (desc) &1 ;uint64_t *d = vd, *n = vn;uint8_t *pg = vg;
@@ -980,6 +981,9 @@ void HELPER(sme_revd_q)(void *vd, void *vn, void *vg, uint32_t desc)uint64_t n1 = n[i +1 ]; d[i +0 ] = n1; d[i +1 ] = n0; + }else if (zeroing) { + d[i +0 ] =0 ; + d[i +1 ] =0 ; } } }
target/arm/tcg/translate-sve.c +2 -0
@@ -3089,6 +3089,8 @@ TRANS_FEAT(REVW_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz,TRANS_FEAT (REVD_m, aa64_sme_or_sve2p1, gen_gvec_ool_arg_zpz, gen_helper_sme_revd_q, a, 0) +TRANS_FEAT (REVD_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + gen_helper_sme_revd_q, a, 1)TRANS_FEAT (SPLICE , aa64_sme_or_sve, gen_gvec_ool_arg_zpzz, gen_helper_sve_splice, a, a->esz)
target/arm/tcg/sve.decode +1 -0
@@ -734,6 +734,7 @@ REVB_z 00000101 .. 1001 00 101 ... ..... ..... @rd_pg_rn REVH_z 00000101 .. 1001 01 101 ... ..... ..... @rd_pg_rn REVW_z 00000101 .. 1001 10 101 ... ..... ..... @rd_pg_rn RBIT_z 00000101 .. 1001 11 101 ... ..... ..... @rd_pg_rn +REVD_z 00000101 00 1011 10 101 ... ..... ..... @rd_pg_rn_e0 # SVE vector splice (predicated, destructive) SPLICE 00000101 .. 101 100 100 ... ..... ..... @rdn_pg_rm
Signature · 1 line
2.43.0
Re: [PATCH 08/25] target/arm: Implement SVE reverse doublewords (zeroing)
Quoted 7 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/sve_helper.c | 4 ++++ target/arm/tcg/translate-sve.c | 2 ++ target/arm/tcg/sve.decode | 1 + 3 files changed, 7 insertions(+)
thanks
-- PMM
PATCH 9/25 target/arm: Implement SVE2 integer unary operations (predicated, zeroing)
In reply to Richard HendersonThis includes URECPE, URSQRTE, SQABS, SQNEG.
--- target/arm/tcg/translate-sve.c | 6 ++++++ target/arm/tcg/sve.decode | 5 +++++ 2 files changed, 11 insertions(+)
target/arm/tcg/translate-sve.c +6 -0
@@ -6791,21 +6791,27 @@ TRANS_FEAT(UADALP_zpzz, aa64_sme_or_sve2, gen_gvec_ool_arg_zpzz,TRANS_FEAT (URECPE_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, a->esz == 2 ? gen_helper_sve2_urecpe_s : NULL, a, 0) +TRANS_FEAT (URECPE_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + a->esz == 2 ? gen_helper_sve2_urecpe_s : NULL, a, 1)TRANS_FEAT (URSQRTE_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, a->esz == 2 ? gen_helper_sve2_ursqrte_s : NULL, a, 0) +TRANS_FEAT (URSQRTE_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, + a->esz == 2 ? gen_helper_sve2_ursqrte_s : NULL, a, 1)static gen_helper_gvec_3 *const sqabs_fns[4 ] = { gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h, gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d, }; TRANS_FEAT(SQABS_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 0) +TRANS_FEAT(SQABS_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 1)static gen_helper_gvec_3 *const sqneg_fns[4 ] = { gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h, gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d, }; TRANS_FEAT(SQNEG_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) +TRANS_FEAT(SQNEG_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 1) DO_ZPZZ(SQSHL, aa64_sme_or_sve2, sve2_sqshl)DO_ZPZZ (SQRSHL , aa64_sme_or_sve2, sve2_sqrshl)
target/arm/tcg/sve.decode +5 -0
@@ -1545,6 +1545,11 @@ URSQRTE_m 01000100 .. 000 001 101 ... ..... ..... @rd_pg_rn SQABS_m 01000100 .. 001 000 101 ... ..... ..... @rd_pg_rn SQNEG_m 01000100 .. 001 001 101 ... ..... ..... @rd_pg_rn +URECPE_z 01000100 .. 000 010 101 ... ..... ..... @rd_pg_rn +URSQRTE_z 01000100 .. 000 011 101 ... ..... ..... @rd_pg_rn +SQABS_z 01000100 .. 001 010 101 ... ..... ..... @rd_pg_rn +SQNEG_z 01000100 .. 001 011 101 ... ..... ..... @rd_pg_rn + ### SVE2 saturating/rounding bitwise shift left (predicated) SRSHL 01000100 .. 000 010 100 ... ..... ..... @rdn_pg_rm
Signature · 1 line
2.43.0
Re: [PATCH 09/25] target/arm: Implement SVE2 integer unary operations (predicated, zeroing)
Quoted 4 lines · Richard Henderson
This includes URECPE, URSQRTE, SQABS, SQNEG.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 10/25 target/arm: Add data argument to do_frint_mode
In reply to Richard HendersonPrepare for needing a non-zero value.
--- target/arm/tcg/translate-sve.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
target/arm/tcg/translate-sve.c +10 -9
@@ -4656,7 +4656,8 @@ TRANS_FEAT(FRINTX_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64);static bool do_frint_mode (DisasContext *s,arg_rpr_esz *a, -ARMFPRounding mode,gen_helper_gvec_3_ptr *fn) +ARMFPRounding mode,int data, +gen_helper_gvec_3_ptr *fn) {unsigned vsz;TCGv_i32 tmode;
@@ -4676,22 +4677,22 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a,tcg_gen_gvec_3_ptr (vec_full_reg_offset (s, a->rd),vec_full_reg_offset (s, a->rn),pred_full_reg_offset (s, a->pg), - status, vsz, vsz,0 , fn); + status, vsz, vsz, data, fn);gen_restore_rmode (tmode, status);return true; }TRANS_FEAT (FRINTN_m, aa64_sme_or_sve, do_frint_mode, a, - FPROUNDING_TIEEVEN, frint_fns[a->esz]) + FPROUNDING_TIEEVEN, 0, frint_fns[a->esz])TRANS_FEAT (FRINTP_m, aa64_sme_or_sve, do_frint_mode, a, - FPROUNDING_POSINF, frint_fns[a->esz]) + FPROUNDING_POSINF, 0, frint_fns[a->esz])TRANS_FEAT (FRINTM_m, aa64_sme_or_sve, do_frint_mode, a, - FPROUNDING_NEGINF, frint_fns[a->esz]) + FPROUNDING_NEGINF, 0, frint_fns[a->esz])TRANS_FEAT (FRINTZ_m, aa64_sme_or_sve, do_frint_mode, a, - FPROUNDING_ZERO, frint_fns[a->esz]) + FPROUNDING_ZERO, 0, frint_fns[a->esz])TRANS_FEAT (FRINTA_m, aa64_sme_or_sve, do_frint_mode, a, - FPROUNDING_TIEAWAY, frint_fns[a->esz]) + FPROUNDING_TIEAWAY, 0, frint_fns[a->esz])static gen_helper_gvec_3_ptr *const frecpx_fns[] = {NULL , gen_helper_sve_frecpx_h,
@@ -7998,9 +7999,9 @@ TRANS_FEAT(FCVTLT_sd_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_sd, a, 0, FPST_A64) TRANS_FEAT(FCVTX_ds_m, aa64_sme_or_sve2, do_frint_mode, a, - FPROUNDING_ODD, gen_helper_sve_fcvt_ds) + FPROUNDING_ODD, 0, gen_helper_sve_fcvt_ds) TRANS_FEAT(FCVTXNT_ds_m, aa64_sme_or_sve2, do_frint_mode, a, - FPROUNDING_ODD, gen_helper_sve2_fcvtnt_ds) + FPROUNDING_ODD, 0, gen_helper_sve2_fcvtnt_ds)static gen_helper_gvec_3_ptr *const flogb_fns[] = {NULL , gen_helper_flogb_h,
Signature · 1 line
2.43.0
Re: [PATCH 10/25] target/arm: Add data argument to do_frint_mode
Quoted 29 lines · Richard Henderson
Prepare for needing a non-zero value.
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/translate-sve.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)target/arm/tcg/translate-sve.c +3
-2@@ -4656,7 +4656,8 @@ TRANS_FEAT(FRINTX_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64);static bool do_frint_mode (DisasContext *s,arg_rpr_esz *a, -ARMFPRounding mode,gen_helper_gvec_3_ptr *fn) +ARMFPRounding mode,int data, +gen_helper_gvec_3_ptr *fn) {unsigned vsz;TCGv_i32 tmode;@@ -4676,22 +4677,22 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a,tcg_gen_gvec_3_ptr (vec_full_reg_offset (s, a->rd),vec_full_reg_offset (s, a->rn),pred_full_reg_offset (s, a->pg), - status, vsz, vsz,0 , fn); + status, vsz, vsz, data, fn);
target/arm/tcg/translate-sve.c static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, · line 4689
Quoted 10 lines
target/arm/tcg/translate-sve.c +2
-2gen_restore_rmode (tmode, status);return true; }TRANS_FEAT (FRINTN_m, aa64_sme_or_sve, do_frint_mode, a, - FPROUNDING_TIEEVEN, frint_fns[a->esz]) + FPROUNDING_TIEEVEN, 0, frint_fns[a->esz])TRANS_FEAT (FRINTP_m, aa64_sme_or_sve, do_frint_mode, a, -FPROUNDING_POSINF , frint_fns[a->esz]) +FPROUNDING_POSINF ,0 , frint_fns[a->esz])
We seem to not be very consistent about whether the function pointer comes at the end or before the extra data args in these TRANS_FEAT invocations, which is particularly noticeable in this patchset where the earlier "add a 0/1 indicator of zeroing" patches added the 0/1 at the end, and this one puts it in the middle. However, this is the arrangement that the existing arguments to do_frint_mode() have, so
thanks
-- PMM
PATCH 11/25 target/arm: Implement Floating-point round to integral value (predicated, zeroing)
In reply to Richard HendersonThis is the various FRINT rounding modes.
--- target/arm/tcg/translate-sve.c | 17 +++++++++++++++++ target/arm/tcg/sve.decode | 8 ++++++++ 2 files changed, 25 insertions(+)
target/arm/tcg/translate-sve.c +17 -0
@@ -4644,6 +4644,9 @@ static gen_helper_gvec_3_ptr * const frint_fns[] = {TRANS_FEAT (FRINTI_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, frint_fns[a->esz], a,0 , a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) +TRANS_FEAT (FRINTI_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + frint_fns[a->esz], a,1 , + a->esz == MO_16 ? FPST_A64_F16 : FPST_A64)static gen_helper_gvec_3_ptr *const frintx_fns[] = {NULL ,
@@ -4654,6 +4657,9 @@ static gen_helper_gvec_3_ptr * const frintx_fns[] = {TRANS_FEAT (FRINTX_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, frintx_fns[a->esz], a,0 , a->esz ==MO_16 ?FPST_A64_F16 :FPST_A64 ); +TRANS_FEAT (FRINTX_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + frintx_fns[a->esz], a,1 , + a->esz ==MO_16 ?FPST_A64_F16 :FPST_A64 ); static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, ARMFPRounding mode, int data,
@@ -4694,6 +4700,17 @@ TRANS_FEAT(FRINTZ_m, aa64_sme_or_sve, do_frint_mode, a,TRANS_FEAT (FRINTA_m, aa64_sme_or_sve, do_frint_mode, a, FPROUNDING_TIEAWAY, 0, frint_fns[a->esz]) +TRANS_FEAT (FRINTN_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_TIEEVEN, 1, frint_fns[a->esz]) +TRANS_FEAT (FRINTP_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_POSINF, 1, frint_fns[a->esz]) +TRANS_FEAT (FRINTM_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_NEGINF, 1, frint_fns[a->esz]) +TRANS_FEAT (FRINTZ_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_ZERO, 1, frint_fns[a->esz]) +TRANS_FEAT (FRINTA_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_TIEAWAY, 1, frint_fns[a->esz]) +static gen_helper_gvec_3_ptr *const frecpx_fns[] = {NULL , gen_helper_sve_frecpx_h, gen_helper_sve_frecpx_s, gen_helper_sve_frecpx_d,
target/arm/tcg/sve.decode +8 -0
@@ -1240,6 +1240,14 @@ FRINTA_m 01100101 .. 000 100 101 ... ..... ..... @rd_pg_rn FRINTX_m 01100101 .. 000 110 101 ... ..... ..... @rd_pg_rn FRINTI_m 01100101 .. 000 111 101 ... ..... ..... @rd_pg_rn +FRINTN_z 01100100 .. 011 000 100 ... ..... ..... @rd_pg_rn +FRINTP_z 01100100 .. 011 000 101 ... ..... ..... @rd_pg_rn +FRINTM_z 01100100 .. 011 000 110 ... ..... ..... @rd_pg_rn +FRINTZ_z 01100100 .. 011 000 111 ... ..... ..... @rd_pg_rn +FRINTA_z 01100100 .. 011 001 100 ... ..... ..... @rd_pg_rn +FRINTX_z 01100100 .. 011 001 110 ... ..... ..... @rd_pg_rn +FRINTI_z 01100100 .. 011 001 111 ... ..... ..... @rd_pg_rn + # SVE floating-point unary operations FRECPX_m 01100101 .. 001 100 101 ... ..... ..... @rd_pg_rn FSQRT_m 01100101 .. 001 101 101 ... ..... ..... @rd_pg_rn
Signature · 1 line
2.43.0
Re: [PATCH 11/25] target/arm: Implement Floating-point round to integral value (predicated, zeroing)
Quoted 5 lines · Richard Henderson
This is the various FRINT rounding modes.
Signed-off-by Richard Henderson <[email protected]>---
thanks
-- PMM
PATCH 12/25 target/arm: Implement Floating-point convert (predicated, zeroing)
In reply to Richard HendersonThis is FCVTX, FCVT and BFCVT.
--- target/arm/tcg/translate-sve.c | 22 ++++++++++++++++++++++ target/arm/tcg/sve.decode | 11 +++++++++++ 2 files changed, 33 insertions(+)
target/arm/tcg/translate-sve.c +22 -0
@@ -4588,21 +4588,40 @@ TRANS_FEAT(FCMLA_zzxz, aa64_sme_or_sve, gen_gvec_fpst_zzzz, fcmla_idx_fns[a->eszTRANS_FEAT (FCVT_sh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_sh, a, 0, FPST_A64) +TRANS_FEAT (FCVT_sh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvt_sh, a, 1, FPST_A64) +TRANS_FEAT (FCVT_hs_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_hs, a, 0, FPST_A64_F16) +TRANS_FEAT (FCVT_hs_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvt_hs, a, 1, FPST_A64_F16)TRANS_FEAT (BFCVT_m, aa64_sme_sve_bf16, gen_gvec_fpst_arg_zpz, gen_helper_sve_bfcvt, a,0 , s->fpcr_ah ? FPST_AH : FPST_A64) +TRANS_FEAT (BFCVT_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_bfcvt, a,1 , + s->fpcr_ah ? FPST_AH : FPST_A64)TRANS_FEAT (FCVT_dh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_dh, a, 0, FPST_A64) +TRANS_FEAT (FCVT_dh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvt_dh, a, 1, FPST_A64) +TRANS_FEAT (FCVT_hd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_hd, a, 0, FPST_A64_F16) +TRANS_FEAT (FCVT_hd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvt_hd, a, 1, FPST_A64_F16) +TRANS_FEAT (FCVT_ds_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_ds, a, 0, FPST_A64) +TRANS_FEAT (FCVT_ds_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvt_ds, a, 1, FPST_A64) +TRANS_FEAT (FCVT_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvt_sd, a, 0, FPST_A64) +TRANS_FEAT (FCVT_sd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvt_sd, a, 1, FPST_A64)TRANS_FEAT (FCVTZS_hh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzs_hh, a,0 ,FPST_A64_F16 )
@@ -8017,6 +8036,9 @@ TRANS_FEAT(FCVTLT_sd_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz,TRANS_FEAT (FCVTX_ds_m, aa64_sme_or_sve2, do_frint_mode, a, FPROUNDING_ODD, 0, gen_helper_sve_fcvt_ds) +TRANS_FEAT (FCVTX_ds_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_ODD, 1, gen_helper_sve_fcvt_ds) +TRANS_FEAT (FCVTXNT_ds_m, aa64_sme_or_sve2, do_frint_mode, a,FPROUNDING_ODD ,0 , gen_helper_sve2_fcvtnt_ds)
target/arm/tcg/sve.decode +11 -0
@@ -1215,6 +1215,17 @@ FCVT_hd_m 01100101 11 0010 01 101 ... ..... ..... @rd_pg_rn_e0 FCVT_ds_m 01100101 11 0010 10 101 ... ..... ..... @rd_pg_rn_e0 FCVT_sd_m 01100101 11 0010 11 101 ... ..... ..... @rd_pg_rn_e0 +FCVTX_ds_z 01100100 00 0110 101 10 ... ..... ..... @rd_pg_rn_e0 + +FCVT_sh_z 01100100 10 0110 101 00 ... ..... ..... @rd_pg_rn_e0 +FCVT_hs_z 01100100 10 0110 101 01 ... ..... ..... @rd_pg_rn_e0 +BFCVT_z 01100100 10 0110 101 10 ... ..... ..... @rd_pg_rn_e0 + +FCVT_dh_z 01100100 11 0110 101 00 ... ..... ..... @rd_pg_rn_e0 +FCVT_hd_z 01100100 11 0110 101 01 ... ..... ..... @rd_pg_rn_e0 +FCVT_ds_z 01100100 11 0110 101 10 ... ..... ..... @rd_pg_rn_e0 +FCVT_sd_z 01100100 11 0110 101 11 ... ..... ..... @rd_pg_rn_e0 + # SVE floating-point convert to integer FCVTZS_hh_m 01100101 01 011 01 0 101 ... ..... ..... @rd_pg_rn_e0 FCVTZU_hh_m 01100101 01 011 01 1 101 ... ..... ..... @rd_pg_rn_e0
Signature · 1 line
2.43.0
Re: [PATCH 12/25] target/arm: Implement Floating-point convert (predicated, zeroing)
Quoted 4 lines · Richard Henderson
This is FCVTX, FCVT and BFCVT.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 13/25 target/arm: Implement Floating-point square root (predicated, zeroing)
In reply to Richard HendersonThis is FRECPX and FSQRT.
--- target/arm/tcg/translate-sve.c | 5 +++++ target/arm/tcg/sve.decode | 3 +++ 2 files changed, 8 insertions(+)
target/arm/tcg/translate-sve.c +5 -0
@@ -4736,6 +4736,8 @@ static gen_helper_gvec_3_ptr * const frecpx_fns[] = { };TRANS_FEAT (FRECPX_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, frecpx_fns[a->esz], a, 0, select_ah_fpst(s, a->esz)) +TRANS_FEAT (FRECPX_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + frecpx_fns[a->esz], a, 1, select_ah_fpst(s, a->esz))static gen_helper_gvec_3_ptr *const fsqrt_fns[] = {NULL , gen_helper_sve_fsqrt_h,
@@ -4744,6 +4746,9 @@ static gen_helper_gvec_3_ptr * const fsqrt_fns[] = {TRANS_FEAT (FSQRT_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, fsqrt_fns[a->esz], a,0 , a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) +TRANS_FEAT (FSQRT_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + fsqrt_fns[a->esz], a,1 , + a->esz == MO_16 ? FPST_A64_F16 : FPST_A64)TRANS_FEAT (SCVTF_hh_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_scvt_hh, a,0 ,FPST_A64_F16 )
target/arm/tcg/sve.decode +3 -0
@@ -1263,6 +1263,9 @@ FRINTI_z 01100100 .. 011 001 111 ... ..... ..... @rd_pg_rn FRECPX_m 01100101 .. 001 100 101 ... ..... ..... @rd_pg_rn FSQRT_m 01100101 .. 001 101 101 ... ..... ..... @rd_pg_rn +FRECPX_z 01100100 .. 011 011 100 ... ..... ..... @rd_pg_rn +FSQRT_z 01100100 .. 011 011 101 ... ..... ..... @rd_pg_rn + # SVE integer convert to floating-point SCVTF_hh_m 01100101 01 010 01 0 101 ... ..... ..... @rd_pg_rn_e0 SCVTF_sh_m 01100101 01 010 10 0 101 ... ..... ..... @rd_pg_rn_e0
Signature · 1 line
2.43.0
Re: [PATCH 13/25] target/arm: Implement Floating-point square root (predicated, zeroing)
Quoted 4 lines · Richard Henderson
This is FRECPX and FSQRT.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 14/25 target/arm: Implement SCVTF, UCVTF (predicated, zeroing)
In reply to Richard Henderson--- target/arm/tcg/translate-sve.c | 34 ++++++++++++++++++++++++++++++++++ target/arm/tcg/sve.decode | 16 ++++++++++++++++ 2 files changed, 50 insertions(+)
target/arm/tcg/translate-sve.c +34 -0
@@ -4784,6 +4784,40 @@ TRANS_FEAT(UCVTF_sd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz,TRANS_FEAT (UCVTF_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_ucvt_dd, a, 0, FPST_A64) +TRANS_FEAT (SCVTF_hh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_hh, a, 1, FPST_A64_F16) +TRANS_FEAT (SCVTF_sh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_sh, a, 1, FPST_A64_F16) +TRANS_FEAT (SCVTF_dh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_dh, a, 1, FPST_A64_F16) + +TRANS_FEAT (SCVTF_ss_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_ss, a, 1, FPST_A64) +TRANS_FEAT (SCVTF_ds_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_ds, a, 1, FPST_A64) + +TRANS_FEAT (SCVTF_sd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_sd, a, 1, FPST_A64) +TRANS_FEAT (SCVTF_dd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_scvt_dd, a, 1, FPST_A64) + +TRANS_FEAT (UCVTF_hh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_hh, a, 1, FPST_A64_F16) +TRANS_FEAT (UCVTF_sh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_sh, a, 1, FPST_A64_F16) +TRANS_FEAT (UCVTF_dh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_dh, a, 1, FPST_A64_F16) + +TRANS_FEAT (UCVTF_ss_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_ss, a, 1, FPST_A64) +TRANS_FEAT (UCVTF_ds_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_ds, a, 1, FPST_A64) +TRANS_FEAT (UCVTF_sd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_sd, a, 1, FPST_A64) + +TRANS_FEAT (UCVTF_dd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_ucvt_dd, a,1 ,FPST_A64 ) +/* *** SVE Memory - 32-bit Gather and Unsized Contiguous Group */
target/arm/tcg/sve.decode +16 -0
@@ -1283,6 +1283,22 @@ UCVTF_sd_m 01100101 11 010 00 1 101 ... ..... ..... @rd_pg_rn_e0 UCVTF_ds_m 01100101 11 010 10 1 101 ... ..... ..... @rd_pg_rn_e0 UCVTF_dd_m 01100101 11 010 11 1 101 ... ..... ..... @rd_pg_rn_e0 +SCVTF_hh_z 01100100 01 011 10 0 110 ... ..... ..... @rd_pg_rn_e0 +SCVTF_sh_z 01100100 01 011 10 1 100 ... ..... ..... @rd_pg_rn_e0 +SCVTF_ss_z 01100100 10 011 10 1 100 ... ..... ..... @rd_pg_rn_e0 +SCVTF_sd_z 01100100 11 011 10 0 100 ... ..... ..... @rd_pg_rn_e0 +SCVTF_dh_z 01100100 01 011 10 1 110 ... ..... ..... @rd_pg_rn_e0 +SCVTF_ds_z 01100100 11 011 10 1 100 ... ..... ..... @rd_pg_rn_e0 +SCVTF_dd_z 01100100 11 011 10 1 110 ... ..... ..... @rd_pg_rn_e0 + +UCVTF_hh_z 01100100 01 011 10 0 111 ... ..... ..... @rd_pg_rn_e0 +UCVTF_sh_z 01100100 01 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 +UCVTF_ss_z 01100100 10 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 +UCVTF_sd_z 01100100 11 011 10 0 101 ... ..... ..... @rd_pg_rn_e0 +UCVTF_dh_z 01100100 01 011 10 1 111 ... ..... ..... @rd_pg_rn_e0 +UCVTF_ds_z 01100100 11 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 +UCVTF_dd_z 01100100 11 011 10 1 111 ... ..... ..... @rd_pg_rn_e0 + ### SVE Memory - 32-bit Gather and Unsized Contiguous Group # SVE load predicate register
Signature · 1 line
2.43.0
Re: [PATCH 14/25] target/arm: Implement SCVTF, UCVTF (predicated, zeroing)
Quoted 7 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/translate-sve.c | 34 ++++++++++++++++++++++++++++++++++ target/arm/tcg/sve.decode | 16 ++++++++++++++++ 2 files changed, 50 insertions(+)
thanks
-- PMM
PATCH 15/25 target/arm: Implement FRINT{32,64}{X,Z}
In reply to Richard Henderson--- target/arm/tcg/helper-sve-defs.h | 9 ++++++++ target/arm/tcg/sve_helper.c | 5 +++++ target/arm/tcg/translate-sve.c | 36 ++++++++++++++++++++++++++++++++ target/arm/tcg/sve.decode | 20 ++++++++++++++++++ 4 files changed, 70 insertions(+)
target/arm/tcg/helper-sve-defs.h +9 -0
@@ -1441,6 +1441,15 @@ DEF_HELPER_FLAGS_5(sve_frintx_s, TCG_CALL_NO_RWG,DEF_HELPER_FLAGS_5 (sve_frintx_d,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_5 (sve2p2_frint32_s,TCG_CALL_NO_RWG , + void, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_5 (sve2p2_frint64_s,TCG_CALL_NO_RWG , + void, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_5 (sve2p2_frint32_d,TCG_CALL_NO_RWG , + void, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_5 (sve2p2_frint64_d,TCG_CALL_NO_RWG , + void, ptr, ptr, ptr, fpst, i32) +DEF_HELPER_FLAGS_5 (sve_frecpx_h,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, fpst, i32) DEF_HELPER_FLAGS_5(sve_frecpx_s, TCG_CALL_NO_RWG,
target/arm/tcg/sve_helper.c +5 -0
@@ -5017,6 +5017,11 @@ DO_ZPZ_FP(sve_frintx_h, uint16_t, H1_2, float16_round_to_int) DO_ZPZ_FP(sve_frintx_s, uint32_t, H1_4, float32_round_to_int) DO_ZPZ_FP(sve_frintx_d, uint64_t, H1_8, float64_round_to_int) +DO_ZPZ_FP(sve2p2_frint32_s, uint32_t, H1_4, helper_frint32_s) +DO_ZPZ_FP(sve2p2_frint64_s, uint32_t, H1_4, helper_frint64_s) +DO_ZPZ_FP(sve2p2_frint32_d, uint64_t, H1_8, helper_frint32_d) +DO_ZPZ_FP(sve2p2_frint64_d, uint64_t, H1_8, helper_frint64_d) + DO_ZPZ_FP(sve_frecpx_h, uint16_t, H1_2, helper_frecpx_f16) DO_ZPZ_FP(sve_frecpx_s, uint32_t, H1_4, helper_frecpx_f32)DO_ZPZ_FP (sve_frecpx_d, uint64_t,H1_8 , helper_frecpx_f64)
target/arm/tcg/translate-sve.c +36 -0
@@ -4730,6 +4730,42 @@ TRANS_FEAT(FRINTZ_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a,TRANS_FEAT (FRINTA_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, FPROUNDING_TIEAWAY, 1, frint_fns[a->esz]) +TRANS_FEAT (FRINT32X_s_m, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint32_s, a, 0, FPST_A64) +TRANS_FEAT (FRINT32X_d_m, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint32_d, a, 0, FPST_A64) +TRANS_FEAT (FRINT64X_s_m, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint64_s, a, 0, FPST_A64) +TRANS_FEAT (FRINT64X_d_m, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint64_d, a, 0, FPST_A64) + +TRANS_FEAT (FRINT32X_s_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint32_s, a, 1, FPST_A64) +TRANS_FEAT (FRINT32X_d_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint32_d, a, 1, FPST_A64) +TRANS_FEAT (FRINT64X_s_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint64_s, a, 1, FPST_A64) +TRANS_FEAT (FRINT64X_d_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2p2_frint64_d, a, 1, FPST_A64) + +TRANS_FEAT (FRINT32Z_s_m, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 0, gen_helper_sve2p2_frint32_s) +TRANS_FEAT (FRINT32Z_d_m, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 0, gen_helper_sve2p2_frint32_d) +TRANS_FEAT (FRINT64Z_s_m, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 0, gen_helper_sve2p2_frint64_s) +TRANS_FEAT (FRINT64Z_d_m, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 0, gen_helper_sve2p2_frint64_d) + +TRANS_FEAT (FRINT32Z_s_z, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 1, gen_helper_sve2p2_frint32_s) +TRANS_FEAT (FRINT32Z_d_z, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 1, gen_helper_sve2p2_frint32_d) +TRANS_FEAT (FRINT64Z_s_z, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 1, gen_helper_sve2p2_frint64_s) +TRANS_FEAT (FRINT64Z_d_z, aa64_sme2p2_or_sve2p2, do_frint_mode, + a, FPROUNDING_ZERO, 1, gen_helper_sve2p2_frint64_d) +static gen_helper_gvec_3_ptr *const frecpx_fns[] = {NULL , gen_helper_sve_frecpx_h, gen_helper_sve_frecpx_s, gen_helper_sve_frecpx_d,
target/arm/tcg/sve.decode +20 -0
@@ -1259,6 +1259,26 @@ FRINTA_z 01100100 .. 011 001 100 ... ..... ..... @rd_pg_rn FRINTX_z 01100100 .. 011 001 110 ... ..... ..... @rd_pg_rn FRINTI_z 01100100 .. 011 001 111 ... ..... ..... @rd_pg_rn +FRINT32X_s_m 01100101 00 010 001 101 ... ..... ..... @rd_pg_rn_e0 +FRINT32X_d_m 01100101 00 010 011 101 ... ..... ..... @rd_pg_rn_e0 +FRINT64X_s_m 01100101 00 010 101 101 ... ..... ..... @rd_pg_rn_e0 +FRINT64X_d_m 01100101 00 010 111 101 ... ..... ..... @rd_pg_rn_e0 + +FRINT32X_s_z 01100100 00 011 100 101 ... ..... ..... @rd_pg_rn_e0 +FRINT32X_d_z 01100100 00 011 100 111 ... ..... ..... @rd_pg_rn_e0 +FRINT64X_s_z 01100100 00 011 101 101 ... ..... ..... @rd_pg_rn_e0 +FRINT64X_d_z 01100100 00 011 101 111 ... ..... ..... @rd_pg_rn_e0 + +FRINT32Z_s_m 01100101 00 010 000 101 ... ..... ..... @rd_pg_rn_e0 +FRINT32Z_d_m 01100101 00 010 010 101 ... ..... ..... @rd_pg_rn_e0 +FRINT64Z_s_m 01100101 00 010 100 101 ... ..... ..... @rd_pg_rn_e0 +FRINT64Z_d_m 01100101 00 010 110 101 ... ..... ..... @rd_pg_rn_e0 + +FRINT32Z_s_z 01100100 00 011 100 100 ... ..... ..... @rd_pg_rn_e0 +FRINT32Z_d_z 01100100 00 011 100 110 ... ..... ..... @rd_pg_rn_e0 +FRINT64Z_s_z 01100100 00 011 101 100 ... ..... ..... @rd_pg_rn_e0 +FRINT64Z_d_z 01100100 00 011 101 110 ... ..... ..... @rd_pg_rn_e0 + # SVE floating-point unary operations FRECPX_m 01100101 .. 001 100 101 ... ..... ..... @rd_pg_rn FSQRT_m 01100101 .. 001 101 101 ... ..... ..... @rd_pg_rn
Signature · 1 line
2.43.0
Re: [PATCH 15/25] target/arm: Implement FRINT{32,64}{X,Z}
Quoted 8 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/helper-sve-defs.h | 9 ++++++++ target/arm/tcg/sve_helper.c | 5 +++++ target/arm/tcg/translate-sve.c | 36 ++++++++++++++++++++++++++++++++ target/arm/tcg/sve.decode | 20 ++++++++++++++++++ 4 files changed, 70 insertions(+)
thanks
-- PMM
PATCH 16/25 target/arm: Enable zeroing in DO_FCVT{N, L}T macros in sve_helper.c
In reply to Richard HendersonUse the low bit of simd_data to hold a 'zeroing' bit. The simd_data field is currently unused and always 0.
--- target/arm/tcg/sve_helper.c | 6 ++++++ 1 file changed, 6 insertions(+)
target/arm/tcg/sve_helper.c +6 -0
@@ -8595,6 +8595,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \ float_status *status, uint32_t desc) \ { \intptr_t i =simd_oprsz (desc); \ +bool zeroing =simd_data (desc) &1 ; \uint64_t *g = vg; \ do { \ uint64_t pg = g[(i - 1) >> 6]; \
@@ -8603,6 +8604,8 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \if (likely ((pg >> (i &63 )) &1 )) { \TYPEW nn = *(TYPEW *)(vn +HW (i)); \ *(TYPEN *)(vd +HN (i +sizeof (TYPEN ))) =OP (nn, status); \ + }else if (zeroing) { \ + *(TYPEN *)(vd +HN (i +sizeof (TYPEN ))) =0 ; \ } \ }while (i &63 ); \ }while (i !=0 ); \
@@ -8617,6 +8620,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \ float_status *status, uint32_t desc) \ { \intptr_t i =simd_oprsz (desc); \ +bool zeroing =simd_data (desc) &1 ; \uint64_t *g = vg; \ do { \ uint64_t pg = g[(i - 1) >> 6]; \
@@ -8625,6 +8629,8 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \if (likely ((pg >> (i &63 )) &1 )) { \TYPEN nn = *(TYPEN *)(vn +HN (i +sizeof (TYPEN ))); \ *(TYPEW *)(vd +HW (i)) =OP (nn, status); \ + }else if (zeroing) { \ + *(TYPEW *)(vd +HW (i)) =0 ; \ } \ }while (i &63 ); \ }while (i !=0 ); \
Signature · 1 line
2.43.0
Re: [PATCH 16/25] target/arm: Enable zeroing in DO_FCVT{N, L}T macros in sve_helper.c
Quoted 6 lines · Richard Henderson
Use the low bit of
simd_datato hold a 'zeroing' bit. Thesimd_datafield is currently unused and always 0.Signed-off-by Richard Henderson <[email protected]>---
thanks
-- PMM
PATCH 17/25 target/arm: Implement SVE floating-point convert (top, predicated, zeroing)
In reply to Richard HendersonThis includes FCVTXNT, BFCVTNT, FCVTNT, FCVTLT.
--- target/arm/tcg/translate-sve.c | 13 +++++++++++++ target/arm/tcg/sve.decode | 7 +++++++ 2 files changed, 20 insertions(+)
target/arm/tcg/translate-sve.c +13 -0
@@ -8097,17 +8097,28 @@ static bool trans_RAX1(DisasContext *s, arg_RAX1 *a)TRANS_FEAT (FCVTNT_sh_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtnt_sh, a, 0, FPST_A64) +TRANS_FEAT (FCVTNT_sh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2_fcvtnt_sh, a, 1, FPST_A64)TRANS_FEAT (FCVTNT_ds_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtnt_ds, a, 0, FPST_A64) +TRANS_FEAT (FCVTNT_ds_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2_fcvtnt_ds, a, 1, FPST_A64)TRANS_FEAT (BFCVTNT_m, aa64_sme_sve_bf16, gen_gvec_fpst_arg_zpz, gen_helper_sve_bfcvtnt, a,0 , s->fpcr_ah ? FPST_AH : FPST_A64) +TRANS_FEAT (BFCVTNT_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_bfcvtnt, a,1 , + s->fpcr_ah ? FPST_AH : FPST_A64)TRANS_FEAT (FCVTLT_hs_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_hs, a, 0, FPST_A64_F16) +TRANS_FEAT (FCVTLT_hs_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2_fcvtlt_hs, a, 1, FPST_A64_F16)TRANS_FEAT (FCVTLT_sd_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_sd, a, 0, FPST_A64) +TRANS_FEAT (FCVTLT_sd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve2_fcvtlt_sd, a, 1, FPST_A64)TRANS_FEAT (FCVTX_ds_m, aa64_sme_or_sve2, do_frint_mode, a,FPROUNDING_ODD ,0 , gen_helper_sve_fcvt_ds)
@@ -8116,6 +8127,8 @@ TRANS_FEAT(FCVTX_ds_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a,TRANS_FEAT (FCVTXNT_ds_m, aa64_sme_or_sve2, do_frint_mode, a, FPROUNDING_ODD, 0, gen_helper_sve2_fcvtnt_ds) +TRANS_FEAT (FCVTXNT_ds_z, aa64_sme2p2_or_sve2p2, do_frint_mode, a, + FPROUNDING_ODD, 1, gen_helper_sve2_fcvtnt_ds)static gen_helper_gvec_3_ptr *const flogb_fns[] = {NULL , gen_helper_flogb_h,
target/arm/tcg/sve.decode +7 -0
@@ -1941,6 +1941,13 @@ FCVTLT_hs_m 01100100 10 0010 01 101 ... ..... ..... @rd_pg_rn_e0 FCVTNT_ds_m 01100100 11 0010 10 101 ... ..... ..... @rd_pg_rn_e0 FCVTLT_sd_m 01100100 11 0010 11 101 ... ..... ..... @rd_pg_rn_e0 +FCVTXNT_ds_z 01100100 00 0000 10 101 ... ..... ..... @rd_pg_rn_e0 +FCVTNT_sh_z 01100100 10 0000 00 101 ... ..... ..... @rd_pg_rn_e0 +FCVTNT_ds_z 01100100 11 0000 10 101 ... ..... ..... @rd_pg_rn_e0 +BFCVTNT_z 01100100 10 0000 10 101 ... ..... ..... @rd_pg_rn_e0 +FCVTLT_hs_z 01100100 10 0000 01 101 ... ..... ..... @rd_pg_rn_e0 +FCVTLT_sd_z 01100100 11 0000 11 101 ... ..... ..... @rd_pg_rn_e0 + ### SVE2 floating-point convert to integer FLOGB_m 01100101 00 011 esz:2 0101 pg:3 rn:5 rd:5 &rpr_esz
Signature · 1 line
2.43.0
Re: [PATCH 17/25] target/arm: Implement SVE floating-point convert (top, predicated, zeroing)
Quoted 5 lines · Richard Henderson
This includes FCVTXNT, BFCVTNT, FCVTNT, FCVTLT.
Signed-off-by Richard Henderson <[email protected]>---
thanks
-- PMM
PATCH 18/25 target/arm: Implement floating-point log and convert to integer (zeroing)
In reply to Richard HendersonThis is FLOGB, FCVTZS, FCVTZU.
--- target/arm/tcg/translate-sve.c | 37 ++++++++++++++++++++++++++++++++-- target/arm/tcg/sve.decode | 16 +++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-)
target/arm/tcg/translate-sve.c +35 -2
@@ -4654,6 +4654,37 @@ TRANS_FEAT(FCVTZS_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz,TRANS_FEAT (FCVTZU_dd_m, aa64_sme_or_sve, gen_gvec_fpst_arg_zpz, gen_helper_sve_fcvtzu_dd, a, 0, FPST_A64) +TRANS_FEAT (FCVTZS_hh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_hh, a, 1, FPST_A64_F16) +TRANS_FEAT (FCVTZU_hh_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_hh, a, 1, FPST_A64_F16) +TRANS_FEAT (FCVTZS_hs_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_hs, a, 1, FPST_A64_F16) +TRANS_FEAT (FCVTZU_hs_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_hs, a, 1, FPST_A64_F16) +TRANS_FEAT (FCVTZS_hd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_hd, a, 1, FPST_A64_F16) +TRANS_FEAT (FCVTZU_hd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_hd, a, 1, FPST_A64_F16) + +TRANS_FEAT (FCVTZS_ss_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_ss, a, 1, FPST_A64) +TRANS_FEAT (FCVTZU_ss_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_ss, a, 1, FPST_A64) +TRANS_FEAT (FCVTZS_sd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_sd, a, 1, FPST_A64) +TRANS_FEAT (FCVTZU_sd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_sd, a, 1, FPST_A64) +TRANS_FEAT (FCVTZS_ds_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_ds, a, 1, FPST_A64) +TRANS_FEAT (FCVTZU_ds_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_ds, a, 1, FPST_A64) + +TRANS_FEAT (FCVTZS_dd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzs_dd, a, 1, FPST_A64) +TRANS_FEAT (FCVTZU_dd_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + gen_helper_sve_fcvtzu_dd, a, 1, FPST_A64) +static gen_helper_gvec_3_ptr *const frint_fns[] = {NULL , gen_helper_sve_frint_h,
@@ -8134,8 +8165,10 @@ static gen_helper_gvec_3_ptr * const flogb_fns[] = {NULL , gen_helper_flogb_h, gen_helper_flogb_s, gen_helper_flogb_d }; -TRANS_FEAT (FLOGB_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, flogb_fns[a->esz], - a, 0, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) +TRANS_FEAT (FLOGB_m, aa64_sme_or_sve2, gen_gvec_fpst_arg_zpz, + flogb_fns[a->esz], a, 0, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64) +TRANS_FEAT (FLOGB_z, aa64_sme2p2_or_sve2p2, gen_gvec_fpst_arg_zpz, + flogb_fns[a->esz], a, 1, a->esz == MO_16 ? FPST_A64_F16 : FPST_A64)static bool do_FMLAL_zzzw (DisasContext *s,arg_rrrr_esz *a,bool sub,bool sel) {
target/arm/tcg/sve.decode +16 -0
@@ -1242,6 +1242,21 @@ FCVTZU_sd_m 01100101 11 011 10 1 101 ... ..... ..... @rd_pg_rn_e0 FCVTZS_dd_m 01100101 11 011 11 0 101 ... ..... ..... @rd_pg_rn_e0 FCVTZU_dd_m 01100101 11 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_hh_z 01100100 01 011 11 0 110 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_hh_z 01100100 01 011 11 0 111 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_hs_z 01100100 01 011 11 1 100 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_hs_z 01100100 01 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_hd_z 01100100 01 011 11 1 110 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_hd_z 01100100 01 011 11 1 111 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_ss_z 01100100 10 011 11 1 100 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_ss_z 01100100 10 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_sd_z 01100100 11 011 11 1 100 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_sd_z 01100100 11 011 11 1 101 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_ds_z 01100100 11 011 11 0 100 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_ds_z 01100100 11 011 11 0 101 ... ..... ..... @rd_pg_rn_e0 +FCVTZS_dd_z 01100100 11 011 11 1 110 ... ..... ..... @rd_pg_rn_e0 +FCVTZU_dd_z 01100100 11 011 11 1 111 ... ..... ..... @rd_pg_rn_e0 + # SVE floating-point round to integral value FRINTN_m 01100101 .. 000 000 101 ... ..... ..... @rd_pg_rn FRINTP_m 01100101 .. 000 001 101 ... ..... ..... @rd_pg_rn
@@ -1950,6 +1965,7 @@ FCVTLT_sd_z 01100100 11 0000 11 101 ... ..... ..... @rd_pg_rn_e0 ### SVE2 floating-point convert to integer FLOGB_m 01100101 00 011 esz:2 0101 pg:3 rn:5 rd:5 &rpr_esz +FLOGB_z 01100100 00 011 1101 esz:2 pg:3 rn:5 rd:5 &rpr_esz ### SVE2 floating-point multiply-add long (vectors) FMLALB_zzzw 01100100 10 1 ..... 10 0 00 0 ..... ..... @rda_rn_rm_ex esz=2
Signature · 1 line
2.43.0
Re: [PATCH 18/25] target/arm: Implement floating-point log and convert to integer (zeroing)
Quoted 4 lines · Richard Henderson
This is FLOGB, FCVTZS, FCVTZU.
Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
PATCH 19/25 target/arm: Implement EXPAND
In reply to Richard Henderson--- target/arm/tcg/helper-sve-defs.h | 5 +++++ target/arm/tcg/sve_helper.c | 28 ++++++++++++++++++++++++++++ target/arm/tcg/translate-sve.c | 7 +++++++ target/arm/tcg/sve.decode | 2 ++ 4 files changed, 42 insertions(+)
target/arm/tcg/helper-sve-defs.h +5 -0
@@ -3203,3 +3203,8 @@ DEF_HELPER_FLAGS_6(sve2_famin_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, fpst, i32) DEF_HELPER_FLAGS_6(sve2_famin_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, fpst, i32) + +DEF_HELPER_FLAGS_4(sve2p2_expand_b, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_expand_h, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_expand_s, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_expand_d, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32)
target/arm/tcg/sve_helper.c +28 -0
@@ -8669,3 +8669,31 @@ void HELPER(pext)(void *vd, uint32_t png, uint32_t desc)do_whilel (vd, mask,MIN (b_count, vl), vl); } } + +#define DO_EXPAND (NAME ,TYPE ,H ) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ +{ \ + intptr_t oprsz = simd_oprsz(desc); \ + ARMVectorReg tn = *(ARMVectorReg *)vn; \ + intptr_t i = 0, j = 0; \ + do { \ + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ + do { \ + TYPE nn = 0; \ + if (pg & 1) { \ + nn = *(TYPE *)((void *)&tn + H(j)); \ + j += sizeof(TYPE); \ + } \ + *(TYPE *)(vd + H(i)) = nn; \ + i += sizeof(TYPE); \ + pg >>= sizeof(TYPE); \ + } while (i & 15); \ + } while (i < oprsz); \ +} + +DO_EXPAND(sve2p2_expand_b, uint8_t, H1) +DO_EXPAND(sve2p2_expand_h, uint16_t, H1_2) +DO_EXPAND(sve2p2_expand_s, uint32_t, H1_4) +DO_EXPAND(sve2p2_expand_d, uint64_t, H1_8) + +#undef DO_EXPAND
target/arm/tcg/translate-sve.c +7 -0
@@ -6956,6 +6956,13 @@ static gen_helper_gvec_3 * const sqneg_fns[4] = { TRANS_FEAT(SQNEG_m, aa64_sme_or_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0) TRANS_FEAT(SQNEG_z, aa64_sme2p2_or_sve2p2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 1) +static gen_helper_gvec_3 *const expand_fns[4 ] = { + gen_helper_sve2p2_expand_b, gen_helper_sve2p2_expand_h, + gen_helper_sve2p2_expand_s, gen_helper_sve2p2_expand_d, +}; +TRANS_FEAT_STREAMING_IF (EXPAND , aa64_sme2p2_or_sve2p2, aa64_sme2p2, + gen_gvec_ool_arg_zpz, expand_fns[a->esz], a, 0) + DO_ZPZZ(SQSHL, aa64_sme_or_sve2, sve2_sqshl) DO_ZPZZ(SQRSHL, aa64_sme_or_sve2, sve2_sqrshl)DO_ZPZZ (SRSHL , aa64_sme_or_sve2, sve2_srshl)
target/arm/tcg/sve.decode +2 -0
@@ -742,6 +742,8 @@ SPLICE 00000101 .. 101 100 100 ... ..... ..... @rdn_pg_rm # SVE2 vector splice (predicated, constructive) SPLICE_sve2 00000101 .. 101 101 100 ... ..... ..... @rd_pg_rn +EXPAND 00000101 .. 110 001 100 ... ..... ..... @rd_pg_rn + ### SVE Select Vectors Group # SVE select vector elements (predicated)
Signature · 1 line
2.43.0
Re: [PATCH 19/25] target/arm: Implement EXPAND
Quoted 40 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/helper-sve-defs.h | 5 +++++ target/arm/tcg/sve_helper.c | 28 ++++++++++++++++++++++++++++ target/arm/tcg/translate-sve.c | 7 +++++++ target/arm/tcg/sve.decode | 2 ++ 4 files changed, 42 insertions(+)target/arm/tcg/helper-sve-defs.h +5
-0@@ -3203,3 +3203,8 @@ DEF_HELPER_FLAGS_6(sve2_famin_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, fpst, i32) DEF_HELPER_FLAGS_6(sve2_famin_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, fpst, i32) + +DEF_HELPER_FLAGS_4(sve2p2_expand_b, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_expand_h, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_expand_s, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_expand_d, TCG_CALL_NO_WG, void, ptr, ptr, ptr, i32)target/arm/tcg/sve_helper.c +10
-0@@ -8669,3 +8669,31 @@ void HELPER(pext)(void *vd, uint32_t png, uint32_t desc)do_whilel (vd, mask,MIN (b_count, vl), vl); } } + +#define DO_EXPAND (NAME ,TYPE ,H ) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ +{ \ + intptr_t oprsz = simd_oprsz(desc); \ + ARMVectorReg tn = *(ARMVectorReg *)vn; \ + intptr_t i = 0, j = 0; \ + do { \ + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ + do { \
target/arm/tcg/sve_helper.c void HELPER(pext)(void *vd, uint32_t png, uint32_t desc) · line 8691
Quoted 10 lines
target/arm/tcg/sve_helper.c +10
-0+TYPE nn =0 ; \ +if (pg &1 ) { \ + nn = *(TYPE *)((void *)&tn +H (j)); \ + j +=sizeof (TYPE ); \ + } \ + *(TYPE *)(vd +H (i)) = nn; \ + i +=sizeof (TYPE ); \ + pg >>=sizeof (TYPE ); \ + }while (i &15 ); \ + }while (i < oprsz); \
It looks like in the other macros where we iterate like this (eg DO_ZPZZ, DO_ZPZ) we write the outer loop as
for (i = 0; i < opr_sz; ) {
...}
rather than as a do while(). Is there a reason I'm missing why we need the do-while here ?
thanks
-- PMM
Re: [PATCH 19/25] target/arm: Implement EXPAND
Quoted 22 lines · Peter Maydell
Quoted 9 lines
target/arm/tcg/sve_helper.c +9
-0+#define DO_EXPAND (NAME ,TYPE ,H ) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ +{ \ + intptr_t oprsz = simd_oprsz(desc); \ + ARMVectorReg tn = *(ARMVectorReg *)vn; \ + intptr_t i = 0, j = 0; \ + do { \ + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ + do { \target/arm/tcg/sve_helper.c void HELPER(pext)(void *vd, uint32_t png, uint32_t desc) · line 8691
Quoted 10 lines
target/arm/tcg/sve_helper.c +10
-0+TYPE nn =0 ; \ +if (pg &1 ) { \ + nn = *(TYPE *)((void *)&tn +H (j)); \ + j +=sizeof (TYPE ); \ + } \ + *(TYPE *)(vd +H (i)) = nn; \ + i +=sizeof (TYPE ); \ + pg >>=sizeof (TYPE ); \ + }while (i &15 ); \ + }while (i < oprsz); \It looks like in the other macros where we iterate like this (eg
DO_ZPZZ,DO_ZPZ) we write the outer loop as
Quoted 6 lines
for (i = 0; i < opr_sz; ) { ... }rather than as a do
while(). Is there a reason I'm missing why we need the do-while here ?
Nothing special, no.
Some of the predicate using macros use do/while, e.g. DO_COMPACT. I probably looked at that one while writing expand.
r~
PATCH 20/25 target/arm: Generalize sve_compact_[sd]
In reply to Richard HendersonImplement with a DO_COMPACT macro and general purpose predicate handling.
--- target/arm/tcg/sve_helper.c | 51 +++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-)
target/arm/tcg/sve_helper.c +21 -30
@@ -3637,39 +3637,30 @@ DO_TRN(sve2_trn_q, Int128, )#undef DO_UZP#undef DO_TRN -void HELPER (sve_compact_s )(void *vd,void *vn,void *vg,uint32_t desc) -{ -intptr_t i, j, opr_sz =simd_oprsz (desc) /4 ; -uint32_t *d = vd, *n = vn; -uint8_t *pg = vg; - -for (i = j =0 ; i < opr_sz; i++) { -if (pg[H1 (i /2 )] & (i &1 ?0x10 :0x01 )) { - d[H4 (j)] = n[H4 (i)]; - j++; - } - } -for (; j < opr_sz; j++) { - d[H4 (j)] =0 ; - } +#define DO_COMPACT (NAME ,TYPE ,H ) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ +{ \ + intptr_t i = 0, j = 0, oprsz = simd_oprsz(desc); \ + do { \ + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ + do { \ + if (pg & 1) { \ + *(TYPE *)(vd + H(j)) = *(TYPE *)(vn + H(i)); \ + j += sizeof(TYPE); \ + } \ + i += sizeof(TYPE); \ + pg >>= sizeof(TYPE); \ + } while (i & 15); \ + } while (i < oprsz); \ + for (; j < oprsz; j += sizeof(TYPE)) { \ + *(TYPE *)(vd + H(j)) = 0; \ + } \ } -void HELPER (sve_compact_d )(void *vd,void *vn,void *vg,uint32_t desc) -{ -intptr_t i, j, opr_sz =simd_oprsz (desc) /8 ; -uint64_t *d = vd, *n = vn; -uint8_t *pg = vg; +DO_COMPACT(sve_compact_s, uint32_t, H1_4) +DO_COMPACT(sve_compact_d, uint64_t, H1_8) -for (i = j =0 ; i < opr_sz; i++) { -if (pg[H1 (i)] &1 ) { - d[j] = n[i]; - j++; - } - } -for (; j < opr_sz; j++) { - d[j] =0 ; - } -} +#undef DO_COMPACT/* Similar to the ARM LastActiveElement pseudocode function, except the * result is multiplied by the element size. This includes the not found
Signature · 1 line
2.43.0
Re: [PATCH 20/25] target/arm: Generalize sve_compact_[sd]
Quoted 41 lines · Richard Henderson
Implement with a
DO_COMPACTmacro and general purpose predicate handling.Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/sve_helper.c | 51 +++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-)target/arm/tcg/sve_helper.c +9
-15@@ -3637,39 +3637,30 @@ DO_TRN(sve2_trn_q, Int128, )#undef DO_UZP#undef DO_TRN -void HELPER (sve_compact_s )(void *vd,void *vn,void *vg,uint32_t desc) -{ -intptr_t i, j, opr_sz =simd_oprsz (desc) /4 ; -uint32_t *d = vd, *n = vn; -uint8_t *pg = vg; - -for (i = j =0 ; i < opr_sz; i++) { -if (pg[H1 (i /2 )] & (i &1 ?0x10 :0x01 )) { - d[H4 (j)] = n[H4 (i)]; - j++; - } - } -for (; j < opr_sz; j++) { - d[H4 (j)] =0 ; - } +#define DO_COMPACT (NAME ,TYPE ,H ) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ +{ \ + intptr_t i = 0, j = 0, oprsz = simd_oprsz(desc); \ + do { \ + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ + do { \ + if (pg & 1) { \ + *(TYPE *)(vd + H(j)) = *(TYPE *)(vn + H(i)); \
target/arm/tcg/sve_helper.c DO_TRN(sve2_trn_q, Int128, ) · line 3658
Quoted 10 lines
target/arm/tcg/sve_helper.c +9
-0+ j +=sizeof (TYPE ); \ + } \ + i +=sizeof (TYPE ); \ + pg >>=sizeof (TYPE ); \ + }while (i &15 ); \ + }while (i < oprsz); \ +for (; j < oprsz; j +=sizeof (TYPE )) { \ + *(TYPE *)(vd +H (j)) =0 ; \ + } \ }
Why do we have special versions of the predicated loop for 64-bit operands elsewhere (eg DO_ZPZ vs DO_ZPZ_D, DO_ZPZZ vs DO_ZPZZ_D, etc) but we don't need to do that for compact ?
Similar query about do-while to the previous patch.
-- PMM
Re: [PATCH 20/25] target/arm: Generalize sve_compact_[sd]
Quoted 49 lines · Peter Maydell
Quoted 47 lines · Richard Henderson
Implement with a
DO_COMPACTmacro and general purpose predicate handling.Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/sve_helper.c | 51 +++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-)target/arm/tcg/sve_helper.c +15
-15@@ -3637,39 +3637,30 @@ DO_TRN(sve2_trn_q, Int128, )#undef DO_UZP#undef DO_TRN -void HELPER (sve_compact_s )(void *vd,void *vn,void *vg,uint32_t desc) -{ -intptr_t i, j, opr_sz =simd_oprsz (desc) /4 ; -uint32_t *d = vd, *n = vn; -uint8_t *pg = vg; - -for (i = j =0 ; i < opr_sz; i++) { -if (pg[H1 (i /2 )] & (i &1 ?0x10 :0x01 )) { - d[H4 (j)] = n[H4 (i)]; - j++; - } - } -for (; j < opr_sz; j++) { - d[H4 (j)] =0 ; - } +#define DO_COMPACT (NAME ,TYPE ,H ) \ +void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ +{ \ + intptr_t i = 0, j = 0, oprsz = simd_oprsz(desc); \ + do { \ + uint16_t pg = *(uint16_t *)(vg + H1_2(i >> 3)); \ + do { \ + if (pg & 1) { \ + *(TYPE *)(vd + H(j)) = *(TYPE *)(vn + H(i)); \ + j += sizeof(TYPE); \ + } \ + i += sizeof(TYPE); \ + pg >>= sizeof(TYPE); \ + } while (i & 15); \ + } while (i < oprsz); \
Quoted 8 lines
target/arm/tcg/sve_helper.c DO_TRN(sve2_trn_q, Int128, ) · line 3658
Quoted 4 lines
target/arm/tcg/sve_helper.c +3
-0+for (; j < oprsz; j +=sizeof (TYPE )) { \ + *(TYPE *)(vd +H (j)) =0 ; \ + } \ }Why do we have special versions of the predicated loop for 64-bit operands elsewhere (eg
DO_ZPZvsDO_ZPZ_D,DO_ZPZZvsDO_ZPZZ_D, etc) but we don't need to do that for compact ?
Efficiency vs laziness. 64-bit elements are special in that we can write things such that we don't need a double-loop, by examining just the lsb each byte of the predicate. But such specialization is not required. Here the inner loop will iterate twice for 64-bit elements.
r~
PATCH 21/25 target/arm: Implement COMPACT for byte/halfword
In reply to Richard Henderson--- target/arm/tcg/helper-sve-defs.h | 2 ++ target/arm/tcg/sve_helper.c | 2 ++ target/arm/tcg/translate-sve.c | 22 +++++++++++++++++----- target/arm/tcg/sve.decode | 1 - 4 files changed, 21 insertions(+), 6 deletions(-)
target/arm/tcg/helper-sve-defs.h +2 -0
@@ -733,6 +733,8 @@ DEF_HELPER_FLAGS_4(sve_trn_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_trn_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_trn_q, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_compact_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_compact_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_compact_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)DEF_HELPER_FLAGS_4 (sve_compact_d,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, i32)
target/arm/tcg/sve_helper.c +2 -0
@@ -3657,6 +3657,8 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \ } \ } +DO_COMPACT(sve2p2_compact_b, uint8_t, H1) +DO_COMPACT(sve2p2_compact_h, uint16_t, H1_2) DO_COMPACT(sve_compact_s, uint32_t, H1_4)DO_COMPACT (sve_compact_d, uint64_t,H1_8 )
target/arm/tcg/translate-sve.c +17 -5
@@ -2769,11 +2769,23 @@ TRANS_FEAT_NONSTREAMING(TRN2_q, aa64_sve_f64mm, do_interleave_q,*** SVE Permute Vector - Predicated Group */ -static gen_helper_gvec_3 *const compact_fns[4 ] = { -NULL ,NULL , gen_helper_sve_compact_s, gen_helper_sve_compact_d -}; -TRANS_FEAT_NONSTREAMING (COMPACT , aa64_sve, gen_gvec_ool_arg_zpz, - compact_fns[a->esz], a,0 ) +static bool trans_COMPACT (DisasContext *s,arg_COMPACT *a) +{ +static gen_helper_gvec_3 *const fns[4 ] = { + gen_helper_sve2p2_compact_b, gen_helper_sve2p2_compact_h, + gen_helper_sve_compact_s, gen_helper_sve_compact_d + }; + +if (!dc_isar_feature (aa64_sme2p2, s)) { +if (!(a->esz >=MO_32 + ?dc_isar_feature (aa64_sve, s) + :dc_isar_feature (aa64_sve2p2, s))) { +return false; + } + s->is_nonstreaming = true; + } +return gen_gvec_ool_arg_zpz (s, fns[a->esz], a,0 ); +}/* Call the helper that computes the ARM LastActiveElement pseudocode * function, scaled by the element size. This includes the not found
target/arm/tcg/sve.decode +0 -1
@@ -693,7 +693,6 @@ TBXQ 00000101 .. 1 ..... 001 101 ..... ..... @rd_rn_rm ### SVE Permute - Predicated Group # SVE compress active elements -# Note esz >= 2 COMPACT 00000101 .. 100001 100 ... ..... ..... @rd_pg_rn # SVE conditionally broadcast element to vector
Signature · 1 line
2.43.0
Re: [PATCH 21/25] target/arm: Implement COMPACT for byte/halfword
Quoted 14 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/helper-sve-defs.h | 2 ++ target/arm/tcg/sve_helper.c | 2 ++ target/arm/tcg/translate-sve.c | 22 +++++++++++++++++----- target/arm/tcg/sve.decode | 1 - 4 files changed, 21 insertions(+), 6 deletions(-)target/arm/tcg/helper-sve-defs.h +0
-0
target/arm/tcg/helper-sve-defs.h DEF_HELPER_FLAGS_4(sve_trn_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) · line 739
Quoted 7 lines
target/arm/tcg/helper-sve-defs.h +2
-0@@ -733,6 +733,8 @@ DEF_HELPER_FLAGS_4(sve_trn_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_trn_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve2_trn_q, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_compact_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve2p2_compact_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_compact_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32)DEF_HELPER_FLAGS_4 (sve_compact_d,TCG_CALL_NO_RWG , void, ptr, ptr, ptr, i32)
Maybe we don't need the 2p2 suffix in the helper function name? There's no "not-sve2p2 byte/halfword compact" operation we need it to contrast with.
Anyway,
thanks
-- PMM
PATCH 22/25 target/arm: Implement FIRSTP, LASTP
In reply to Richard Henderson--- target/arm/tcg/helper-sve-defs.h | 3 ++ target/arm/tcg/sve_helper.c | 30 +++++++++++++++++ target/arm/tcg/translate-sve.c | 56 ++++++++++++++++++++++++++++++++ target/arm/tcg/sve.decode | 3 ++ 4 files changed, 92 insertions(+)
target/arm/tcg/helper-sve-defs.h +3 -0
@@ -961,6 +961,9 @@ DEF_HELPER_FLAGS_4(sve_brkns, TCG_CALL_NO_RWG, i32, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve_cntp, TCG_CALL_NO_RWG, i64, ptr, ptr, i32) DEF_HELPER_FLAGS_2(sve2p1_cntp_c, TCG_CALL_NO_RWG_SE, i64, i32, i32) +DEF_HELPER_FLAGS_3(sve2p2_firstp, TCG_CALL_NO_RWG_SE, i64, ptr, ptr, i32) +DEF_HELPER_FLAGS_3(sve2p2_lastp, TCG_CALL_NO_RWG_SE, i64, ptr, ptr, i32) + DEF_HELPER_FLAGS_3(sve_whilel, TCG_CALL_NO_RWG, i32, ptr, i32, i32)DEF_HELPER_FLAGS_3 (sve_whileg,TCG_CALL_NO_RWG , i32, ptr, i32, i32)
target/arm/tcg/sve_helper.c +30 -0
@@ -4302,6 +4302,36 @@ uint64_t HELPER(sve2p1_cntp_c)(uint32_t png, uint32_t desc)return count >> p.lg2_stride; } +uint64_t HELPER (sve2p2_firstp )(void *vn,void *vg,uint32_t pred_desc) +{ +intptr_t words =DIV_ROUND_UP (FIELD_EX32 (pred_desc,PREDDESC ,OPRSZ ),8 ); +intptr_t esz =FIELD_EX32 (pred_desc,PREDDESC ,ESZ ); +uint64_t *n = vn, *g = vg, mask = pred_esz_masks[esz]; + +for (intptr_t i =0 ; i < words; ++i) { +uint64_t t = n[i] & g[i] & mask; +if (t) { +return (ctz64 (t) + i *64 ) >> esz; + } + } +return -1 ; +} + +uint64_t HELPER (sve2p2_lastp )(void *vn,void *vg,uint32_t pred_desc) +{ +intptr_t words =DIV_ROUND_UP (FIELD_EX32 (pred_desc,PREDDESC ,OPRSZ ),8 ); +intptr_t esz =FIELD_EX32 (pred_desc,PREDDESC ,ESZ ); +uint64_t *n = vn, *g = vg, mask = pred_esz_masks[esz]; + +for (intptr_t i = words -1 ; i >=0 ; --i) { +uint64_t t = n[i] & g[i] & mask; +if (t) { +return ((clz64 (t) ^63 ) + i *64 ) >> esz; + } + } +return -1 ; +} +/* C.f. Arm pseudocode EncodePredCount */ static uint64_t encode_pred_count (uint32_t elements,uint32_t count,uint32_t esz,bool invert)
target/arm/tcg/translate-sve.c +56 -0
62 lines not on this page · raw message
target/arm/tcg/sve.decode +3 -0
@@ -852,6 +852,9 @@ BRKN 00100101 0. 01100001 .... 0 .... 0 .... @pd_pg_pn_s CNTP 00100101 .. 100 000 10 .... 0 .... ..... @rd_pg4_pn CNTP_c 00100101 esz:2 100 000 10 000 vl:1 1 rn:4 rd:5 +FIRSTP 00100101 .. 100 001 10 .... 0 .... ..... @rd_pg4_pn +LASTP 00100101 .. 100 010 10 .... 0 .... ..... @rd_pg4_pn + # SVE inc/dec register by predicate count INCDECP_r 00100101 .. 10110 d:1 10001 00 .... ..... @incdec_pred u=1
Signature · 1 line
2.43.0
Re: [PATCH 22/25] target/arm: Implement FIRSTP, LASTP
Quoted 46 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- target/arm/tcg/helper-sve-defs.h | 3 ++ target/arm/tcg/sve_helper.c | 30 +++++++++++++++++ target/arm/tcg/translate-sve.c | 56 ++++++++++++++++++++++++++++++++ target/arm/tcg/sve.decode | 3 ++ 4 files changed, 92 insertions(+)target/arm/tcg/helper-sve-defs.h +3
-0@@ -961,6 +961,9 @@ DEF_HELPER_FLAGS_4(sve_brkns, TCG_CALL_NO_RWG, i32, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve_cntp, TCG_CALL_NO_RWG, i64, ptr, ptr, i32) DEF_HELPER_FLAGS_2(sve2p1_cntp_c, TCG_CALL_NO_RWG_SE, i64, i32, i32) +DEF_HELPER_FLAGS_3(sve2p2_firstp, TCG_CALL_NO_RWG_SE, i64, ptr, ptr, i32) +DEF_HELPER_FLAGS_3(sve2p2_lastp, TCG_CALL_NO_RWG_SE, i64, ptr, ptr, i32) + DEF_HELPER_FLAGS_3(sve_whilel, TCG_CALL_NO_RWG, i32, ptr, i32, i32)DEF_HELPER_FLAGS_3 (sve_whileg,TCG_CALL_NO_RWG , i32, ptr, i32, i32)target/arm/tcg/sve_helper.c +15
-0@@ -4302,6 +4302,36 @@ uint64_t HELPER(sve2p1_cntp_c)(uint32_t png, uint32_t desc)return count >> p.lg2_stride; } +uint64_t HELPER (sve2p2_firstp )(void *vn,void *vg,uint32_t pred_desc) +{ +intptr_t words =DIV_ROUND_UP (FIELD_EX32 (pred_desc,PREDDESC ,OPRSZ ),8 ); +intptr_t esz =FIELD_EX32 (pred_desc,PREDDESC ,ESZ ); +uint64_t *n = vn, *g = vg, mask = pred_esz_masks[esz]; + +for (intptr_t i =0 ; i < words; ++i) { +uint64_t t = n[i] & g[i] & mask; +if (t) { +return (ctz64 (t) + i *64 ) >> esz; + } + } +return -1 ; +} +
target/arm/tcg/sve_helper.c uint64_t HELPER(sve2p1_cntp_c)(uint32_t png, uint32_t desc) · line 4329
Quoted 10 lines
target/arm/tcg/sve_helper.c +10
-0+uint64_t HELPER (sve2p2_lastp )(void *vn,void *vg,uint32_t pred_desc) +{ +intptr_t words =DIV_ROUND_UP (FIELD_EX32 (pred_desc,PREDDESC ,OPRSZ ),8 ); +intptr_t esz =FIELD_EX32 (pred_desc,PREDDESC ,ESZ ); +uint64_t *n = vn, *g = vg, mask = pred_esz_masks[esz]; + +for (intptr_t i = words -1 ; i >=0 ; --i) { +uint64_t t = n[i] & g[i] & mask; +if (t) { +return ((clz64 (t) ^63 ) + i *64 ) >> esz;
Why XOR? Shouldn't this be the same kind of expression as we use in last_active_element():
return i * 64 + (63 - clz64(this_g));
target/arm/tcg/sve_helper.c uint64_t HELPER(sve2p1_cntp_c)(uint32_t png, uint32_t desc)
Quoted 10 lines
target/arm/tcg/sve_helper.c +9
-0+ } + } +return -1 ; +} +if (firstp) { +tcg_gen_ctzi_i64 (v, v,-1 ); + }else { +tcg_gen_clzi_i64 (v, v,64 ); +tcg_gen_subfi_i64 (v,63 , v);
...and we use 63 - clz64(...) here.
thanks
-- PMM
Re: [PATCH 22/25] target/arm: Implement FIRSTP, LASTP
Quoted 7 lines · Peter Maydell
Review
Quoted 2 lines
(quoted diff) +2
-0+ if (t) { + return ((clz64(t) ^ 63) + i * 64) >> esz;Why XOR? Shouldn't this be the same kind of expression as we use in
last_active_element():return i * 64 + (63 - clz64(this_g));
True, it could be written that way -- it's logically equivalent. I think it's an ingrained x86 bias on my part, where an RSUBI type instruction doesn't exist.
Quoted 4 lines
target/arm/tcg/translate-sve.c static bool trans_SINCDECP_z(DisasContext *s, arg_incdec2_pred *a) · line 3511
Quoted 2 lines
target/arm/tcg/translate-sve.c +2
-0+tcg_gen_clzi_i64 (v, v,64 ); +tcg_gen_subfi_i64 (v,63 , v);...and we use 63 - clz64(...) here.
With this one, v might be 0 and so 63 - 64 produces -1.
r~
PATCH 23/25 target/arm: Enable FEAT_SVE2p2 for -cpu max
In reply to Richard Henderson--- linux-user/aarch64/elfload.c | 1 + target/arm/tcg/cpu64.c | 2 +- docs/system/arm/emulation.rst | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
linux-user/aarch64/elfload.c +1 -0
@@ -173,6 +173,7 @@ abi_ulong get_elf_hwcap(CPUState *cs)GET_FEATURE_ID (aa64_cmpbr,ARM_HWCAP_A64_CMPBR );GET_FEATURE_ID (aa64_f8mm8,ARM_HWCAP_A64_F8MM8 );GET_FEATURE_ID (aa64_f8mm4,ARM_HWCAP_A64_F8MM4 ); +GET_FEATURE_ID (aa64_sve2p2,ARM_HWCAP_A64_SVE2P2 );return hwcaps; }
target/arm/tcg/cpu64.c +1 -1
@@ -1359,7 +1359,7 @@ void aarch64_max_tcg_initfn(Object *obj)SET_IDREG (isar,ID_AA64MMFR4 , t); t =GET_IDREG (isar,ID_AA64ZFR0 ); - t =FIELD_DP64 (t,ID_AA64ZFR0 ,SVEVER ,2 );/* FEAT_SVE2p1 */ + t =FIELD_DP64 (t,ID_AA64ZFR0 ,SVEVER ,3 );/* FEAT_SVE2p2 */ t =FIELD_DP64 (t,ID_AA64ZFR0 ,AES ,2 );/* FEAT_SVE_PMULL128 */ t =FIELD_DP64 (t,ID_AA64ZFR0 ,BITPERM ,1 );/* FEAT_SVE_BitPerm */ t =FIELD_DP64 (t,ID_AA64ZFR0 ,BFLOAT16 ,2 );/* FEAT_BF16, FEAT_EBF16 */
docs/system/arm/emulation.rst +1 -0
@@ -178,6 +178,7 @@ the following architecture extensions: - FEAT_SVE_SM4 (Scalable Vector SM4 instructions) - FEAT_SVE2 (Scalable Vector Extension version 2) - FEAT_SVE2p1 (Scalable Vector Extension version 2.1) +- FEAT_SVE2p2 (Scalable Vector Extension version 2.2) - FEAT_SPECRES (Speculation restriction instructions) - FEAT_SSBS (Speculative Store Bypass Safe) - FEAT_SSBS2 (MRS and MSR instructions for SSBS version 2)
Signature · 1 line
2.43.0
Re: [PATCH 23/25] target/arm: Enable FEAT_SVE2p2 for -cpu max
Quoted 7 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- linux-user/aarch64/elfload.c | 1 + target/arm/tcg/cpu64.c | 2 +- docs/system/arm/emulation.rst | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
This is fine as a patch, so
but maybe we should hold off on enabling SVE2p2 for "max" until we have SME2p2 ? Architecturally if you have SVE2p2 and SME then you're supposed to also have SME2p2. I know we usually don't worry about that kind of "feature X implies feature Y" when adding a new feature, trusting the guest to check separately for X and Y being present, but I feel like SVE/SME versions are particularly likely to be something guest software might make assumptions about here.
thanks
-- PMM
Re: [PATCH 23/25] target/arm: Enable FEAT_SVE2p2 for -cpu max
Quoted 13 lines · Peter Maydell
Quoted 7 lines · Richard Henderson
Signed-off-by Richard Henderson <[email protected]>--- linux-user/aarch64/elfload.c | 1 + target/arm/tcg/cpu64.c | 2 +- docs/system/arm/emulation.rst | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)This is fine as a patch, so
Reviewed-by Peter Maydell <[email protected]>
Quoted 8 lines
but maybe we should hold off on enabling SVE2p2 for "max" until we have SME2p2 ? Architecturally if you have SVE2p2 and SME then you're supposed to also have SME2p2. I know we usually don't worry about that kind of "feature X implies feature Y" when adding a new feature, trusting the guest to check separately for X and Y being present, but I feel like SVE/SME versions are particularly likely to be something guest software might make assumptions about here.
Fair enough. I wondered about that myself.
r~
PATCH 24/25 target/arm: Implement FEAT_SSVE_AES
In reply to Richard HendersonEnable FEAT_SVE_AES instructions in streaming mode.
--- target/arm/cpu-features.h | 5 +++++ linux-user/aarch64/elfload.c | 1 + target/arm/tcg/cpu64.c | 1 + target/arm/tcg/translate-sve.c | 20 +++++++++++--------- docs/system/arm/emulation.rst | 1 + 5 files changed, 19 insertions(+), 9 deletions(-)
target/arm/cpu-features.h +5 -0
@@ -1560,6 +1560,11 @@ static inline bool isar_feature_aa64_sve_b16b16(const ARMISARegisters *id)return FIELD_EX64_IDREG (id,ID_AA64ZFR0 ,B16B16 ); } +static inline bool isar_feature_aa64_ssve_aes (const ARMISARegisters *id) +{ +return FIELD_EX64_IDREG (id,ID_AA64SMFR0 ,AES ); +} +static inline bool isar_feature_aa64_ssve_f8fma (const ARMISARegisters *id) {return FIELD_EX64_IDREG (id,ID_AA64SMFR0 ,SF8FMA );
linux-user/aarch64/elfload.c +1 -0
@@ -174,6 +174,7 @@ abi_ulong get_elf_hwcap(CPUState *cs)GET_FEATURE_ID (aa64_f8mm8,ARM_HWCAP_A64_F8MM8 );GET_FEATURE_ID (aa64_f8mm4,ARM_HWCAP_A64_F8MM4 );GET_FEATURE_ID (aa64_sve2p2,ARM_HWCAP_A64_SVE2P2 ); +GET_FEATURE_ID (aa64_ssve_aes,ARM_HWCAP_A64_SME_AES );return hwcaps; }
target/arm/tcg/cpu64.c +1 -0
@@ -1378,6 +1378,7 @@ void aarch64_max_tcg_initfn(Object *obj)SET_IDREG (isar,ID_AA64DFR0 , t); t =GET_IDREG (isar,ID_AA64SMFR0 ); + t =FIELD_DP64 (t,ID_AA64SMFR0 ,AES ,1 );/* FEAT_SSVE_AES */ t =FIELD_DP64 (t,ID_AA64SMFR0 ,SF8DP2 ,1 );/* FEAT_SSVE_FP8DOT2 */ t =FIELD_DP64 (t,ID_AA64SMFR0 ,SF8DP4 ,1 );/* FEAT_SSVE_FP8DOT4 */ t =FIELD_DP64 (t,ID_AA64SMFR0 ,SF8FMA ,1 );/* FEAT_SSVE_FP8FMA */
target/arm/tcg/translate-sve.c +11 -9
@@ -7169,7 +7169,7 @@ static bool do_trans_pmull(DisasContext *s, arg_rrr_esz *a, bool sel)if (!dc_isar_feature (aa64_sve2_pmull128, s)) {return false; } - s->is_nonstreaming = true; + s->is_nonstreaming = !dc_isar_feature (aa64_ssve_aes, s); }return gen_gvec_ool_arg_zzz (s, fns[a->esz], a, sel); }
@@ -8174,15 +8174,17 @@ TRANS_FEAT(SDOT_zzzz_2s, aa64_sme2_or_sve2p1, gen_gvec_ool_arg_zzzz,TRANS_FEAT (UDOT_zzzz_2s, aa64_sme2_or_sve2p1, gen_gvec_ool_arg_zzzz, gen_helper_gvec_udot_2h, a, 0) -TRANS_FEAT_NONSTREAMING (AESMC , aa64_sve2_aes, gen_gvec_ool_zz, - gen_helper_crypto_aesmc, a->rd, a->rd, 0) -TRANS_FEAT_NONSTREAMING (AESIMC , aa64_sve2_aes, gen_gvec_ool_zz, - gen_helper_crypto_aesimc, a->rd, a->rd, 0) +TRANS_FEAT_STREAMING_IF (AESMC , aa64_sve2_aes, aa64_ssve_aes, + gen_gvec_ool_zz, gen_helper_crypto_aesmc, + a->rd, a->rd, 0) +TRANS_FEAT_STREAMING_IF (AESIMC , aa64_sve2_aes, aa64_ssve_aes, + gen_gvec_ool_zz, gen_helper_crypto_aesimc, + a->rd, a->rd, 0) -TRANS_FEAT_NONSTREAMING (AESE , aa64_sve2_aes, gen_gvec_ool_arg_zzz, - gen_helper_crypto_aese, a, 0) -TRANS_FEAT_NONSTREAMING (AESD , aa64_sve2_aes, gen_gvec_ool_arg_zzz, - gen_helper_crypto_aesd, a, 0) +TRANS_FEAT_STREAMING_IF (AESE , aa64_sve2_aes, aa64_ssve_aes, + gen_gvec_ool_arg_zzz, gen_helper_crypto_aese, a, 0) +TRANS_FEAT_STREAMING_IF (AESD , aa64_sve2_aes, aa64_ssve_aes, + gen_gvec_ool_arg_zzz, gen_helper_crypto_aesd, a, 0)TRANS_FEAT_NONSTREAMING (SM4E , aa64_sve2_sm4, gen_gvec_ool_arg_zzz, gen_helper_crypto_sm4e, a,0 )
docs/system/arm/emulation.rst +1 -0
@@ -166,6 +166,7 @@ the following architecture extensions: - FEAT_SME_F64F64 (Double-precision floating-point outer product instructions) - FEAT_SME_I16I64 (16-bit to 64-bit integer widening outer product instructions) - FEAT_SME_LUTv2 (Lookup table instructions with 4-bit indices and 8-bit elements) +- FEAT_SSVE_AES (Streaming SVE Mode Advanced Encryption Standard and 128-bit polynomial multiply long instructions) - FEAT_SSVE_FP8DOT2 (SVE2 FP8 2-way dot product to half-precision instructions in Streaming SVE mode) - FEAT_SSVE_FP8DOT4 (SVE2 FP8 4-way dot product to single-precision instructions in Streaming SVE mode) - FEAT_SSVE_FP8FMA (SVE2 FP8 multiply-accumulate to half-precision and single-precision instructions in Streaming SVE mode)
Signature · 1 line
2.43.0
Re: [PATCH 24/25] target/arm: Implement FEAT_SSVE_AES
Quoted 11 lines · Richard Henderson
Enable
FEAT_SVE_AESinstructions in streaming mode.Signed-off-by Richard Henderson <[email protected]>--- target/arm/cpu-features.h | 5 +++++ linux-user/aarch64/elfload.c | 1 + target/arm/tcg/cpu64.c | 1 + target/arm/tcg/translate-sve.c | 20 +++++++++++--------- docs/system/arm/emulation.rst | 1 + 5 files changed, 19 insertions(+), 9 deletions(-)
As far as this patch goes,
but I was briefly confused by something in our pre-existing code for these insns:
target/arm/tcg/translate-sve.c TRANS_FEAT(SDOT_zzzz_2s, aa64_sme2_or_sve2p1, gen_gvec_ool_arg_zzzz, · line 8180
Quoted 8 lines
target/arm/tcg/translate-sve.c +0
-4@@ -8174,15 +8174,17 @@ TRANS_FEAT(SDOT_zzzz_2s, aa64_sme2_or_sve2p1, gen_gvec_ool_arg_zzzz,TRANS_FEAT (UDOT_zzzz_2s, aa64_sme2_or_sve2p1, gen_gvec_ool_arg_zzzz, gen_helper_gvec_udot_2h, a,0 ) -TRANS_FEAT_NONSTREAMING (AESMC , aa64_sve2_aes, gen_gvec_ool_zz, - gen_helper_crypto_aesmc, a->rd, a->rd, 0) -TRANS_FEAT_NONSTREAMING (AESIMC , aa64_sve2_aes, gen_gvec_ool_zz, - gen_helper_crypto_aesimc, a->rd, a->rd,0 )
We mark all of these as aa64_sve2_aes(), which we define as
return FIELD_EX64_IDREG(id, ID_AA64ZFR0, AES) != 0;
But the Arm ARM calls the feature defined by AES >= 0 "FEAT_SVE_AES", not "FEAT_SVE2_AES". I think this is because we implemented this before the Arm ARM split out separate official feature names for the sub-parts of SVE2, and we happened to choose something that is almost but not quite the same as the official one.
(cf commit bc980d66308 adding the extra names to the docs). The name we have has slight potential to confuse, because there is also a FEAT_SVE_AES2 (for AES >= 3), which we don't implement yet.
Do you think it's worth updating our feature function names to match the official architecture names, or shall we just leave it be?
-- PMM
Re: [PATCH 24/25] target/arm: Implement FEAT_SSVE_AES
Quoted 2 lines · Peter Maydell
Do you think it's worth updating our feature function names to match the official architecture names, or shall we just leave it be?
My first thought was that this might have been a combo feature test, requiring both sve2 and aes -- I've done that elsewhere with e.g. isar_feature_aa64_sve2_f8mm8. But since that isn't the case here, it might be worth making the function match the (newer?) feature name.
r~
PATCH 25/25 target/arm: Use expand_pred_N for helper_sve_not_zpz_N
In reply to Richard HendersonThese is a bitwise operation; with expand_pred_N,
we can always operate on uint64_t.
--- target/arm/tcg/sve_helper.c | 43 ++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-)
target/arm/tcg/sve_helper.c +38 -5
@@ -917,12 +917,45 @@ DO_ZPZ(sve_ah_fneg_h, uint16_t, H1_2, DO_AH_FNEG_H) DO_ZPZ(sve_ah_fneg_s, uint32_t, H1_4, DO_AH_FNEG_S) DO_ZPZ_D(sve_ah_fneg_d, uint64_t, DO_AH_FNEG_D) -#define DO_NOT (N ) (~N) +static inline void +sve_not_zpz (uint64_t *d,uint64_t *n,uint8_t *pg,uint32_t desc, +uint64_t (*expand)(uint8_t )) +{ +intptr_t opr_sz =simd_oprsz (desc) /8 ; +bool zeroing =simd_data (desc) &1 ; -DO_ZPZ(sve_not_zpz_b, uint8_t, H1, DO_NOT) -DO_ZPZ(sve_not_zpz_h, uint16_t, H1_2, DO_NOT) -DO_ZPZ(sve_not_zpz_s, uint32_t, H1_4, DO_NOT) -DO_ZPZ_D(sve_not_zpz_d, uint64_t, DO_NOT) +if (zeroing) { +for (intptr_t i =0 ; i < opr_sz; ++i) { +uint64_t p =expand (pg[H1 (i)]); + d[i] = ~n[i] & p; + } + }else { +for (intptr_t i =0 ; i < opr_sz; ++i) { +uint64_t p =expand (pg[H1 (i)]); + d[i] = (~n[i] & p) | (d[i] & ~p); + } + } +} + +void HELPER (sve_not_zpz_b )(void *vd,void *vn,void *pg,uint32_t desc) +{ +sve_not_zpz (vd, vn, pg, desc, expand_pred_b); +} + +void HELPER (sve_not_zpz_h )(void *vd,void *vn,void *pg,uint32_t desc) +{ +sve_not_zpz (vd, vn, pg, desc, expand_pred_h); +} + +void HELPER (sve_not_zpz_s )(void *vd,void *vn,void *pg,uint32_t desc) +{ +sve_not_zpz (vd, vn, pg, desc, expand_pred_s); +} + +void HELPER (sve_not_zpz_d )(void *vd,void *vn,void *pg,uint32_t desc) +{ +sve_not_zpz (vd, vn, pg, desc, expand_pred_d); +}#define DO_SXTB (N ) ((int8_t)N)#define DO_SXTH (N ) ((int16_t)N)
Signature · 1 line
2.43.0
Re: [PATCH 25/25] target/arm: Use expand_pred_N for helper_sve_not_zpz_N
Quoted 5 lines · Richard Henderson
These is a bitwise operation; with
expand_pred_N,
we can always operate onuint64_t.Signed-off-by Richard Henderson <[email protected]>
thanks
-- PMM
Quoted 27 lines · Richard Henderson
Based-on: [email protected] ("[PATCH v9 00/45] target/arm: Implement
FEAT_FP8")Another batch of code on the way toward
FEAT_SME2p2.r~
Richard Henderson (25):
target/arm: Add feature predicates for SVE2.2 and SME2.2 target/arm: Rename sve unary predicated patterns target/arm: Enable zeroing inDO_ZPZmacros insve_helper.ctarget/arm: ExpandDO_ZPZintranslate-sve.ctarget/arm: Implement SVE integer unary operations (predicated,
zeroing)
target/arm: Implement SVE bitwise unary operations (predicated,
zeroing)
target/arm: Implement SVE reverse within elements (zeroing) target/arm: Implement SVE reverse doublewords (zeroing) target/arm: Implement SVE2 integer unary operations (predicated,
zeroing)
target/arm: Add data argument todo_frint_modetarget/arm: Implement Floating-point round to integral value
(predicated, zeroing)
target/arm: Implement Floating-point convert (predicated, zeroing)
Quoted 8 lines
target/arm: Implement Floating-point square root (predicated, zeroing) target/arm: Implement SCVTF, UCVTF (predicated, zeroing) target/arm: Implement FRINT{32,64}{X,Z}
target/arm: Enable zeroing in DO_FCVT{N,L}T macros insve_helper.ctarget/arm: Implement SVE floating-point convert (top, predicated,
zeroing)
target/arm: Implement floating-point log and convert to integer
(zeroing)
I'm going to apply these first 18 patches (all the zeroing versions of insns) to target-arm.next as they all were straightforward, and I have a pullreq nearly ready to go.
thanks
-- PMM