summaryrefslogtreecommitdiff
path: root/tests/hlsl-intrinsic/countbits.slang
AgeCommit message (Collapse)Author
2025-05-16Fix broken -emit-spirv-via-glsl test option (#7091)sricker-nvidia
Fixes issue #6898 The -emit-spirv-via-glsl slang-test option has been broken for some amount of time. Tests that were using it were operating as if using -emit-spirv-directly, leading to many duplicated tests. After fixing the test option, there were an number of errors that appeared as a result. This change fixes the broken test option and the resulting test errors. Some of the test errors revealed some legitimate issues, such as: -The GLSL bitCount instrinsic only supports 32-bit integers and requires emulation for other bit widths. -Emitting GLSL 8-bit and 16-bit glsl integer types did not emit the proper extension requirements -Emitting GLSL and casting for 16-bit integers was missing a closing parenthesis. -Missing profile for GL_EXT_shader_explicit_arithmetic_types -Missing toType cases for UInt8/Int8 for the kIROp_BitCast case in tryEmitInstExprImpl.
2025-05-05Add countbits 16-bit and 8-bit support (#6433) (#6897)sricker-nvidia
Change adds 16-bit and 8-bit support for countbits intrinsic. In cases where a backend's native counbits lacks support, support is emulated. New tests are added for 16-bit and 8-bit support. Additional testing added for 32-bit and minor updates made to 64-bit countbits.
2024-06-27Extend `countbits` intrinsic for vector types (#4499)venkataram-nv
* Extend `countbits` intrinsic for vector types This commit implements the overloading function for `countbits` function. Because HLSL has following overloadings, ``` uint count_bits(uint value); uint2 count_bits(uint2 value); uint3 count_bits(uint3 value); uint4 count_bits(uint4 value); ``` https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/countbits