Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Can SSE code conversion be automated

magicfoot
Beginner
435 Views
I am using intrinsic SSE functions to accelerate a calculation based on arrays of floating point numbers and it took me some time to get this working well. In a discussion today it was suggested that there are tools that can provide automatic conversion of scalar code to use SSE i.e Vector processing of the 4 floats at a time.

I would have not thought this possible! Are there tools or compiler functionality that do this SSE code conversion automatically? I'll be thrown if there are.
0 Kudos
4 Replies
TimP
Honored Contributor III
435 Views
That's what auto-vectorizing compilers do. Most current compilers, including Intel, PGI, gnu, Oracle, .....
As far as tools for auto-vectorizing existing compiled code, that's a research topic.
0 Kudos
magicfoot
Beginner
435 Views

The VC++ 2008 compiler has an option to enhance code to use SSE automatically yet this will only give me at most 10% speedup. Is this an acceptable speedup for the automated vectorization? It seems a bit dull to me.The manual method using intrinsics gives me over a 3 times speedup for those same sections of code.

Has anyone else had better experience with automated vectorizationusing theIntel or gcc compilers ? Could anyone post some numbers of automation performance improvements with for example an array of single floats.

0 Kudos
TimP
Honored Contributor III
435 Views
There's an unfortunately wide range of directives to use for improved auto-vectorization of C++ code using Intel C++ (ICL). Lately, g++ is quite effective, possibly doing better than ICL in the absence of directives. As you say, MSVC++ can't be expected to give you much without SSE intrinsics, as it doesn't perform auto-vectorization.
Somewhat surprising to me, effectiveness of auto-vectorization vs. intrinsics is still a very hot topic.
0 Kudos
Hannes_Hofmann
Beginner
435 Views
If your SSE intrinsics code is simple enough it might be possible to convert it using Find/Replace only. Don't forget to double the loop increments!
0 Kudos
Reply