Closed
Description
- Implement
AddUint64
via use of the__builtin_addc
clang builtin inhlsl_intrinsics.h
- (optional) If custom sema needed add sema checks for
AddUint64
toCheckHLSLBuiltinFunctionCall
inSemaHLSL.cpp
- Try to use
llvm::Intrinsic::uadd_with_overflow
codegen forAddUint64
inCGBuiltin.cpp
- Add codegen tests to
clang/test/CodeGenHLSL/builtins/AddUint64.hlsl
- Add sema tests to
clang/test/SemaHLSL/BuiltIns/AddUint64-errors.hlsl
- Create the
DXILOpMapping
ofint_uadd_with_overflow
to44
inDXIL.td
- Create the
AddUint64.ll
andAddUint64_errors.ll
tests inllvm/test/CodeGen/DirectX/
- Legalize
int_uadd_with_overflow
for SPIRV.
DirectX
DXIL Opcode | DXIL OpName | Shader Model | Shader Stages |
---|---|---|---|
44 | UAddc | 6.0 | () |
SPIR-V
There is no support for AddUint64
when targeting SPIR-V.
Test Case(s)
Example 1
//dxc AddUint64_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export uint4 fn(uint4 p1, uint4 p2) {
return AddUint64(p1, p2);
}
HLSL:
Syntax
uint<2> AddUint64(uint<2> a, uint<2> b);
uint<4> AddUint64(uint<4> a, uint<4> b);
Type Description
Name | Template Type | Component Type | Size |
---|---|---|---|
ret | vector | uint | 2 |
a | vector | uint | 2 |
b | vector | uint | 2 |
Type Description
Name | Template Type | Component Type | Size |
---|---|---|---|
ret | vector | uint | 4 |
a | vector | uint | 4 |
b | vector | uint | 4 |
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 6 and higher shader models | yes |
Shader Stages
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Closed