What is meant by SSE intrinsics from c++ development point of view? All I could find is that they help things to run faster on a specific platform. But what does it actually means? Does it mean that in the code I will see some #ifdef code for each platform? Or does it mean something else? Another doubt is that if I am looking at a GitHub project then how can I check if it has used intrinsics for any of the supported platform? Where can I browse to see if this has been done for any platform in the GitHub project itself? Can I search for any specific text to make the search faster?
Asked
Active
Viewed 102 times
0
-
You can have explicit intrinsics (see other comments) so you can search for some of the common ones in a codebase to see if they are used. It could in some cases refer to "auto-vectorization" where the compiler deals with it. You won't necessarily see it (maybe with compiler flags, but not 100%) – ShadowMitia Dec 13 '21 at 13:08
-
Why do you care? That's not a rhetoric question. Many compilers will use SSE themselves, even if you don't use SSE intrinsics. Every x64 processor supports SSE. – MSalters Dec 13 '21 at 13:12
-
@MSalters - As I asked in my question many GitHub projects have code to use intrinsics. So my question is why do they care? And if they do care, then how can I find out that they care and use intrinsics for which platform. – Dec 13 '21 at 14:18
-
@John: See the "What are intrinsics" question. Note that intrinsics are _not_ Standard C++. – MSalters Dec 13 '21 at 14:22
-
@MSalters - yes they are not standard c++ but seems many GitHub projects use them so I wanted to know when and how to use those. Also, i wanted to see any easy way to deduce that a GitHub projects uses these for which platforms . – Dec 13 '21 at 14:58
-
Usually it means `#include
` (or older header names) and use of `__m128` / `__m128i` types. Of course that's only for SSE specifically, not ARM NEON. SSE is only for one specific platform, x86. (And modern x86 also supports AVX for `__m256` vectors). – Peter Cordes Dec 13 '21 at 19:15 -
@PeterCordes - where can I get more details on these terms which you have used in your reply. That's exactly what I am after for eg. SSE, avx, neon etc. I want to understand what intrinsics are how they relate to the terms you used. – Test Dec 17 '21 at 03:25
-
1@Test: https://stackoverflow.com/tags/sse/info is a good start for x86 SSE/AVX, and intrinsics for getting C++ compilers to use specific instructions. For SIMD in general, wikipedia's article might be slightly useful if it's not too vague: https://en.wikipedia.org/wiki/SIMD. Or better, [Modern Microprocessors A 90-Minute Guide! ](https://www.lighterra.com/papers/modernmicroprocessors/) has a section on SIMD in CPUs, to understand what hardware feature you're trying to get compilers to use. – Peter Cordes Dec 17 '21 at 03:32