Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Cross-platform compatibility question

postaquestion
Beginner
242 Views

I am working on a project acrossing platform (EM64T Linux and EM64T Windows).

I find that the icc(EM64T Linux)'s function calling convention confirms to gcc. But it is different with the icl on EM64T Windows. e.g, on Linux, rdi,rsi,rdx,rcx,r8,r9 are used to pass parameters; on Windows,rcx,rdx,r8,r9 are used to pass parameters. And icl (windows) justs support fastcall convention(from MSDN:http://msdn2.microsoft.com/en-us/library/ms235286(VS.80).aspx).

Do you have any solution to support portability across platforms? I don't want to rotate parameters when a function built on Linux calling another one built on Windows.

thanks!

0 Kudos
1 Reply
TimP
Honored Contributor III
242 Views
Any code which relies on specific registers for function parameters is unavoidably non-portable. Among the solutions are C, C++, Fortran, ....
0 Kudos
Reply