SSE4 instructions in VS2005?

I need to use the popcnt command in a project that is compiled using Visual Stdio 2005
Internal __popcnt() only works with VS2008, and the compiler does not seem to recognize the instruction, even when I write in the __asm {} block.

Is there any way to do this?

+3
source share
2 answers

Ok, this is a wild thing, but ... if you configured VS2005 as this to make an assembler language, then you can get Intel's SSE4.1 manual and encode a macro for each SSE4.1 opcode you need according to this thread on masm32.com (which addresses a similar issue on SSE2.)

For example, here is some code from one of the downloads from the masm32 link:

 ;SSE2 macros for MASM 6.14 by daydreamer aka Magnus Svensson ADDPD MACRO M1,M2 db 066h ADDPS M1,M2 ENDM ADDSD MACRO M1,M2 DB 0F2H ADDPS M1,M2 ENDM 
+3
source

As a quick note, you can use __emit to send bytes to __asm ​​blocks in VC ++. This is easier in many cases than connecting to the objects created by masm. I used this in the past when SSE3 was new (and operation codes were not supported in VS 2003).

All opcodes are well documented by Intel .

+2
source

All Articles