Checking for streaming simd extensions support, Checking for streaming simd extensions support -3, Example 3-1 – Intel ARCHITECTURE IA-32 User Manual

Page 183: Identification of mmx technology with cpuid -3

Advertising
background image

Coding for SIMD Architectures

3

3-3

For more information on

cpuid

see, Intel

®

Processor Identification with

CPUID Instruction, order number 241618.

Checking for Streaming SIMD Extensions Support

Checking for support of Streaming SIMD Extensions (SSE) on your
processor is like checking for MMX technology. However, you must
also check whether your operating system (OS) supports SSE. This is
because the OS needs to manage saving and restoring the state
introduced by SSE for your application to properly function.

To check whether your system supports SSE, follow these steps:

1.

Check that your processor supports the

cpuid

instruction.

2.

Check the feature bits of

cpuid

for SSE existence.

3.

Check for OS support for SSE.

Example 3-2

shows how to find the SSE feature bit (bit 25) in the

cpuid

feature flags.

Example 3-1

Identification of MMX Technology with cpuid

…identify existence of cpuid instruction

;

; identify signature is genuine intel

;

mov eax, 1

; request for feature flags

cpuid

; 0Fh, 0A2h cpuid instruction

test edx, 00800000h

; is MMX technology bit (bit

; 23)in feature flags equal to 1

jnz

Found

Advertising