Intrinsics Vs inline ASM for encoding SSE in VC ++ 2K8

I did some inline ASM encoding for SSE before, and it wasn't too complicated even for those who don't know ASM. But I note that MS also provides internal integration of many of these special instructions.

Is there a specific difference in performance, or is there any other strong reason why you should use it above others?

To repeat from the title, this is especially true for the internal functions open by VC ++ 2008 for unmanaged, native C ++.

+4
source share
4 answers

In general, it is better to use the built-in functions - it is more productive for the programmer, and a good compiler (for example, Intel ICC) will do a decent job of register allocation, schedule of commands, etc. The Microsoft compiler is not so good in this regard, but it probably still does a reasonable job - you can always switch to ICC later if you need to improve performance.

+3
source

In Visual C ++ for x64 there is no built-in assembly. Intrinsics can also be used on x64. If you ever want to port your code to x64, you have to use the built-in functions.

+4
source

The internal systems are identical to their equivalent assembly instructions, and you should use them if possible - the compiler knows that they can be translated directly, there is no difference in performance.

+1
source

Use the built-in features.

Using builds usually leads to several days of continuous operation, just to find out that the compiler is 5% ahead of your best performance. (5%, if you are really good, most likely 30%.)

0
source

Source: https://habr.com/ru/post/1305780/


All Articles