0

Since this is implementation dependent, is the only way to find that out is through the disassembly?

2 Answers2

2

You can alway look at STL sources to see if it uses SIMD, but I believe it is compiler specific and STL library doesn't directly utilize SIMD & AVX . It is up to the compiler to do vectorization if possible as a part of optimization.

So I'd rather look at the optimization report for a specific loop to see if compiler was able to vectorize it, and the reason if not.

Elalfer
  • 5,312
  • 20
  • 25
  • The STL sources will *never* use SIMD instructions explicitly because the only way to do that would be via intrinsics, which necessarily make you highly architecture-dependent. That would defeat the purpose of a standard library that can be used anywhere. If your compiler doesn't apply the optimizations you're expecting, you can look into a library specifically written with intrinsics to force the use of SIMD instructions. You'll need one for each target processor. – Cody Gray - on strike Jan 06 '17 at 15:53
0

Since this is implementation dependent, is the only way to find that out is through the disassembly?

Yes, there's no other way. Nor there are any guarantees what is actually used.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190