英特尔 AVX 内在函数:有兼容库吗?
有 Intel AVX 内在函数库吗?我正在寻找类似于“sse2mmx.h”标头的内容,如果 SSE2 整数内在函数在编译时不可用,则该标头会回退到 MMX 内在函数。因此,如果我有类似的 AVX 库,我可以为新硬件编写优化的代码,在 AVX 扩展不可用的情况下,该代码将具有几乎最佳的速度。谷歌搜索到目前为止没有多大帮助:(
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 :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Intel 提供了 AVX 仿真标头。我还没有尝试过,但引用链接的文章“AVX 模拟头文件使用之前的 Intel 指令集扩展的内在函数,最高可达 Intel SSE4.2。开发环境和硬件中需要 SSE4.2 支持,以便要使用 AVX 仿真头文件,只需包含此文件:
#include "avxintrin_emu.h"
而不是通常的#include
" -听起来这就是你要找的。英特尔还有一个模拟器,名为 SDE,它可能有用。我还没有使用它来测试 AVX 代码,但它在我的机器上运行良好,可以在较旧的 CPU 上使用 AES-NI 指令集测试代码,而且我知道它也支持 AVX 模拟。 SDE 对于检查 CPUID 处理代码特别有用。
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.