================
@@ -211,6 +211,58 @@ static Value *handleElementwiseF16ToF32(CodeGenFunction
&CGF,
llvm_unreachable("Intrinsic F16ToF32 not supported by target architecture");
}
+static Value *handleElementwiseF32ToF16(CodeGenFunction &CGF,
+ const CallExpr *E) {
+ Value *Op0 = CGF.EmitScalarExpr(E->getArg(0));
+ QualType Op0Ty = E->getArg(0)->getType();
+ llvm::Type *ResType = CGF.IntTy;
+ uint64_t NumElements = 0;
+ if (Op0->getType()->isVectorTy()) {
+ NumElements =
+ E->getArg(0)->getType()->castAs<clang::VectorType>()->getNumElements();
----------------
alsepkow wrote:
nit: Because NumElements is only used for SPIRV would it make more sense to
declare it and set it after the isDXIL block on 229?
I assume you just copied the logic from handleElementWiseF16ToF32, could also
change it there.
https://github.com/llvm/llvm-project/pull/172469
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits