You'll find the file avx.zip in the attachment of this post. It's a simple test program which tests if AVX is supported by CPU
and Operating System. We had a few discussions about that topic for example
here,
here,
or here.
The program makes 3 steps:
- Checks the AVX support by the CPU.
- Checks if the Extended State Management by the OS is enabled.
- Checks if the YMM state is enabled and the OS supports AVX during task switches.
The main program is written in C; gcc will compile it, but VC should do the job, too. The tests are written in assembly language and jWasm will assemble them, but ml should do the same job. For details, please check the readme.txt and the b_avx.bat.
That's the output under XP:
AVX check
---------
The CPU supports AVX.
The Operating System hasn't enabled XSETBV/XGETBV instructions.
Operating System doesn't support YMM state.
Please, press enter to end the application ...
There's no support for AVX. That isn't a surprise. The same is true for Windows 7 (32-bit) with SP1:
AVX check
---------
The CPU supports AVX.
The Operating System hasn't enabled XSETBV/XGETBV instructions.
Operating System doesn't support YMM state.
Please, press enter to end the application ...
The 64-bit version of Windows 7 with SP1 has the full AVX support:
AVX check
---------
The CPU supports AVX.
The Operating System has enabled XSETBV/XGETBV instructions.
Operating System supports YMM state.
Please, press enter to end the application ...
The successor Windows 8 (64-bit) comes with full AVX support, too:
AVX check
---------
The CPU supports AVX.
The Operating System has enabled XSETBV/XGETBV instructions.
Operating System supports YMM state.
Please, press enter to end the application ...
It seems that Sinsi is right and the
32-bit Windows doesn't allow AVX. I've observed the same behaviour for Linux. The 64-bit version supports AVX, the 32-bit version doesn't support that instruction set. But I can test all the 32-bit versions only in virtual machines, not in native environments. So, some help from other forum members is necessary.
But if so, that has some consequences. We have already
AVX and AVX2. The new
AVX512 instruction set with 32 registers, which are 512 bit wide, is announced.
This means that 32-bit software can't use this new instruction sets and will not benefit from them. To ensure the future of assembly language programming under Windows we should discuss a kind of a MASM64 package.
Anyway, some test results under native installations are very welcome. Thank you.
Gunther