[clang] [llvm] [HLSL] Re-implement countbits with the correct return type (PR #113189)

Sarah Spall via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 12:19:15 PDT 2024


================
@@ -705,66 +705,74 @@ float4 cosh(float4);
 
 #ifdef __HLSL_ENABLE_16_BIT
 _HLSL_AVAILABILITY(shadermodel, 6.2)
-_HLSL_BUILTIN_ALIAS(__builtin_elementwise_popcount)
-int16_t countbits(int16_t);
----------------
spall wrote:

When I asked Justin about this he pointed to this link:
https://github.com/microsoft/DirectXShaderCompiler/blob/main/utils/hct/gen_intrin_main.txt#L114
and suggested it meant both signed and unsigned were supported. 

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


More information about the cfe-commits mailing list