Checking for mmx technology support, Checking for mmx technology support -2 – Intel ARCHITECTURE IA-32 User Manual

Page 182

Advertising
background image

IA-32 Intel® Architecture Optimization

3-2

Checking for Processor Support of SIMD
Technologies

This 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
SIMD technology is available, the appropriate DLLs can be
installed.

2.

Check for the SIMD technology during program execution and
install the proper DLLs at runtime. This is effective for programs
that may be executed on different machines.

3.

Create a “fat” binary that includes multiple versions of routines;
versions that use SIMD technology and versions that do not. Check
for SIMD technology during program execution and run the
appropriate versions of the routines. This is especially effective for
programs that may be executed on different machines.

Checking for MMX Technology Support

To check if MMX technology is available on your system, use

cpuid

to

and check the feature flags in the

edx

register. If

cpuid

returns bit 23

set to 1 in the feature flags, the processor supports MMX technology.

Use the code segment in Example 3-1 to test for the existence of MMX
technology.

Advertising