Hi,

according to the doc () floor, sin, cos should be vectorized.

I can confirm (using the great tool) that using the flags “-Ofast -mavx2 -fopenmp -ffast-math” the right avx2 opcode () is emited for floor (in foo), but unfortunately not for sin, cos or exp (e.g. see sin in bar below).

GCC 8.1+ and the Intel Compiler icc 13+ insert call to vectorized implementations (_ZGVbN4v_sinf or __svml_sinf4 ), but clang seems to have nothing like this.

Here is my small testcode:

#include

void foo(float * __restrict __attribute((aligned(32))) x

, float * __restrict __attribute((aligned(32))) y) {

for (int i = 0; i < 4; ++i)

y[i] = floor(x[i]);

}

void bar(float * __restrict __attribute((aligned(32))) x

, float * __restrict __attribute((aligned(32))) y) {

for (int i = 0; i < 4; ++i)

y[i] = sin(x[i]);

}

I have reproduced this behavior on different machines. Maybe I am doing s.th. wrong here, but it seems like there is no vectorized implementation for sin, cos etc. I am using h2lib for now () as a workaround, but I expect clang to do this job.

Can anybody comment on this please?

Cheers

Klaus