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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CODING FOR SIMD ARCHITECTURES4.1.3 Checking for Streaming SIMD Extensions 2 SupportChecking for support of SSE2 is like checking for SSE support. The OS requirementsfor SSE2 Support are the same as the OS requirements for SSE.To check whether your system supports SSE2, follow these steps:1. Check that your processor has the CPUID instruction.2. Check the feature bits of CPUID for SSE2 technology existence.Example 4-3 shows how to find the SSE2 feature bit (bit 26) in the CPUID featureflags.Example 4-3. Identification of SSE2 with cpuid…identify existence of cpuid instruction…; Identify signature is genuine intelmov eax, 1; Request for feature flagscpuid; 0FH, 0A2H CPUID instructiontest EDX, 004000000h ; Bit 26 in feature flags equal to 1jnz Found4.1.4 Checking for Streaming SIMD Extensions 3 SupportSSE3 includes 13 instructions, 11 of those are suited for SIMD or x87 style programming.Checking for support of SSE3 instructions is similar to checking for SSEsupport. The OS requirements for SSE3 Support are the same as the requirementsfor SSE.To check whether your system supports the x87 <strong>and</strong> SIMD instructions of SSE3,follow these steps:1. Check that your processor has the CPUID instruction.2. Check the ECX feature bit 0 of CPUID for SSE3 technology existence.Example 4-4 shows how to find the SSE3 feature bit (bit 0 of ECX) in the CPUIDfeature flags.Example 4-4. Identification of SSE3 with CPUID…identify existence of cpuid instruction…; Identify signature is genuine intelmov eax, 1; Request for feature flagscpuid; 0FH, 0A2H CPUID instructiontest ECX, 000000001h ; Bit 0 in feature flags equal to 1jnz Found4-3

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

Saved successfully!

Ooh no, something went wrong!