[PATCH] D140639: clang: Fix handling of __builtin_elementwise_copysign

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 5 07:55:46 PST 2023


arsenm added a comment.

In D140639#4028883 <https://reviews.llvm.org/D140639#4028883>, @erichkeane wrote:

> 1 nit, and 1 trying to see what is going on.  I don't have a good feeling what the purpose of this builtin is,

The point of every builtin is direct access to llvm intrinsics, in this case llvm.copysign. I need it on vectors and not the set of 3 scalars it handles now.



================
Comment at: clang/lib/Sema/SemaChecking.cpp:2660
+
+    ExprResult Magnitude = UsualUnaryConversions(TheCall->getArg(0));
+    ExprResult Sign = UsualUnaryConversions(TheCall->getArg(1));
----------------
erichkeane wrote:
> What is the point of the Unary Conversions here?  Its a touch surprising to see a builtin do that?  Note that it does quite a bit of FP related conversions, so are you sure you want those?
Copied from the other elementwise intrinsics, and this is at the edges of my frontend knowledge (I guess it's to avoid qualifiers mattering?). The tests seem to behave as I expect


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140639/new/

https://reviews.llvm.org/D140639



More information about the cfe-commits mailing list