https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122716
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tamar Christina <[email protected]>: https://gcc.gnu.org/g:04f06bfd18c01aee7d37e992be87c6718a1b85f3 commit r17-6832-g04f06bfd18c01aee7d37e992be87c6718a1b85f3 Author: Tamar Christina <[email protected]> Date: Mon Nov 30 08:21:54 2026 +0000 aarch64: use multi-character print operands for SME ranges [PR122716] Several SME patterns only needed C output blocks in order to compute the last element of an assembler range. For example, patterns that print a range such as: 0:<last> were first calculating <last> in C, storing it in a temporary operand, and then returning an otherwise fixed output string. With the new named output modifiers we can keep those patterns as normal templates. This patch adds internal AArch64 print operands for the SME range cases and uses them from aarch64-sme.md. For example: 0:%[SME_VG_END:0] %1:%[SME_RANGE_END3:1] The first form prints the end of a vector-group range. The second prints operand 1 plus 3, which is the inclusive end used by the corresponding SME assembler syntax. The names are intentionally internal-only: they make the machine descriptions clearer, but they are not new user asm modifiers. The result is that the SME patterns describe the instruction text directly again, while the target hook keeps the small amount of range arithmetic in one place. gcc/ChangeLog: PR target/122716 * config/aarch64/aarch64-print-operands.def (sme_range_end, SME_VG_END, SME_RANGE_END1, SME_RANGE_END3): New definitions. * config/aarch64/aarch64.cc (aarch64_print_operand): Print the last index of an SME vector group or the inclusive end of a slice range. * config/aarch64/aarch64-sme.md (@aarch64_sme_<optab><mode><mode>): Use SME_VG_END in all definitions. (*aarch64_sme_<optab><mode><mode>_plus): Likewise in all definitions. (*aarch64_sme_zero_za_slices<mode>_plus): Use the SME_RANGE_END modifiers. (*aarch64_sme_<optab><VNx4SI_ONLY:mode><SVE_FULL_BHI:mode>_plus): Likewise. (*aarch64_sme_<optab><VNx4SI_ONLY:mode><SME_ZA_BHIx24:mode>_plus): Likewise. (*aarch64_sme_single_<optab><VNx4SI_ONLY:mode><SME_ZA_BHIx24:mode>_plus): Likewise. (*aarch64_sme_lane_<optab><VNx4SI_ONLY:mode><SME_ZA_BHIx124:mode>): Likewise. (*aarch64_sme_<optab><VNx2DI_ONLY:mode><VNx8HI_ONLY:mode>_plus): Likewise. (*aarch64_sme_<optab><VNx2DI_ONLY:mode><SME_ZA_HIx24:mode>_plus): Likewise. (*aarch64_sme_single_<optab><VNx2DI_ONLY:mode><SME_ZA_HIx24:mode>_plus): Likewise. (*aarch64_sme_lane_<optab><VNx2DI_ONLY:mode><SME_ZA_HIx124:mode>): Likewise. (*aarch64_sme_<optab><VNx4SI_ONLY:mode><SVE_FULL_HF:mode>_plus): Likewise. (*aarch64_sme_<optab><VNx4SI_ONLY:mode><SME_ZA_HFx24:mode>_plus): Likewise. (*aarch64_sme_single_<optab><VNx4SI_ONLY:mode><SME_ZA_HFx24:mode>_plus): Likewise. (*aarch64_sme_lane_<optab><VNx4SI_ONLY:mode><SME_ZA_HFx124:mode>): Likewise. (*aarch64_sme_<optab><VNx8HI_ONLY:mode><SME_ZA_FP8_x24:mode>_plus): Likewise. (*aarch64_sme_<optab><VNx4SI_ONLY:mode><SME_ZA_FP8_x24:mode>_plus): Likewise. (*aarch64_sme_<optab><VNx8HI_ONLY:mode><VNx16QI_ONLY:mode>_plus): Likewise. (*aarch64_sme_<optab><VNx4SI_ONLY:mode><VNx16QI_ONLY:mode>_plus): Likewise. (*aarch64_sme_single_<optab><VNx8HI_ONLY:mode><SME_ZA_FP8_x24:mode>_plus): Likewise. (*aarch64_sme_single_<optab><VNx4SI_ONLY:mode><SME_ZA_FP8_x24:mode>_plus): Likewise. (*aarch64_sme_lane_<optab><VNx8HI_ONLY:mode><SME_ZA_FP8_x124:mode>): Likewise. (*aarch64_sme_lane_<optab><VNx4SI_ONLY:mode><SME_ZA_FP8_x124:mode>): Likewise.
