[clang] Add __builtin_bitreverseg (PR #179126)
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 2 06:28:38 PST 2026
================
@@ -3683,6 +3683,16 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
return RValue::get(
emitBuiltinWithOneOverloadedType<1>(*this, E, Intrinsic::bswap));
}
+ case Builtin::BI__builtin_bitreverseg: {
+ Value *ArgValue = EmitScalarExpr(E->getArg(0));
+ llvm::IntegerType *IntTy = cast<llvm::IntegerType>(ArgValue->getType());
+ assert(IntTy &&
+ "LLVM's __builtin_bitreverseg only support integer variants");
+ if (IntTy->getBitWidth() == 1)
----------------
RKSimon wrote:
do you have test coverage for this case?
https://github.com/llvm/llvm-project/pull/179126
More information about the cfe-commits
mailing list