3 ms·
typically if it's available, compilers will use the avx512 register file. This means you'll see things like xmm25 and ymm25 (128 and 256 bit registers) and tho
by brrrrrm 4y ago
typically if it's available, compilers will use the avx512 register file. This means you'll see things like xmm25 and ymm25 (128 and 256 bit registers) and those are avx512 only. However, compilers using 512-wide instructions is kinda rare from what I've seen
- readonlybarbie 4y agoso then, if i want my code to "explicitly" use avx512, i have to do something like this? ``` void myNotOptimizedThing(my_data* d){ _SPECIAL_CPU_MANUFACTURER_0X3D512(d); } ``` edit: and include some header from the manufacturer most likely?
- brrrrrm 4y agowithout using intrinsics? `-O3 -march=skylake-avx512 -mprefer-vector-width=512`
- celrod 4y agoYou can use `-mprefer-vector-width=512` to use 512 bit vectors, or if you want a particular function to use 512, you could try the min-vector-width attribute: https://clang.llvm.org/docs/AttributeReference.html#min-vector-width https://clang.llvm.org/docs/AttributeReference.html#min-vect... In my experience, clang unrolls too much, so you end up spending all your time in the non-vectorized remainder. Using smaller vectors cuts the size of the non-vectorized remainders in half, so smaller vectors often give better performance for that reason. (Unrolling less could have the same effect while decreasing code size, but alas)