VINAY PALAKKODE
VINAY PALAKKODE

Reputation: 3

Does the bitwise operation (&, ^. | etc) provided as operator overloads in the std::bitset use AVX or SSE4 instructions?

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

Upvotes: 0

Views: 167

Answers (2)

Elalfer
Elalfer

Reputation: 5338

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.

Upvotes: 2

πάντα ῥεῖ
πάντα ῥεῖ

Reputation: 1

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.

Upvotes: 0

Related Questions