Description
- Implement
unpack_s8s16
clang builtin,Linkunpack_s8s16
clang builtin withhlsl_intrinsics.h
Add sema checks forunpack_s8s16
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
Add codegen forunpack_s8s16
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
Add codegen tests toclang/test/CodeGenHLSL/builtins/unpack_s8s16.hlsl
Add sema tests toclang/test/SemaHLSL/BuiltIns/unpack_s8s16-errors.hlsl
Create theint_dx_unpack_s8s16
intrinsic inIntrinsicsDirectX.td
Create theDXILOpMapping
ofint_dx_unpack_s8s16
to219
inDXIL.td
Create theunpack_s8s16.ll
andunpack_s8s16_errors.ll
tests inllvm/test/CodeGen/DirectX/
Create theint_spv_unpack_s8s16
intrinsic inIntrinsicsSPIRV.td
In SPIRVInstructionSelector.cpp create theunpack_s8s16
lowering and map it toint_spv_unpack_s8s16
inSPIRVInstructionSelector::selectIntrinsic
.Create SPIR-V backend test case inllvm/test/CodeGen/SPIRV/hlsl-intrinsics/unpack_s8s16.ll
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
219 | Unpack4x8 | 6.6 | () |
SPIR-V
OpSConvert:
Description:
Convert signed width. This is either a truncate or a sign extend.
Result Type must be a scalar or vector of integer
type.
Signed Value must be a scalar or vector of integer type.
It must have the same number of components as Result Type. The
component width must not equal the component width in Result Type.
Results are computed per component.
Word Count | Opcode | Results | Operands | |
---|---|---|---|---|
4 |
114 |
<id> |
<id> |
Test Case(s)
Example 1
//dxc unpack_s8s16_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export int16_t4 fn(int8_t4_packed p1) {
return unpack_s8s16(p1);
}
HLSL:
Syntax
int16_t<4> unpack_s8s16(p32i8 pk);
Type Description
Name | Template Type | Component Type | Size |
---|---|---|---|
ret | vector | int16_t | 4 |
pk | scalar | int8_t4_packed | 1 |
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 6.6 and higher shader models | yes |
Shader Stages
See also
Metadata
Metadata
Assignees
Type
Projects
Status
Ready
Milestone
Relationships
Development
No branches or pull requests
Activity