================
@@ -864,6 +898,19 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
CGM.getHLSLRuntime().getSaturateIntrinsic(), ArrayRef<Value *>{Op0},
nullptr, "hlsl.saturate");
}
+ case Builtin::BI__builtin_hlsl_wave_prefix_count_bits: {
+ Value *Op = EmitScalarExpr(E->getArg(0));
+ assert(Op->getType()->isIntegerTy(1) &&
+ "WavePrefixBitCount operand must be a boolean type");
+
+ Intrinsic::ID IID = getPrefixOpIntrinsic(
+ /* OpKind */ 136, getTarget().getTriple().getArch(),
+ CGM.getHLSLRuntime(), E->getArg(0)->getType());
----------------
tex3d wrote:
I think we should have an independent code path for the bit count operation
instead of passing a hard-coded DXIL OpCode as if it's an `OpKind` enumeration
for the `WavePrefixOp`.
https://github.com/llvm/llvm-project/pull/178059
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits