I've used SSE2 (Streaming SIMD Extensions) instructions for performance
critical loops in inline assembly blocks directly in my VC++ code.
I'm not an experinced SSE2 programmer, but I'll share my knoledge anyway.
There are other ways to get use of SSE2, see below.
If you want to use SSE2 instructions directly, Intels 'IA-32 Architecture
Software Developer's Manual' tells you about everything you need to know
when it comes to MMX/SSE/SSE2. You can get it
ftp://download.intel.com/design/Pent...s/24547012.pdf . -down to
very low-level though. No code examples either. -Takes a lot of coffee.
SSE2 is an extension to SSE and MMX. They all use the SIMD - 'single
instruction multiple data' -model. That means that with a single instruction
you can perform an operation on up to four 32-bit numbers - simultaniously.
Therefore using SIMD increases the speed significantly. You can use SIMD
instructions in cases where you need to perform the same operation on a
large amount of similar data, like video or 3D applications.
MMX: Instruction set that operates on 64 bit registers, for example
containing two 32 bit integers -simultaneously. Unfortunately MMX only
includes instructions that operates on integers.
The eight MMX registers are called MM0 - MM7 (An easy way to identify the
use of MMX in assembly code).
SSE: extends MMX so that you can also do floating point operations on 128
bit registers. With SSE you can operate on four 32 bit floating point
numbers, or two 64 bit double precision floating point numbers -
simultaneously. Came with the Intel P3 processors.
The eight SSE registers are called XMM0 - XMM7.
SSE2: Yet another extension. Includes all SSE operations but adds integer
operations. Now you can work with four 32 bit integers. Introduced with the
P4 processors.
SSE2 uses the same registers as SSE.
SSE2/SSE are processor specific. SSE instructions work only on Intel P3
processors and later. SSE2 instructions work only on Intel P4 processors and
not on AMD processors. The AMD eqvivalent to SSE/SSE2 is called '3DNow!'.
You can use SSE2 instructions directly in Visual Studio in an inline
assembly '__asm' block, as I have done in very performance dependent loops.
As said, there are also other ways to utilize the SSE2 registers, which I
have no experience of:
I think you can allow the compiler to use SIMD instructions when
interpreting your c++-code. I don't know how.
You can also use SIMD 'Intrinsics' which is C++ instructions that
specifically use SIMD instructions.
+... ?
regards, Teis
"Andre" <fo********@hotmail.com> wrote in message
news:3F**************@hotmail.com...
Just wanted to know.. what really is sse and how can it improve code
performance? Thanks
-Andre
bill wrote: I am working on a project with alot of array manipulations
(sin,cos,mult). Does anyone know of a package utilizing simd (sse or mmx) to increase
the processing capability. ? (particularly for the sin/cos)
Gotta go fast!
Thanks,
Bill