Skip to content

Commit

Permalink
[AArch64] Adopt updated B16B16 target flags
Browse files Browse the repository at this point in the history
The enablement of SVE/SME non-widening BFloat16 instructions was recently
changed in response to an architecture update, in which:
	- FEAT_SVE_B16B16 was weakened
	- FEAT_SME_B16B16 was introduced
New flags, 'sve-b16b16' and 'sme-b16b16' were introduced to replace the
existing 'b16b16'. This was acheived in the below two patches.
	- llvm#101480
	- llvm#102501
Ideally, the interface change introduced here will be valid in LLVM-19.
We do not see it necessary to back-port the entire change, but just to add
'sme-b16b16' and 'sve-b16b16' as aliases to the existing (and unchanged)
'b16b16' and 'sme2' flags which together cover all of these features.

The predication of Bf16 variants of svmin/svminnm and svmax/svmaxnm is also
fixed in this change.
  • Loading branch information
SpencerAbson authored and pradt2 committed Feb 11, 2025
1 parent 77cf874 commit 5d8eadc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions llvm/lib/Target/AArch64/AArch64Features.td
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,15 @@ def FeatureSMEB16B16 : ExtensionWithMArch<"sme-b16b16", "SMEB16B16", "FEAT_SME_B
"Enable SME2.1 ZA-targeting non-widening BFloat16 instructions",
[FeatureSME2, FeatureSVEB16B16]>;

// FeatureSVEB16B16 and FeatureSMEB16B16 act as aliases for {FeatureB16B16}, and
// {FeatureB16B16, FeatureSME2} respectively. This allows LLVM-20 interfacing programs
// that use '+sve-b16b16' and '+sme-b16b16' to compile in LLVM-19.
def FeatureSVEB16B16 : ExtensionWithMArch<"sve-b16b16", "SVEB16B16", "FEAT_SVE_B16B16",
"Enable SVE2 non-widening and SME2 Z-targeting non-widening BFloat16 instructions", [FeatureB16B16]>;

def FeatureSMEB16B16 : ExtensionWithMArch<"sme-b16b16", "SMEB16B16", "FEAT_SME_B16B16",
"Enable SME2.1 ZA-targeting non-widening BFloat16 instructions", [FeatureSME2, FeatureB16B16]>;

def FeatureSMEF16F16 : ExtensionWithMArch<"sme-f16f16", "SMEF16F16", "FEAT_SME_F16F16",
"Enable SME non-widening Float16 instructions", [FeatureSME2]>;

Expand Down

0 comments on commit 5d8eadc

Please sign in to comment.