Open p0nce opened 1 year ago
AVX super annoying to do since efficiently doing the instructions without 256-bit vectors is involved
Even when AVX is disabled, if all intrinsics are implement with proper splitting when needed, you can speed up with AVX "intrinsics". Of course, doesn't work everytime but often enough to speed things up in general.
Let's measure time to make 81920000 atan2 operations.
With -mattr=+avx2 (AVX enabled)
- Naive (std.complex.arg): 1581.3 ms
- Written with AVX intrinsics: 61.5 ms
- Written with SSE intrinsics: 103.6 ms
Without -mattr=+avx2 (AVX disabled)
- Naive (std.complex.arg): 1499.6 ms
- Written with AVX intrinsics: 102.9 ms
- Written with SSE intrinsics: 119.9 ms
(EDIT: though, it's not systematic either, if SSE intrinsics don't win over D code often the AVX semantics also don't win)
179 TODO159 TODO142 TODO132 TODO112 TODO100 TODO87 TODO76 TODO62 TODO49 TODO