Common Intrinsic Functions

The common intrinsic functions are functions that perform simple and useful operations that are difficult to express concisely in C or C++. They are called common because they are supported on most of the target platforms for Windows CE .NET, although you may need to use in-line assembly language or a run-time library call on the x86 platform.

You can enable these functions by including Cmnintrin.h. All microprocessor families that support the common intrinsic functions have a machine-dependent description of support in this file. The machine-dependent description declares the functions with the correct prototype, enables the intrinsic version, and defines various macros that classify how the function is supported. These macros allow you to select the most efficient alternative for accomplishing a task, or you can use the intrinsic function unconditionally.

The macros defined in Cmnintrin.h help you classify the intrinsic support in your CPU environment. For example, the following code example shows how to use the _INTRINSIC_IS_SUPPORTED macro to determine support for the __trap intrinsic function.

#include <cmnintrin.h>
#if INTRINSIC_IS_SUPPORTED(__trap)
  __trap(1);  // __trap IS SUPPORTED
#else
   //  __trap IS NOT SUPPORTED
#endif

The following code example shows how to use the _INTRINSIC_IS_INLINE macro to determine if the _rotl intrinsic will be expanded inline.

#include <cmnintrin.h>
#if _INTRINSIC_IS_INLINE(_rotl)
     x = _rotl(y, 3);
#else
     x = MY_ROTL(y, 3);   // call my inline implementation, not the CRT helper
#endif

For more information about _rotl, see the Microsoft C Run-Time Library for Windows CE .NET.

All of the intrinsics are permanent intrinsic functions. Using them in #pragma function will generate an error message during compilation.

The following list shows the categories of intrinsic functions that Windows CE .NET supports.

See Also

About Intrinsic Functions | Microprocessor-specific Intrinsic Functions | Supported Microprocessor Families

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.