[clang] [CIR][AMDGPU] Adds amdgcn logb and scalebn builtins (PR #191344)

Rana Pratap Reddy via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 23:12:45 PDT 2026


================
@@ -18,6 +18,79 @@
 
 using namespace clang;
 using namespace clang::CIRGen;
+using namespace cir;
+
+static mlir::Value emitBinaryExpMaybeConstrainedFPBuiltin(
+    CIRGenFunction &cgf, const CallExpr *e, llvm::StringRef intrinsicName,
+    llvm::StringRef constrainedIntrinsicName) {
+  mlir::Value src0 = cgf.emitScalarExpr(e->getArg(0));
+  mlir::Value src1 = cgf.emitScalarExpr(e->getArg(1));
+  mlir::Location loc = cgf.getLoc(e->getExprLoc());
+
+  CIRGenBuilderTy &builder = cgf.getBuilder();
+
+  CIRGenFunction::CIRGenFPOptionsRAII fpOptsRAII(cgf, e);
+
+  if (builder.getIsFPConstrained()) {
+    return builder.emitIntrinsicCallOp(loc, constrainedIntrinsicName,
----------------
ranapratap55 wrote:

Added `errorNYI()` for constrained FP intrinsics. Thanks.

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


More information about the cfe-commits mailing list