This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Converting MSVC to intel-style gcc inline assembly
- From: Matthew Tippett <matthew dot tippett at sympatico dot ca>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 06 Mar 2004 01:06:28 -0500
- Subject: Converting MSVC to intel-style gcc inline assembly
Hello,
I have a body of code that is needed to be ported over from Windows
to Linux. There is a reasonable amount of MSVC inline assembly that
needs to be ported as well.
Now, although i can handle coverting the body of code over, the
parameter passing is going to cause some problems. Since the gcc
supports intel style assembly, it simplifies it down to
__asm { --> __asm__ (
eax --> %%eax
And so on, (which can be scripted), is there any easy way of
automating the conversion from the inline variable use to the
parameter syntax %1, %2, %3 that gcc requires. With a little bit of
work, could probably port script a converter for compile time, but I
would also probably have something like
#ifdef LINUX
:
: "g" (input)
#endif
And also define
ASM_START and ASM_END as macros to simplify a lot of the work.
It seems to be a common issue that I was wondering if anyone has
written scripts to simplify porting.
Regards,
Matthew