Coding for SIMD Architectures
3
3-7
Example 3-6
Identification of SSE3 with
cpuid
SSE3 requires the same support from the operating system as SSE. To
find out whether the operating system supports SSE3 (FISTTP and 10 of
the SIMD instructions in SSE3), execute an SSE3 instruction and trap
for an exception if one occurs. Catching the exception in a simple
try/except clause (using structured exception handling in C++) and
checking whether the exception code is an invalid opcode will give you
the answer. See Example 3-7.
Detecting the availability of MONITOR and MWAIT instructions
can be done using a code sequence similar to
availability of
MONITOR and MWAIT is indicated by bit 3 of the
returned value in ECX.
Software must check for support of MONITOR and MWAIT before
attempting to use MONITOR and MWAIT. Checking for support of
MONITOR and MWAIT can be done by executing the MONITOR
execution and trap for an exception similar to the sequence shown in
…identify existence of cpuid instruction
…
; identify signature is genuine intel
mov eax, 1
; request for feature flags
cpuid
; 0Fh, 0A2h cpuid instruction
test ECX, 000000001h
; bit 0 in feature flags equal to 1
jnz
Found
Summary of Contents for ARCHITECTURE IA-32
Page 1: ...IA 32 Intel Architecture Optimization Reference Manual Order Number 248966 013US April 2006...
Page 220: ...IA 32 Intel Architecture Optimization 3 40...
Page 434: ...IA 32 Intel Architecture Optimization 9 20...
Page 514: ...IA 32 Intel Architecture Optimization B 60...
Page 536: ...IA 32 Intel Architecture Optimization C 22...