[clang] [Clang][AArch64] Add fp8 variants for untyped NEON intrinsics (PR #128019)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Fri May 2 10:10:09 PDT 2025


================
@@ -2056,9 +2056,21 @@ void NeonEmitter::createIntrinsic(const Record *R,
   auto &Entry = IntrinsicMap[Name];
 
   for (auto &I : NewTypeSpecs) {
+
+    // MFloat8 type is only available on AArch64. If encountered set ArchGuard
+    // correctly.
+    std::string savedArchGuard = ArchGuard;
+    if (Type(I.first, ".").isMFloat8()) {
+      if (ArchGuard.empty()) {
+        ArchGuard = "defined(__aarch64__)";
+      } else if (ArchGuard.find("defined(__aarch64__)") == std::string::npos) {
+        ArchGuard = "defined(__aarch64__) && (" + savedArchGuard + ")";
+      }
+    }
     Entry.emplace_back(R, Name, Proto, I.first, I.second, CK, Body, *this,
                        ArchGuard, TargetGuard, IsUnavailable, BigEndianSafe);
     Out.push_back(&Entry.back());
+    ArchGuard = savedArchGuard;
----------------
paulwalker-arm wrote:

If you use the new variable (whose current name breaks the coding standard) in the call to `Entry.emplace_back` you'll not need to restore ArchGuard.

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


More information about the cfe-commits mailing list