Questions on AVX backwards compatability (SSE)

Questions on AVX backwards compatability (SSE)

thaidog's picture

Will code that was formerly complied in a generic format for SSE run with out modification on AVX?

13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,

Yes and ensure that the target system you run that compiled application contains the SSE version you compiled the app with.

-Kittur

thaidog's picture

What if the linux verison does not have support for AVX in the kernel? Will the application still be able to see and use them?

Hi,

SIMD extensions and SSE thereof require support from the operating system (kernel of course) so the registers are handled properly by the OS. That said, as long as the OS supports the SSE you've compiled the application for it should run fine even if that kernel has no support for AVX. If you compile the application for avx, then you'll need to have a minimum kernel version to support avx instructions for that matter.

You can run "%cat /proc/cpuinfo" on your system and check the flags settings in the output. If it says avx then that system supports avx and likewise you can check for sse versions too.

Does that answer your question?

_Kittur

thaidog's picture

Thanks :) Yes that make sense - I geuss too much sense :) Thanks for your time!

Thanks :-)

iliyapolak's picture

On Windows OS handling (saving ) SSE and AVX floating point context is done by the kernel.

Good point Iliayapolak, yes whenever there's context switching from one process to another the simd registers will have to be saved while whatever was saved before for the new active process needs to be restored.....:-)

_Kittur

Quote:

iliyapolak wrote:

On Windows OS handling (saving ) SSE and AVX floating point context is done by the kernel.


That's the point on which running AVX on an OS which doesn't support it (XP or Win7 without SP) could prove unreliable or insecure even if it appears to work.

Tim, that's something a user using AVX or SSE should be aware of, thanks.

thaidog's picture

I think in older linux kernels the user to kernel context switch could not be handled by SSE. In other words the registers would loose / over write their data. I am not sure if this has been fixed.... I would be interested to know at what kernel revision it was.

You would go back more than 15 years to find a kernel without sse support.  Red hat and centos 5.x are still in use while lacking avx support.

iliyapolak's picture

Quote:

Tim Prince wrote:

Quote:

iliyapolak wrote:

On Windows OS handling (saving ) SSE and AVX floating point context is done by the kernel.

 

That's the point on which running AVX on an OS which doesn't support it (XP or Win7 without SP) could prove unreliable or insecure even if it appears to work.

Regarding Win 7 if I remember correctly KeSaveFloatingPointState() function was responsible for saving YMM register context,but I need to check it.

Login to leave a comment.