================
@@ -2466,6 +2504,15 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
case CK_IntToOCLSampler:
return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF);
+ case CK_HLSLVectorTruncation: {
+ assert(DestTy->isVectorType() && "Expected dest type to be vector type");
+ Value *Vec = Visit(const_cast<Expr *>(E));
+ SmallVector<int, 16> Mask;
+ Mask.insert(Mask.begin(), DestTy->castAs<VectorType>()->getNumElements(),
+ 0);
+ return Builder.CreateShuffleVector(Vec, Mask, "trunc");
+ }
----------------
llvm-beanz wrote:
Doh!
https://github.com/llvm/llvm-project/pull/71098
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits