Skip to main content

VC++ Style Inline Assembly under Linux?

Submitted by dom on

I have several projects written under Visual C++ that have in-line assembly optimisations. The project compiles under Linux via gcc, but these optimisations are not used, hence only the genric C++ version of the code is complied. I was wondering if there are Linux compilers that support Visual Studio style in-line assembly syntax? I know that Intel C/C++ Compiler (Linux version) supports it, but I need a free compiler. Thanks in advance!

Submitted by Daemin on Tue, 30/12/03 - 8:48 AMPermalink

You could always write the optimised functions totally in assembly language, then compile them into obj files and link them with your project.

Submitted by dom on Tue, 30/12/03 - 11:45 AMPermalink

True, but there is a LOT of code. It's too much hassle to port the inline assembly to .ASM files.

Submitted by dom on Wed, 31/12/03 - 12:01 AMPermalink

Thanks Tachyon. I'm familiar that GCC inline ASM. The only problem is that it doesn't use the Intel syntax (like VC++ does), and you have to put each ASM line in quotes. Again this is not practical, because I have a lot of ASM code.

Submitted by Blitz on Wed, 31/12/03 - 9:01 AMPermalink

If you look around there may be some simple scripts/programs that can convert your code between the two different conventions, or write one yourself?
CYer, Blitz

Submitted by Maitrek on Thu, 01/01/04 - 12:05 AMPermalink

I'd say go with Blitz' suggestion. There are definitely tools out there to help you convert between the two, I used to have one but I forgot it (and I eventually just wrote my assembly code either way).

Note : This is why writing alot of assembly code is bad...

Submitted by dom on Thu, 01/01/04 - 12:41 AMPermalink

I thought about using conversion scripts/tools, but meh .. again it's too much hassle. Some tools don't even support the full MASM/VC++ syntax. I want to keep ASM maintenance at minimum.

Btw, most of the ASM code are MMX/SSE optimisitions for image processing, which gives a huge performace boost over the generic C++ code.

Oh well, looks like I have to stick with the Intel C/C++ Compiler...

Posted by dom on

I have several projects written under Visual C++ that have in-line assembly optimisations. The project compiles under Linux via gcc, but these optimisations are not used, hence only the genric C++ version of the code is complied. I was wondering if there are Linux compilers that support Visual Studio style in-line assembly syntax? I know that Intel C/C++ Compiler (Linux version) supports it, but I need a free compiler. Thanks in advance!


Submitted by Daemin on Tue, 30/12/03 - 8:48 AMPermalink

You could always write the optimised functions totally in assembly language, then compile them into obj files and link them with your project.

Submitted by dom on Tue, 30/12/03 - 11:45 AMPermalink

True, but there is a LOT of code. It's too much hassle to port the inline assembly to .ASM files.

Submitted by dom on Wed, 31/12/03 - 12:01 AMPermalink

Thanks Tachyon. I'm familiar that GCC inline ASM. The only problem is that it doesn't use the Intel syntax (like VC++ does), and you have to put each ASM line in quotes. Again this is not practical, because I have a lot of ASM code.

Submitted by Blitz on Wed, 31/12/03 - 9:01 AMPermalink

If you look around there may be some simple scripts/programs that can convert your code between the two different conventions, or write one yourself?
CYer, Blitz

Submitted by Maitrek on Thu, 01/01/04 - 12:05 AMPermalink

I'd say go with Blitz' suggestion. There are definitely tools out there to help you convert between the two, I used to have one but I forgot it (and I eventually just wrote my assembly code either way).

Note : This is why writing alot of assembly code is bad...

Submitted by dom on Thu, 01/01/04 - 12:41 AMPermalink

I thought about using conversion scripts/tools, but meh .. again it's too much hassle. Some tools don't even support the full MASM/VC++ syntax. I want to keep ASM maintenance at minimum.

Btw, most of the ASM code are MMX/SSE optimisitions for image processing, which gives a huge performace boost over the generic C++ code.

Oh well, looks like I have to stick with the Intel C/C++ Compiler...