Example 3-7, Identification of sse3 by the os -8 – Intel ARCHITECTURE IA-32 User Manual

Page 188

Advertising
background image

IA-32 Intel® Architecture Optimization

3-8

Example 3-7

Identification of SSE3 by the OS

Considerations for Code Conversion to SIMD
Programming

The VTune Performance Enhancement Environment CD provides tools
to aid in the evaluation and tuning. But before implementing them, you
need answers to the following questions:

1.

Will the current code benefit by using MMX technology, Streaming
SIMD Extensions, Streaming SIMD Extensions 2, or Streaming
SIMD Extensions 3?

2.

Is this code integer or floating-point?

3.

What integer word size or floating-point precision is needed?

4.

What coding techniques should I use?

5.

What guidelines do I need to follow?

6.

How should I arrange and align the datatypes?

Figure 3-1 provides a flowchart for the process of converting code to
MMX technology, Streaming SIMD Extensions, or Streaming SIMD
Extensions 2.

bool SSE3_SIMD_SupportCheck() {

_try {

__asm addsubpd xmm0, xmm0 ; SSE3}

_except(EXCEPTION_EXECUTE_HANDLER) {

if _exception_code()==STATUS_ILLEGAL_INSTRUCTION)

/* SSE3not supported */

return (false);

}

/* SSE3 SIMD and FISTTP instructions are supported */

return (true);

}

Advertising