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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to