Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Intrinsics

A detailed introduction and information about Intel intrinsics is provided in the Intel® C++ Compiler Classic Developer Guide and Reference. The Intel® Intrinsics Guide provides detailed information and a lookup tool for viewing the available Intel intrinsics.

The following is some general information:

  • Intrinsics are assembly-coded functions that let you use C++ function calls and variables in place of assembly instructions.

  • Intrinsics can be used only on the host.

  • Intrinsics are expanded inline eliminating function call overhead. Providing the same benefit as using inline assembly, intrinsics improve code readability, assist instruction scheduling, and help reduce debugging.

  • Intrinsics provide access to instructions that cannot be generated using the standard constructs of the C and C++ languages.

NOTE:

To use intrinsic-based code with the Intel® oneAPI DPC++/C++ Compiler, do the following:

  • Include the immintrin.h header file that comes with the intrinsic declarations.

  • Use __attribute__((target(<required target>))) to denote functions that are intended to be executed on specific target architectures.

    This provides the advantage of allowing the parts of the compilation unit that do not use intrinsics to be compiled using the default architecture, while also allowing functions that do use intrinsics to be targeted for a specific architecture.

    For more information about the target attribute, see target.

Availability of Intrinsics on Intel Processors

Not all Intel® processors support all intrinsics. For information on which intrinsics are supported on Intel® processors, visit the Product Specification, Processors page. The Processor Spec Finder tool links directly to all processor documentation and the datasheets list the features, including intrinsics, supported by each processor.