DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

[SPIR-V] Performing Signed absolute value on UINT

Open spall opened this issue 7 months ago • 0 comments

Description For at least UINT_MAX 0xffffffff, but I suspect for all Uint values, SPIR-V is generating a SAbs operation, interpreting the unsigned int as a signed integer. Resulting in abs(UINT_MAX) = 1.

Doing the same for uint16_t and uint64_t.

Steps to Reproduce https://godbolt.org/z/o5hcY4EaG

Actual Behavior

OpExtInst %uint %1 SAbs %uint_4294967295

Environment

  • DXC version 1.8.2502
  • Host Operating System N/A

spall avatar Jun 04 '25 23:06 spall