[clang] [llvm] [HLSL] implement elementwise firstbithigh hlsl builtin (PR #111082)

Sarah Spall via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 09:34:25 PDT 2024


spall wrote:

> > > Despite all of this, DXC does indeed support 16- and 64-bit overloads, as seen here: https://hlsl.godbolt.org/z/qbc17xz35
> > > Note that the return type of the operation is not overloaded - all of the overloads of this function return uint.
> > 
> > 
> > Why is the return type not overloaded? Isn't it overloaded for countbits which is a similar function.
> 
> The return type for countbits is also not overloaded: https://hlsl.godbolt.org/z/oGYhsjEGc - in fact none of the operations that use the `unaryBits` operation class are overloaded on the return type.
> 
> The code we're generating with clang for countbits right now actually just looks like it's wrong. It doesn't match what DXC does at all: https://hlsl.godbolt.org/z/K8n3j5o3K
Addressed here:
https://github.com/llvm/llvm-project/pull/113189

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


More information about the llvm-commits mailing list