News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Using SSE3 in MS Visual C++

Started by David Spilling, May 09, 2006, 12:56:09 PM

Previous topic - Next topic

David Spilling

Dear All,

Apologies if this is a stupid question, or if it's in the wrong forum, but is there any way to get the Microsoft Visual C++ 2003 IDE (which I understand calls MASM for inline assembler anyway) to recognise SSE3 instructions?

I have seen a file on the Intel website that contains macros for the SSE3 set, but have no idea how to use it from the above IDE.

Thanks for any help,

David

RedXVII

eek. You sounds like you have not done much in the way of assembly language before. I hope you know atleast a bit before you go jumping into SSE3, or you might be in for a rough time. Look up something like assembly language format in the help files to show you how to insert opcodes into your code.

I am unfamilier with C++ having completely swithced to assembly only. But someone will know.

David Spilling

You are right in saying that I haven't done much assembler before ! Hence my initial forays into assembler have all been iinline, from the relative safety of a C++ compiler.

In this case I am parallelising a small section of performance critical code (about 90% of my apps time is spent here). Despite the above, I have it all working fine with SSE/SSE2 instructions, but using HADDPS would save me some time.

MS Vis C++ 2005, I believe, supports intrinsics for SSE3; however version 2003 - the one I have - doesn't, and so I have to resort to assembler.

http://www.intel.com/cd/ids/developer/asmo-na/eng/167741.htm?page=9 provides macros/opcodes for SSE3, but I'm having some difficulty persuading the MS VC++ IDE to use this.

David






hutch--

David,

As far as I know the Intel macros are for MASM, not VC so you may be in trouble there. The option is to use the version of ML.EXE that comes with VC2003 and use the Intel macros in MASM.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

David Spilling

Ah. OK - I _am_ being stupid. VC doesn't call MASM for _inline_ assembler. I should package and export the core routine to a separate .asm file (which MASM can get at) and then the Intel code can be included in the exported stuff.

So not only is this posted in the wrong forum, but in the wrong website !

Thanks for the responses.

David

hutch--

David,

There is no problems posting here as plenty of people here have excellent expertise writing modules in masm for VC. Its one of the target usages for masm. Now one thing to be aware about when you write the MASM module(s), if you just try and target the highly speed critical code only so that the complete algorithm has to repeatedly call across two or more modules, you may take a speed penalty due to potential register usage differences between the VC optimised code as well as stack overhead.

The idea is to produce the complete algorithm so that you have full control of all of these factors and have the best opportunity to maximise its speed.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php