blob: 785212a4a4e78b37cd6ab595b9256938ff00feb2 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2015 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 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Compiler Collection (GCC) Internals: Vectors</title>
<meta name="description" content="GNU Compiler Collection (GCC) Internals: Vectors">
<meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Vectors">
<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.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
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.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<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">10.6.4 Vectors</h4>
<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>
<dl compact="compact">
<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>
</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>