[PATCH] D40112: [CodeGen][X86] Fix handling of __fp16 vectors

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 12:08:32 PST 2017


ahatanak added inline comments.


================
Comment at: lib/CodeGen/CGExprScalar.cpp:954
     if (DstTy->isFloatingPointTy()) {
-      if (!CGF.getContext().getLangOpts().HalfArgsAndReturns)
+      if (CGF.getContext().getTargetInfo().useFP16ConversionIntrinsics())
         return Builder.CreateCall(
----------------
bruno wrote:
> This (and in the other places in the patch) means that regardless of `HalfArgsAndReturns` state we want to generate an intrinsic call if `useFP16ConversionIntrinsics()` is true, is that always the intended behavior?  
Yes, that is the intended behavior.

HalfArgsAndReturns is used here to determine whether intrinsic calls should be emitted, but it seems to me that it should only be used to indicate whether returning or passing half types is allowed. Currently ARM and ARM64 are the only targets that are allowed to return or pass half types, but I think it's possible to allow other targets to do so too if that's desirable.


https://reviews.llvm.org/D40112





More information about the cfe-commits mailing list