[clang] [CIR] Lowering __builtin_stdc_* calls (PR #214931)
Kunal Dubey via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 11 12:55:37 PDT 2026
================
@@ -111,6 +111,45 @@ static RValue emitBuiltinBitOpWithFallback(CIRGenFunction &cgf,
return RValue::get(builder.createSelect(loc, isZero, fallbackValue, result));
}
+// stdc_{leading,trailing}_{zeros,ones} and stdc_count_ones: counts bits using
+// clz, ctz, or popcount. InvertArg flips the input to count the opposite bit
+// value.
+template <typename Op, typename... Args>
+static RValue emitStdcCountOp(CIRGenFunction &cgf, const CallExpr *e,
----------------
xakep8 wrote:
Added a helper to check and reject the unsupported _BitInt width which now check if the width is supported or not.
https://github.com/llvm/llvm-project/pull/214931
More information about the cfe-commits
mailing list