[PATCH] D135011: Add builtin_elementwise_sin and builtin_elementwise_cos

Xiang Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 13:34:24 PDT 2022


python3kgae added a comment.

In D135011#3834739 <https://reviews.llvm.org/D135011#3834739>, @bob80905 wrote:

> Here is the code I used to test the machine code output:
>
>   typedef float float4 __attribute__((ext_vector_type(4)));
>   
>   void test_builtin_elementwise_sin(float f1, float f2, double d1, double d2, 
>   float4 vf1, float4 vf2)
>   {
>     f2 = __builtin_elementwise_sin(f1);
>     d2 = __builtin_elementwise_sin(d1);
>     vf2 = __builtin_elementwise_sin(vf1);
>   }
>
> f2 = __builtin_elementwise_sin(f1); can be swapped for f2 = __builtin_elementwise_cos(f1); to test the cos builtin,

Not sure these will test scalable vector types.
Maybe something like vfloat32mf2_t or svfloat32_t?


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