-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
In DXC we are retrospectively adding an isnormal HLSL function that is implemented using the existing DXIL opcode. This was tested in previous HLKs by mutating DXIL, so it is supported in the ecosystem, just not exposed directly from HLSL. We need to add this to Clang as well.
Implement the isnormal function with half and float overloads.
Targeting DirectX:
The 32 bit overload should use the IsNormal DXIL Op
In SM6.8 and earlier the 16 bit overload should be emulated using LLVM IR
In SM6.9 and later the 16 bit overload should use the IsNormal DXIL Op
Add unit tests showing the correct IR/DXIL Op is generated for each float size and SM.
Targeting SPIRV:
OpIsNormal requires the kernel capability, so it cannot be used; therefore, the isnormal op should be emulated.
IsNormal = !(Nan || Inf || Zero || Subnormal)
In the bit pattern of a 16 bit or 32 bit float; a normal number corresponds to one whose exponent bits are neither all zeros nor all ones.
Add unit tests showing isnormal is emulated.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status