aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorChris B <chris.bieneman@me.com>2024-02-15 14:58:06 -0600
committerGitHub <noreply@github.com>2024-02-15 14:58:06 -0600
commit5c57fd717d5d6a285efeb8402c6fe0c8f70592f3 (patch)
treecd4b71c05decd37f40090f06456570ad485e044e /clang/lib/CodeGen/CGExprAgg.cpp
parentedfc859af89e44207bf499b5d702aa26a7357da4 (diff)
downloadllvm-5c57fd717d5d6a285efeb8402c6fe0c8f70592f3.zip
llvm-5c57fd717d5d6a285efeb8402c6fe0c8f70592f3.tar.gz
llvm-5c57fd717d5d6a285efeb8402c6fe0c8f70592f3.tar.bz2
[HLSL] Vector standard conversions (#71098)
HLSL supports vector truncation and element conversions as part of standard conversion sequences. The vector truncation conversion is a C++ second conversion in the conversion sequence. If a vector truncation is in a conversion sequence an element conversion may occur after it before the standard C++ third conversion. Vector element conversions can be boolean conversions, floating point or integral conversions or promotions. [HLSL Draft Specification](https://microsoft.github.io/hlsl-specs/specs/hlsl.pdf) --------- Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 22f55fe..d0d6202 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -933,6 +933,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
case CK_BuiltinFnToFnPtr:
case CK_ZeroToOCLOpaqueType:
case CK_MatrixCast:
+ case CK_HLSLVectorTruncation:
case CK_IntToOCLSampler:
case CK_FloatingToFixedPoint:
@@ -1457,6 +1458,7 @@ static bool castPreservesZero(const CastExpr *CE) {
case CK_MatrixCast:
case CK_NonAtomicToAtomic:
case CK_AtomicToNonAtomic:
+ case CK_HLSLVectorTruncation:
return true;
case CK_BaseToDerivedMemberPointer: