Intel AVX intrinsics: any compatibility library out?

对着背影说爱祢 提交于 2019-12-01 02:22:01

问题


Are there any Intel AVX intrinsics library out? I'm looking for something similar as 'sse2mmx.h' header which fall-backs to MMX intrinsics if SSE2 integer intrinsics are not available on compile time. Thus if I had similar library for AVX I could write optimized code for new hardware which would have almost optimal speed in case AVX extension isn't available. Googling didn't help much so far :(


回答1:


Intel provides a AVX emulation header. I haven't tried it, but quoting the linked article "The AVX emulation header file uses intrinsics for the prior Intel instruction set extensions up to Intel SSE4.2. SSE4.2 support in your development environment as well as hardware is required in order to use the AVX emulation header file. To use simply have this file included: #include "avxintrin_emu.h" nstead of usual #include <immintrin.h>" - sounds like this is what you're looking for.

Intel also has an emulator, called SDE, which might be useful. I haven't used it for testing AVX code yet, but it worked fine on my machine for testing code using the AES-NI instruction sets on an older CPU, and I know it supports AVX emulation as well. SDE is especially useful for checking your CPUID handling code.



来源:https://stackoverflow.com/questions/2708501/intel-avx-intrinsics-any-compatibility-library-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!