-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implement the asdouble
HLSL Function
#99081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-codegen Author: Farzon Lotfi (farzonl)
> NOTE: asdouble is special: there are questions around what the right design is for this. If 64-bit integers are supported then we don't need a specific DXIL operation to do this. We also need to consider what the right thing is for the SPIR-V backend.
DirectX
SPIR-VThere is no support for Test Case(s)Example 1//dxc asdouble_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export double4 fn(uint4 p1, uint4 p2) {
return asdouble(p1, p2);
} HLSL:Reinterprets a cast value (two 32-bit values) into a double. Syntaxdouble asdouble(
in uint lowbits,
in uint highbits
); Parameters<dl> <dt> lowbits [in] Type: uint The low 32-bit pattern of the input value. </dd> <dt> highbits [in] Type: uint The high 32-bit pattern of the input value. </dd> </dl> Return valueType: double The input (two 32-bit values) recast as a double. RemarksThe following overloaded version is also available: double2 asdouble(uint2 lowbits, uint2 highbits); If the input value is two 32-bit components, the return type will contain one double. If the input value is four 32-bit components, the return type will contain two doubles. If the input value is a 64-bit type, the returned value will have the same number of components as the input value. Minimum Shader ModelThis function is supported in the following shader models.
This function is supported in the following types of shaders:
See also<dl> <dt> Intrinsic Functions Shader Model 5 |
@llvm/issue-subscribers-clang-frontend Author: Farzon Lotfi (farzonl)
> NOTE: asdouble is special: there are questions around what the right design is for this. If 64-bit integers are supported then we don't need a specific DXIL operation to do this. We also need to consider what the right thing is for the SPIR-V backend.
DirectX
SPIR-VThere is no support for Test Case(s)Example 1//dxc asdouble_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export double4 fn(uint4 p1, uint4 p2) {
return asdouble(p1, p2);
} HLSL:Reinterprets a cast value (two 32-bit values) into a double. Syntaxdouble asdouble(
in uint lowbits,
in uint highbits
); Parameters<dl> <dt> lowbits [in] Type: uint The low 32-bit pattern of the input value. </dd> <dt> highbits [in] Type: uint The high 32-bit pattern of the input value. </dd> </dl> Return valueType: double The input (two 32-bit values) recast as a double. RemarksThe following overloaded version is also available: double2 asdouble(uint2 lowbits, uint2 highbits); If the input value is two 32-bit components, the return type will contain one double. If the input value is four 32-bit components, the return type will contain two doubles. If the input value is a 64-bit type, the returned value will have the same number of components as the input value. Minimum Shader ModelThis function is supported in the following shader models.
This function is supported in the following types of shaders:
See also<dl> <dt> Intrinsic Functions Shader Model 5 |
asdouble
clang builtin,asdouble
clang builtin withhlsl_intrinsics.h
asdouble
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
asdouble
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/asdouble.hlsl
clang/test/SemaHLSL/BuiltIns/asdouble-errors.hlsl
int_dx_asdouble
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_asdouble
to101
inDXIL.td
asdouble.ll
andasdouble_errors.ll
tests inllvm/test/CodeGen/DirectX/
DirectX
SPIR-V
There is no support for
asdouble
when targeting SPIR-V.Test Case(s)
Example 1
HLSL:
Reinterprets a cast value (two 32-bit values) into a double.
Syntax
Parameters
lowbits [in]
Type: uint
The low 32-bit pattern of the input value.
highbits [in]
Type: uint
The high 32-bit pattern of the input value.
Return value
Type: double
The input (two 32-bit values) recast as a double.
Remarks
The following overloaded version is also available:
double2 asdouble(uint2 lowbits, uint2 highbits);
If the input value is two 32-bit components, the return type will contain one double. If the input value is four 32-bit components, the return type will contain two doubles. If the input value is a 64-bit type, the returned value will have the same number of components as the input value.
Minimum Shader Model
This function is supported in the following shader models.
This function is supported in the following types of shaders:
See also
Intrinsic Functions
Shader Model 5
The text was updated successfully, but these errors were encountered: