Closed
Description
- Implement the
and
api inhlsl_intrinsics.h
- [ ] Investigate to see if we can use__builtin_reduce_and
- If a clang builtin is needed add sema checks for
and
toCheckHLSLBuiltinFunctionCall
inSemaHLSL.cpp
- If codegen is needed, add codegen for
and
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
- Add codegen tests to
clang/test/CodeGenHLSL/builtins/and.hlsl
- Add sema tests to
clang/test/SemaHLSL/BuiltIns/and-errors.hlsl
DirectX
There were no DXIL opcodes found for and
.
SPIR-V
There were no SPIR-V opcodes found for and
.
Test Case(s)
Example 1
//dxc and_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export bool4 fn(bool4 p1, bool4 p2) {
return and(p1, p2);
}
HLSL:
Logically and
s a vector and produces a bool vector output
Syntax
bool<> and(bool<> x, bool<> y);
Type Description
Name | Template Type | Component Type | Size |
---|---|---|---|
ret | scalar, vector, or matrix | bool | any |
x | scalar, vector, or matrix | bool | any |
y | scalar, vector, or matrix | bool | any |
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
All Shader Models with HLSL 2021 Language Mode | yes |
Shader Stages
All Shader Stages
Remarks
In HLSL 2021 and(X, Y);
is a replacement for
int3 X = {1, 1, 1};
int3 Y = {0, 0, 0};
bool3 Cond = X && Y;
See also
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Closed