13.07.2015 Views

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 4CODING FOR SIMD ARCHITECTURESIntel Pentium 4, Intel Xeon <strong>and</strong> Pentium M processors include support for StreamingSIMD Extensions 2 (SSE2), Streaming SIMD Extensions technology (SSE), <strong>and</strong> MMXtechnology. In addition, Streaming SIMD Extensions 3 (SSE3) were introduced withthe Pentium 4 processor supporting Hyper-Threading Technology at 90 nm technology.Intel Core Solo <strong>and</strong> Intel Core Duo processors support SSE3/SSE2/SSE, <strong>and</strong> MMX.Processors based on Intel Core microarchitecture supports MMX, SSE, SSE2, SSE3,<strong>and</strong> SSSE3. Single-instruction, multiple-data (SIMD) technologies enable the developmentof advanced multimedia, signal processing, <strong>and</strong> modeling applications.To take advantage of the performance opportunities presented by these capabilities,do the following:• Ensure that the processor supports MMX technology, Streaming SIMDExtensions, Streaming SIMD Extensions 2, Streaming SIMD Extensions 3, <strong>and</strong>Supplemental Streaming SIMD Extensions 3.• Ensure that the operating system supports MMX technology <strong>and</strong> SSE (OS supportfor SSE2, SSE3 <strong>and</strong> SSSE3 is the same as OS support for SSE).• Employ the optimization <strong>and</strong> scheduling strategies described in this book.• Use stack <strong>and</strong> data alignment techniques to keep data properly aligned forefficient memory use.• Utilize the cacheability instructions offered by SSE <strong>and</strong> SSE2, where appropriate.4.1 CHECKING FOR PROCESSOR SUPPORT OF SIMDTECHNOLOGIESThis section shows how to check whether a processor supports MMX technology, SSE,SSE2, or SSE3.SIMD technology can be included in your application in three ways:1. Check for the SIMD technology during installation. If the desired SIMDtechnology is available, the appropriate DLLs can be installed.2. Check for the SIMD technology during program execution <strong>and</strong> install the properDLLs at runtime. This is effective for programs that may be executed on differentmachines.3. Create a “fat” binary that includes multiple versions of routines; versions that useSIMD technology <strong>and</strong> versions that do not. Check for SIMD technology duringprogram execution <strong>and</strong> run the appropriate versions of the routines. This isespecially effective for programs that may be executed on different machines.4-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!