Skip to content

Hint SIMD usage for primitive functions with a V

Thomas Koopman requested to merge thomas/sac2c:simd-support into develop

What is this?

We hint the C-compiler that it should try harder to generate SIMD instructions for primitive functions that take vectors, e.g., _add_VxV_.

Why?

Because C-compilers suck at SIMD without an #pragma omp simd. I have encountered this in my FFT codes, and Xoshiro experiments. Especially the latter is problematic because it inhibits vectorization of the functions that use the result as well. These can be expensive math functions.

Why not put this everywhere?

These primitive functions are not used often. For with-loops we can have more complicated nestings, fold's, etc. So it is more likely the pragma gives bad advice there.

Merge request reports