Open llvm-beanz opened 10 months ago
asfloat
clang/test/CodeGenHLSL/builtins/asfloat.hlsl
clang/test/SemaHLSL/BuiltIns/asfloat-errors.hlsl
There were no DXIL opcodes found for asfloat.
//dxc asfloat_test.hlsl -T lib_6_8 -enable-16bit-types -spirv -fspv-target-env=universal1.5 -fcgl -O0 export float4 fn(float p1) { return asfloat(p1); }
//dxc asfloat_1_test.hlsl -T lib_6_8 -enable-16bit-types -O0 export float4 fn(uint p1) { return asfloat(p1); }
//dxc asfloat_2_test.hlsl -T lib_6_8 -enable-16bit-types -O0 export float4 fn(int p1) { return asfloat(p1); }
Interprets the bit pattern of x as a floating-point number.
The input interpreted as a floating-point number.
This function is supported in the following shader models.
Older compilers incorrectly allowed asfloat(bool), but note that bool inputs are not supported.
asfloat(bool)
@damyanp This one is already refined, but we should prioritize getting it assigned out. This is used in DirectML shader PixelPacking_Velocity.hlsli:28 and PixelPacking_Velocity.hlsli:41
I can work on this
asfloat
clang builtin (__builtin_bit_cast) with `hlsl_intrinsics.h``clang/test/CodeGenHLSL/builtins/asfloat.hlsl
clang/test/SemaHLSL/BuiltIns/asfloat-errors.hlsl
DirectX
There were no DXIL opcodes found for
asfloat
.SPIR-V
Description:
Test Case(s)
Example 1
Example 2
Example 3
HLSL:
Interprets the bit pattern of x as a floating-point number.
Parameters
Return Value
The input interpreted as a floating-point number.
Type Description
Function Overloads
`float<x> asfloat(float<x> value);` `float<x> asfloat(int<x> value);` `float<x> asfloat(uint<x> value);`
Minimum Shader Model
This function is supported in the following shader models.
Remarks
Older compilers incorrectly allowed
asfloat(bool)
, but note that bool inputs are not supported.See also