Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

_set_SSE2_enable

Enables or disables the use of Streaming SIMD Extensions 2 Instructions (SSE2) instructions in CRT math routines.

int _set_SSE2_enable(
   int flag
);

Parameter

flag
1 if you want to enable SSE2 implementation. 0 if you want to disable SSE2 implementation. By default, SSE2 implementation is enabled on processors that support it.

Return Value

Nonzero if SSE2 implementation is enabled, zero if SSE2 implementation is disabled.

Remarks

The following functions have SSE2 implementations that can be enabled with _set_SSE2_enable:

The SSE2 implementation may give slightly different answers from the default implementations of these functions, because SSE2 intermediate values are 64-bit floating-point quantities but the default implementation intermediate values are 80-bit floating-point quantities.

The SSE2 implementation will only be used if all exceptions are masked. Use _control87, _controlfp to mask exceptions.

Requirements

Routine Required header Compatibility
_set_SSE2_enable <math.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

// crt_set_SSE2_enable.c
#include <math.h>
#include <stdio.h>

int main()
{
   int i = _set_SSE2_enable(1);

   if (i)
      printf("SSE2 enabled.\n");
   else
      printf("SSE2 not enabled; processor does not support SSE2.\n");
}

Sample Output

SSE2 not enabled; processor does not support SSE2.

See Also

C Run-Time Libraries | Run-Time Routines and .NET Framework Equivalents

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.