-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implement the or
HLSL Function
#125605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I will begin working on this. |
completed by #128979 |
@llvm/issue-subscribers-clang-frontend Author: Farzon Lotfi (farzonl)
- [ ] Implement the `or` api in `hlsl_intrinsics.h`
~~- [ ] Investigate to see if we can use `__builtin_reduce_or`.~~
- [ ] If a clang builtin is needed add sema checks for `or` to `CheckHLSLBuiltinFunctionCall` in `SemaHLSL.cpp`
- [ ] If codegen is needed, add codegen for `or` to `EmitHLSLBuiltinExpr` in `CGBuiltin.cpp`
- [ ] Add codegen tests to `clang/test/CodeGenHLSL/builtins/or.hlsl`
- [ ] Add sema tests to `clang/test/SemaHLSL/BuiltIns/or-errors.hlsl`
DirectXThere were no DXIL opcodes found for SPIR-VThere were no SPIR-V opcodes found for Test Case(s)Example 1//dxc or_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export bool4 fn(bool4 p1, bool4 p2) {
return or(p1, p2);
} HLSL:Logically Syntaxbool<> or(bool<> x, bool<> y); Type Description
Minimum Shader ModelThis function is supported in the following shader models.
Shader StagesAll Shader Stages RemarksIn HLSL 2021 int3 X = {1, 1, 1};
int3 Y = {0, 0, 0};
bool3 Cond = X || Y; See also |
@llvm/issue-subscribers-clang-codegen Author: Farzon Lotfi (farzonl)
- [ ] Implement the `or` api in `hlsl_intrinsics.h`
~~- [ ] Investigate to see if we can use `__builtin_reduce_or`.~~
- [ ] If a clang builtin is needed add sema checks for `or` to `CheckHLSLBuiltinFunctionCall` in `SemaHLSL.cpp`
- [ ] If codegen is needed, add codegen for `or` to `EmitHLSLBuiltinExpr` in `CGBuiltin.cpp`
- [ ] Add codegen tests to `clang/test/CodeGenHLSL/builtins/or.hlsl`
- [ ] Add sema tests to `clang/test/SemaHLSL/BuiltIns/or-errors.hlsl`
DirectXThere were no DXIL opcodes found for SPIR-VThere were no SPIR-V opcodes found for Test Case(s)Example 1//dxc or_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export bool4 fn(bool4 p1, bool4 p2) {
return or(p1, p2);
} HLSL:Logically Syntaxbool<> or(bool<> x, bool<> y); Type Description
Minimum Shader ModelThis function is supported in the following shader models.
Shader StagesAll Shader Stages RemarksIn HLSL 2021 int3 X = {1, 1, 1};
int3 Y = {0, 0, 0};
bool3 Cond = X || Y; See also |
or
api inhlsl_intrinsics.h
- [ ] Investigate to see if we can use__builtin_reduce_or
.or
toCheckHLSLBuiltinFunctionCall
inSemaHLSL.cpp
or
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/or.hlsl
clang/test/SemaHLSL/BuiltIns/or-errors.hlsl
DirectX
There were no DXIL opcodes found for
or
.SPIR-V
There were no SPIR-V opcodes found for
or
.Test Case(s)
Example 1
HLSL:
Logically
or
s a vector and produces a bool vector outputSyntax
bool<> or(bool<> x, bool<> y);
Type Description
Minimum Shader Model
This function is supported in the following shader models.
Shader Stages
All Shader Stages
Remarks
In HLSL 2021
or(X, Y);
is a replacement forSee also
The text was updated successfully, but these errors were encountered: