[PATCH] D135011: Add sin and cos llvm builtins

Xiang Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 16:36:15 PDT 2022


python3kgae added a comment.

In D135011#3831949 <https://reviews.llvm.org/D135011#3831949>, @rjmccall wrote:

> The titled of this patch should be something like "Add __builtin_elementwise_sin and __builtin_elementwise_cos".
>
> Can you explain why this uses a new builtin name instead of overloading the existing builtins to work on vectors?  I can imagine reasons why, but I think it needs to be explained.  I can't imagine `cos` and `sin` not being element-wise operations on a vector.

It just adds additional builtins following the other vector-wise builtins.
As mentioned in https://lists.llvm.org/pipermail/cfe-dev/2021-September/068999.html, it is much easier to just use one builtin for all overloads instead of using different builtins for different overloads.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135011



More information about the cfe-commits mailing list