views:

138

answers:

1

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 :(

+2  A: 

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.

Jack Lloyd