Can SSE code conversion be automated

Can SSE code conversion be automated

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.

5 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

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.

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.

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.

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!

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen