How to use llvm intrinsic functions on packed simd vectors?

I would like to optimize my simulation by using mathematical operations that take simd vectors as arguments and apply simd intrinsics to them. For example, I would like to have a fn sin(v: __m256d) -> __m256d.

I found that rust actually has codegen tests for such functions that come with llvm, here:

I am not sure if this is 100% what I need, but I figure those #[repr(simd)] applied to the various tuple structs would yield __m256 and __m256d and their likes.

So how do I use this? Is anything of this exposed yet? Or all highly experimental? I am fine with using nightly.

You can use __mm256_sin_pd.

I think you gave me the wrong link. :slight_smile: That’s __m256_min_pd.

Also, there are no intrinsics for proper trigonometric functions. There is only Intel’s SVML, which provides functions that look like intrinsics, but are not.

Oh weird! I guess __mm256_min_pd is close enough to mm256_sin_pd that it pops up when you search that…