Other Built-In Functions Provided By Gcc - Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

Chapter 6. Extensions to the C Language Family
SI
An integer, four times as wide as a QI mode integer, usually 32 bits.
DI
An integer, eight times as wide as a QI mode integer, usually 64 bits.
SF
A floating point value, as wide as a SI mode integer, usually 32 bits.
DF
A floating point value, as wide as a DI mode integer, usually 64 bits.
Specifying a combination that is not valid for the current architecture will cause gcc to synthesize the
instructions using a narrower mode. For example, if you specify a variable of type
architecture does not allow for this specific SIMD type, gcc will produce code that uses 4
The types defined in this manner can be used with a subset of normal C operations. Currently, gcc will
allow using the following operators on these types:
The operations behave like C++
elements of the operands. For example, in the code below, each of the 4 elements in
to the corresponding 4 elements in
typedef int v4si __attribute__ ((mode(V4SI)));
v4si a, b, c;
c = a + b;
Subtraction, multiplication, and division operate in a similar manner. Likewise, the result of using
the unary minus operator on a vector type is a vector whose elements are the negative value of the
corresponding elements in the operand.
You can declare variables and use them in function calls and returns, as well as in assignments and
some casts. You can specify a vector type as a return type for a function. Vector types can also be used
as function arguments. It is possible to cast from one vector type to another, provided they are of the
same size (in fact, you can also cast vectors to and from other datatypes of the same size).
You cannot operate between vectors of different lengths or different signedness without a cast.
A port that supports hardware vector operations, usually provides a set of built-in functions that can
be used to operate on vectors. For example, a function to add two vectors and multiply the result by a
third could look like this:
v4si f (v4si a, v4si b, v4si c)
{
v4si tmp = __builtin_addv4si (a, b);
return __builtin_mulv4si (tmp, c);
}

6.46. Other built-in functions provided by GCC

GCC provides a large number of built-in functions other than the ones mentioned above. Some of
these are for internal use in the processing of exceptions or variable-length argument lists and will not
be documented here because they may change from time to time; we do not recommend general use
of these functions.
The remaining functions are provided for optimization purposes.
+, -, *, /, unary minus
. Addition is defined as the addition of the corresponding
valarrays
and the resulting vector will be stored in
b
179
and your
V4SI
.
SIs
.
will be added
a
.
c

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Enterprise linux 3

Table of Contents