This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]