You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
10 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2018 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
"GNU Free Documentation License".
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development. -->
<!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Vectors (GNU Compiler Collection (GCC) Internals)</title>
<meta name="description" content="Vectors (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Vectors (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Expression-trees.html#Expression-trees" rel="up" title="Expression trees">
<link href="Statements.html#Statements" rel="next" title="Statements">
<link href="Unary-and-Binary-Expressions.html#Unary-and-Binary-Expressions" rel="prev" title="Unary and Binary Expressions">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Vectors"></a>
<div class="header">
<p>
Previous: <a href="Unary-and-Binary-Expressions.html#Unary-and-Binary-Expressions" accesskey="p" rel="prev">Unary and Binary Expressions</a>, Up: <a href="Expression-trees.html#Expression-trees" accesskey="u" rel="up">Expression trees</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Vectors-1"></a>
<h4 class="subsection">11.6.4 Vectors</h4>
<a name="index-VEC_005fDUPLICATE_005fEXPR"></a>
<a name="index-VEC_005fSERIES_005fEXPR"></a>
<a name="index-VEC_005fLSHIFT_005fEXPR"></a>
<a name="index-VEC_005fRSHIFT_005fEXPR"></a>
<a name="index-VEC_005fWIDEN_005fMULT_005fHI_005fEXPR"></a>
<a name="index-VEC_005fWIDEN_005fMULT_005fLO_005fEXPR"></a>
<a name="index-VEC_005fUNPACK_005fHI_005fEXPR"></a>
<a name="index-VEC_005fUNPACK_005fLO_005fEXPR"></a>
<a name="index-VEC_005fUNPACK_005fFLOAT_005fHI_005fEXPR"></a>
<a name="index-VEC_005fUNPACK_005fFLOAT_005fLO_005fEXPR"></a>
<a name="index-VEC_005fPACK_005fTRUNC_005fEXPR"></a>
<a name="index-VEC_005fPACK_005fSAT_005fEXPR"></a>
<a name="index-VEC_005fPACK_005fFIX_005fTRUNC_005fEXPR"></a>
<a name="index-VEC_005fCOND_005fEXPR"></a>
<a name="index-SAD_005fEXPR"></a>
<dl compact="compact">
<dt><code>VEC_DUPLICATE_EXPR</code></dt>
<dd><p>This node has a single operand and represents a vector in which every
element is equal to that operand.
</p>
</dd>
<dt><code>VEC_SERIES_EXPR</code></dt>
<dd><p>This node represents a vector formed from a scalar base and step,
given as the first and second operands respectively. Element <var>i</var>
of the result is equal to &lsquo;<samp><var>base</var> + <var>i</var>*<var>step</var></samp>&rsquo;.
</p>
<p>This node is restricted to integral types, in order to avoid
specifying the rounding behavior for floating-point types.
</p>
</dd>
<dt><code>VEC_LSHIFT_EXPR</code></dt>
<dt><code>VEC_RSHIFT_EXPR</code></dt>
<dd><p>These nodes represent whole vector left and right shifts, respectively.
The first operand is the vector to shift; it will always be of vector type.
The second operand is an expression for the number of bits by which to
shift. Note that the result is undefined if the second operand is larger
than or equal to the first operand&rsquo;s type size.
</p>
</dd>
<dt><code>VEC_WIDEN_MULT_HI_EXPR</code></dt>
<dt><code>VEC_WIDEN_MULT_LO_EXPR</code></dt>
<dd><p>These nodes represent widening vector multiplication of the high and low
parts of the two input vectors, respectively. Their operands are vectors
that contain the same number of elements (<code>N</code>) of the same integral type.
The result is a vector that contains half as many elements, of an integral type
whose size is twice as wide. In the case of <code>VEC_WIDEN_MULT_HI_EXPR</code> the
high <code>N/2</code> elements of the two vector are multiplied to produce the
vector of <code>N/2</code> products. In the case of <code>VEC_WIDEN_MULT_LO_EXPR</code> the
low <code>N/2</code> elements of the two vector are multiplied to produce the
vector of <code>N/2</code> products.
</p>
</dd>
<dt><code>VEC_UNPACK_HI_EXPR</code></dt>
<dt><code>VEC_UNPACK_LO_EXPR</code></dt>
<dd><p>These nodes represent unpacking of the high and low parts of the input vector,
respectively. The single operand is a vector that contains <code>N</code> elements
of the same integral or floating point type. The result is a vector
that contains half as many elements, of an integral or floating point type
whose size is twice as wide. In the case of <code>VEC_UNPACK_HI_EXPR</code> the
high <code>N/2</code> elements of the vector are extracted and widened (promoted).
In the case of <code>VEC_UNPACK_LO_EXPR</code> the low <code>N/2</code> elements of the
vector are extracted and widened (promoted).
</p>
</dd>
<dt><code>VEC_UNPACK_FLOAT_HI_EXPR</code></dt>
<dt><code>VEC_UNPACK_FLOAT_LO_EXPR</code></dt>
<dd><p>These nodes represent unpacking of the high and low parts of the input vector,
where the values are converted from fixed point to floating point. The
single operand is a vector that contains <code>N</code> elements of the same
integral type. The result is a vector that contains half as many elements
of a floating point type whose size is twice as wide. In the case of
<code>VEC_UNPACK_HI_EXPR</code> the high <code>N/2</code> elements of the vector are
extracted, converted and widened. In the case of <code>VEC_UNPACK_LO_EXPR</code>
the low <code>N/2</code> elements of the vector are extracted, converted and widened.
</p>
</dd>
<dt><code>VEC_PACK_TRUNC_EXPR</code></dt>
<dd><p>This node represents packing of truncated elements of the two input vectors
into the output vector. Input operands are vectors that contain the same
number of elements of the same integral or floating point type. The result
is a vector that contains twice as many elements of an integral or floating
point type whose size is half as wide. The elements of the two vectors are
demoted and merged (concatenated) to form the output vector.
</p>
</dd>
<dt><code>VEC_PACK_SAT_EXPR</code></dt>
<dd><p>This node represents packing of elements of the two input vectors into the
output vector using saturation. Input operands are vectors that contain
the same number of elements of the same integral type. The result is a
vector that contains twice as many elements of an integral type whose size
is half as wide. The elements of the two vectors are demoted and merged
(concatenated) to form the output vector.
</p>
</dd>
<dt><code>VEC_PACK_FIX_TRUNC_EXPR</code></dt>
<dd><p>This node represents packing of elements of the two input vectors into the
output vector, where the values are converted from floating point
to fixed point. Input operands are vectors that contain the same number
of elements of a floating point type. The result is a vector that contains
twice as many elements of an integral type whose size is half as wide. The
elements of the two vectors are merged (concatenated) to form the output
vector.
</p>
</dd>
<dt><code>VEC_COND_EXPR</code></dt>
<dd><p>These nodes represent <code>?:</code> expressions. The three operands must be
vectors of the same size and number of elements. The second and third
operands must have the same type as the entire expression. The first
operand is of signed integral vector type. If an element of the first
operand evaluates to a zero value, the corresponding element of the
result is taken from the third operand. If it evaluates to a minus one
value, it is taken from the second operand. It should never evaluate to
any other value currently, but optimizations should not rely on that
property. In contrast with a <code>COND_EXPR</code>, all operands are always
evaluated.
</p>
</dd>
<dt><code>SAD_EXPR</code></dt>
<dd><p>This node represents the Sum of Absolute Differences operation. The three
operands must be vectors of integral types. The first and second operand
must have the same type. The size of the vector element of the third
operand must be at lease twice of the size of the vector element of the
first and second one. The SAD is calculated between the first and second
operands, added to the third operand, and returned.
</p>
</dd>
</dl>
<hr>
<div class="header">
<p>
Previous: <a href="Unary-and-Binary-Expressions.html#Unary-and-Binary-Expressions" accesskey="p" rel="prev">Unary and Binary Expressions</a>, Up: <a href="Expression-trees.html#Expression-trees" accesskey="u" rel="up">Expression trees</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>