[clang] [AArch64][SME2] Enable bfm builtins for sme2 (PR #71927)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 19 23:28:54 PST 2023


================
@@ -1992,3 +1986,12 @@ let TargetGuard = "sme2" in {
   def SVADD_SINGLE_X2 : SInst<"svadd[_single_{d}_x2]", "22d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x2", [IsStreaming], []>;
   def SVADD_SINGLE_X4 : SInst<"svadd[_single_{d}_x4]", "44d", "cUcsUsiUilUl", MergeNone, "aarch64_sve_add_single_x4", [IsStreaming], []>;
 }
+
+let TargetGuard = "sve2p1|sme2" in {
+// == BFloat16 multiply-subtract ==
+  def SVBFMLSLB : SInst<"svbfmlslb[_{d}]", "dd$$", "f", MergeNone, "aarch64_sve_bfmlslb", [IsOverloadNone, IsStreaming], []>;
+  def SVBFMLSLT : SInst<"svbfmlslt[_{d}]", "dd$$", "f", MergeNone, "aarch64_sve_bfmlslt", [IsOverloadNone, IsStreaming], []>;
+
+  def SVBFMLSLB_LANE : SInst<"svbfmlslb_lane[_{d}]", "dd$$i", "f", MergeNone, "aarch64_sve_bfmlslb_lane", [IsOverloadNone, IsStreaming], [ImmCheck<3, ImmCheck0_7>]>;
----------------
sdesmalen-arm wrote:

I suspect having `IsStreaming` here this is not going to work, because with SVE2p1 the function works in a non-streaming mode. The fact that the test passes suggests we're missing a diagnostic when the intrinsic has `IsStreaming`, but the caller is not a streaming function.

For the purpose of these intrinsics, we also need to add a new attribute instead of `IsStreaming` which adds logic that emits a diagnostic only when the function is not in streaming mode or the function is not compiled with +sve2p1.

https://github.com/llvm/llvm-project/pull/71927


More information about the cfe-commits mailing list