Open
Description
- Implement
isnan
clang builtin, - Link
isnan
clang builtin withhlsl_intrinsics.h
- Add sema checks for
isnan
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
- Add codegen for
isnan
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
- Add codegen tests to
clang/test/CodeGenHLSL/builtins/isnan.hlsl
- Add sema tests to
clang/test/SemaHLSL/BuiltIns/isnan-errors.hlsl
- Create the
int_dx_isnan
intrinsic inIntrinsicsDirectX.td
- Create the
DXILOpMapping
ofint_dx_isnan
to8
inDXIL.td
- Create the
isnan.ll
andisnan_errors.ll
tests inllvm/test/CodeGen/DirectX/
- Create the
int_spv_isnan
intrinsic inIntrinsicsSPIRV.td
- In SPIRVInstructionSelector.cpp create the
isnan
lowering and map it toint_spv_isnan
inSPIRVInstructionSelector::selectIntrinsic
. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/isnan.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
8 | IsNaN | 6.0 | () |
SPIR-V
OpIsNan:
Description:
Result is true if x is a NaN for the floating-point encoding used
by the type of x, otherwise result is false.
Result Type must be a scalar or vector of Boolean
type.
x must be a scalar or vector of floating-point type. It
must have the same number of components as Result Type.
Results are computed per component.
Word Count | Opcode | Results | Operands | |
---|---|---|---|---|
4 |
156 |
<id> |
<id> |
Test Case(s)
Example 1
//dxc isnan_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export bool4 fn(float4 p1) {
return isnan(p1);
}
HLSL:
Determines if the specified value is NAN or QNAN.
ret isnan(x) |
---|
Parameters
Item | Description |
---|---|
x |
[in] The specified value. |
Return Value
Returns a value of the same size as the input, with a value set to True if the x parameter is NAN or QNAN. Otherwise, False.
Type Description
Name | Template Type | Component Type | Size |
---|---|---|---|
x | scalar, vector, or matrix | float | any |
ret | scalar, vector, or matrix | bool | as input |
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 2 (DirectX HLSL) and higher shader models | yes |
Shader Model 1 (DirectX HLSL) | yes (vs_1_1 only) |
Requirements
Requirement | Value |
---|---|
Header |
|
See also
Metadata
Metadata
Assignees
Type
Projects
Status
No status