Classes, Classes -17 – Intel ARCHITECTURE IA-32 User Manual

Page 197

Advertising
background image

Coding for SIMD Architectures

3

3-17

The intrinsic data types, however, are not a basic ANSI C data type, and
therefore you must observe the following usage restrictions:

Use

intrinsic data types only on the left-hand side of an assignment

as a return value or as a parameter. You cannot use it with other
arithmetic expressions (for example, “

+

”, “

>>

”).

Use

intrinsic data type objects in aggregates, such as unions to

access the byte elements and structures; the address of an

__m64

object may be also used.

Use intrinsic data type data only with the MMX technology
intrinsics described in this guide

.

For complete details of the hardware instructions, see the Intel
Architecture MMX Technology Programmer’s Reference Manual
. For
descriptions of data types, see the IA-32 Intel® Architecture Software
Developer’s Manual, Volumes 2A & 2B.

Classes

A set of C++ classes has been defined and available in Intel C++
Compiler to provide both a higher-level abstraction and more flexibility
for programming with MMX technology, Streaming SIMD Extensions
and Streaming SIMD Extensions 2. These classes provide an
easy-to-use and flexible interface to the intrinsic functions, allowing
developers to write more natural C++ code without worrying about
which intrinsic or assembly language instruction to use for a given
operation. Since the intrinsic functions underlie the implementation of
these C++ classes, the performance of applications using this
methodology can approach that of one using the intrinsics. Further
details on the use of these classes can be found in the Intel C++ Class
Libraries for SIMD Operations User’s Guide
, order number 693500.

Example 3-11 shows the C++ code using a vector class library. The
example assumes the arrays passed to the routine are already aligned to
16-byte boundaries.

Advertising