-
Couldn't load subscription status.
- Fork 15k
Description
- Implement
f16tof32clang builtin, - Link
f16tof32clang builtin withhlsl_intrinsics.h - Add sema checks for
f16tof32toCheckHLSLBuiltinFunctionCallinSemaChecking.cpp - Add codegen for
f16tof32toEmitHLSLBuiltinExprinCGBuiltin.cpp - Add codegen tests to
clang/test/CodeGenHLSL/builtins/f16tof32.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/f16tof32-errors.hlsl - Create the
int_dx_f16tof32intrinsic inIntrinsicsDirectX.td - Create the
DXILOpMappingofint_dx_f16tof32to131inDXIL.td - Create the
f16tof32.llandf16tof32_errors.lltests inllvm/test/CodeGen/DirectX/ - Create the
int_spv_f16tof32intrinsic inIntrinsicsSPIRV.td - In SPIRVInstructionSelector.cpp create the
f16tof32lowering and map it toint_spv_f16tof32inSPIRVInstructionSelector::selectIntrinsic. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/f16tof32.ll
DirectX
| DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
|---|---|---|---|
| 131 | LegacyF16ToF32 | 6.0 | () |
SPIR-V
UnpackHalf2x16:
Description:
UnpackHalf2x16
Result is the two-component floating-point vector with components
obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit
values, interpreting those values as 16-bit floating-point numbers
according to the OpenGL Specification, and converting them to 32-bit
floating-point values. Subnormal numbers are either preserved or flushed
to zero, consistently within an implemenation.
The first component of the vector is obtained from the 16
least-significant bits of v; the second component is obtained from the
16 most-significant bits of v.
The v operand must be a scalar with 32-bit integer type.
Result Type must be a vector of 2 components whose type is 32-bit
floating point.
| Number | Operand 1 | Operand 2 | Operand 3 | Operand 4 |
|---|---|---|---|---|
62 |
<id> |
Test Case(s)
Example 1
//dxc f16tof32_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export float4 fn(uint4 p1) {
return f16tof32(p1);
}HLSL:
Converts the float16 stored in the low-half of the uint to a float.
Syntax
float f16tof32(
in uint value
);Parameters
-
value [in]
-
Type: uint
The input value.
Return value
Type: float
The converted value.
Remarks
The following overloaded versions are also available:
float2 f16tof32(uint2 value);
float3 f16tof32(uint3 value);
float4 f16tof32(uint4 value);Minimum Shader Model
This function is supported in the following shader models.
| Shader Model | Supported |
|---|---|
| Shader Model 4 and higher shader models | yes |
Although this function is available in Shader Model 4 and higher shader models, because it is emulated in 4.0 and 4.1, it is less perfomant on these shader models than it is on Shader Model 5.
This function is supported in the following types of shaders:
| Vertex | Hull | Domain | Geometry | Pixel | Compute |
|---|---|---|---|---|---|
| x | x | x | x | x | x |
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
Status