[clang] [Clang][AArch64] Diagnose invalid FPM scale arguments (PR #227722)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 03:22:50 PDT 2026


================
@@ -4922,6 +4922,39 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
     MTEIntrinsicID = Intrinsic::aarch64_subp; break;
   }
 
+  if (BuiltinID == clang::AArch64::BI__arm_set_fpm_lscale) {
+    Value *FPM = EmitScalarExpr(E->getArg(0));
+    Value *Scale = EmitScalarExpr(E->getArg(1));
+
+    Scale = Builder.CreateZExtOrTrunc(Scale, FPM->getType());
----------------
CarolineConcatto wrote:

The only thing is that for constant we emit an error, but we could just accept like we are doing for the run time if we are now masking the input value.

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


More information about the cfe-commits mailing list