Arm Neon Intrinsics vs hand assembly

后端 未结 4 990
小蘑菇
小蘑菇 2020-11-30 08:20

https://web.archive.org/web/20170227190422/http://hilbert-space.de/?p=22

On this site which is quite dated it shows that hand written asm would give a much greater i

4条回答
  •  暖寄归人
    2020-11-30 08:25

    I've had to use NEON intrinsics in several projects for portability. The truth is that GCC doesn't generate good code from NEON intrinsics. This is not a weakness of using intrinsics, but of the GCC tools. The ARM compiler from Microsoft produces great code from NEON intrinsics and there is no need to use assembly language in that case. Portability and practicality will dictate which you should use. If you can handle writing assembly language then write asm. For my personal projects I prefer to write time-critical code in ASM so that I don't have to worry about a buggy/inferior compiler messing up my code.

    Update: The Apple LLVM compiler falls in between GCC (worst) and Microsoft (best). It doesn't do great with instruction interleaving nor optimal register usage, but at least it generates reasonable code (unlike GCC in some situations).

    Update2: The Apple LLVM compiler for ARMv8 has been improved dramatically. It now does a great job generating ARMv8 code from C and intrinsics.

提交回复
热议问题