[clang] [HLSL] Add matrix support to atan2 (PR #194984)
Farzon Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 29 19:12:53 PDT 2026
================
@@ -3232,14 +3232,16 @@ static bool CheckFloatRepresentation(Sema *S, SourceLocation Loc,
static bool CheckFloatOrHalfRepresentation(Sema *S, SourceLocation Loc,
int ArgOrdinal,
clang::QualType PassedType) {
- clang::QualType BaseType =
- PassedType->isVectorType()
- ? PassedType->castAs<clang::VectorType>()->getElementType()
- : PassedType;
+ clang::QualType BaseType = PassedType;
+ if (PassedType->isVectorType())
+ BaseType = PassedType->castAs<clang::VectorType>()->getElementType();
+ else if (PassedType->isMatrixType())
+ BaseType = PassedType->castAs<clang::MatrixType>()->getElementType();
+
if (!BaseType->isHalfType() && !BaseType->isFloat32Type())
return S->Diag(Loc, diag::err_builtin_invalid_arg_type)
- << ArgOrdinal << /* scalar or vector of */ 5 << /* no int */ 0
- << /* half or float */ 2 << PassedType;
+ << ArgOrdinal << /* scalar, vector or matrix of */ 5
+ << /* no int */ 0 << /* half or float */ 2 << PassedType;
----------------
farzonl wrote:
You made a sema change but I don't see any sema tests.
https://github.com/llvm/llvm-project/pull/194984
More information about the cfe-commits
mailing list