-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
HLSLHLSL Language SupportHLSL Language Supportbot:HLSLclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Description
- Implement
dot2addclang builtin, - Link
dot2addclang builtin withhlsl_intrinsics.h - Add sema checks for
dot2addtoCheckHLSLBuiltinFunctionCallinSemaChecking.cpp - Add codegen for
dot2addtoEmitHLSLBuiltinExprinCGBuiltin.cpp - Add codegen tests to
clang/test/CodeGenHLSL/builtins/dot2add.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/dot2add-errors.hlsl - Create the
int_dx_dot2addintrinsic inIntrinsicsDirectX.td - Create the
DXILOpMappingofint_dx_dot2addto162inDXIL.td - Create the
dot2add.llanddot2add_errors.lltests inllvm/test/CodeGen/DirectX/ - Create the
int_spv_dot2addintrinsic inIntrinsicsSPIRV.td - In SPIRVInstructionSelector.cpp create the
dot2addlowering and map it toint_spv_dot2addinSPIRVInstructionSelector::selectIntrinsic. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/dot2add.ll
DirectX
| DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
|---|---|---|---|
| 162 | Dot2AddHalf | 6.4 | () |
SPIR-V
OpDot:
Description:
Dot product of Vector 1 and Vector 2.
Result Type must be a floating-point type scalar.
Vector 1 and Vector 2 must be vectors of the same type, and their
component type must be Result Type.
| Word Count | Opcode | Results | Operands | ||
|---|---|---|---|---|---|
5 |
148 |
<id> |
<id> |
<id> |
Test Case(s)
Example 1
//dxc dot2add_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export float fn(half2 p1, half2 p2, float p3) {
return dot2add(p1, p2, p3);
}HLSL:
Syntax
float dot2add(float16_t<2> a, float16_t<2> b, float c);Type Description
| Name | Template Type | Component Type | Size |
|---|---|---|---|
| ret | scalar | float | 1 |
| a | vector | half | 2 |
| b | vector | half | 2 |
| c | scalar | float | 1 |
Minimum Shader Model
This function is supported in the following shader models.
| Shader Model | Supported |
|---|---|
| Shader Model 6.4 and higher shader models | yes |
Shader Stages
See also
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language Supportbot:HLSLclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Type
Projects
Status
Closed