Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

244 lines
12KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Vectors (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Vectors (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Vectors (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Expression-trees.html#Expression-trees" rel="up" title="Expression trees">
  30. <link href="Statements.html#Statements" rel="next" title="Statements">
  31. <link href="Unary-and-Binary-Expressions.html#Unary-and-Binary-Expressions" rel="prev" title="Unary and Binary Expressions">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Vectors"></a>
  62. <div class="header">
  63. <p>
  64. 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>
  65. </div>
  66. <hr>
  67. <a name="Vectors-1"></a>
  68. <h4 class="subsection">11.6.4 Vectors</h4>
  69. <a name="index-VEC_005fDUPLICATE_005fEXPR"></a>
  70. <a name="index-VEC_005fSERIES_005fEXPR"></a>
  71. <a name="index-VEC_005fLSHIFT_005fEXPR"></a>
  72. <a name="index-VEC_005fRSHIFT_005fEXPR"></a>
  73. <a name="index-VEC_005fWIDEN_005fMULT_005fHI_005fEXPR"></a>
  74. <a name="index-VEC_005fWIDEN_005fMULT_005fLO_005fEXPR"></a>
  75. <a name="index-VEC_005fUNPACK_005fHI_005fEXPR"></a>
  76. <a name="index-VEC_005fUNPACK_005fLO_005fEXPR"></a>
  77. <a name="index-VEC_005fUNPACK_005fFLOAT_005fHI_005fEXPR"></a>
  78. <a name="index-VEC_005fUNPACK_005fFLOAT_005fLO_005fEXPR"></a>
  79. <a name="index-VEC_005fUNPACK_005fFIX_005fTRUNC_005fHI_005fEXPR"></a>
  80. <a name="index-VEC_005fUNPACK_005fFIX_005fTRUNC_005fLO_005fEXPR"></a>
  81. <a name="index-VEC_005fPACK_005fTRUNC_005fEXPR"></a>
  82. <a name="index-VEC_005fPACK_005fSAT_005fEXPR"></a>
  83. <a name="index-VEC_005fPACK_005fFIX_005fTRUNC_005fEXPR"></a>
  84. <a name="index-VEC_005fPACK_005fFLOAT_005fEXPR"></a>
  85. <a name="index-VEC_005fCOND_005fEXPR"></a>
  86. <a name="index-SAD_005fEXPR"></a>
  87. <dl compact="compact">
  88. <dt><code>VEC_DUPLICATE_EXPR</code></dt>
  89. <dd><p>This node has a single operand and represents a vector in which every
  90. element is equal to that operand.
  91. </p>
  92. </dd>
  93. <dt><code>VEC_SERIES_EXPR</code></dt>
  94. <dd><p>This node represents a vector formed from a scalar base and step,
  95. given as the first and second operands respectively. Element <var>i</var>
  96. of the result is equal to &lsquo;<samp><var>base</var> + <var>i</var>*<var>step</var></samp>&rsquo;.
  97. </p>
  98. <p>This node is restricted to integral types, in order to avoid
  99. specifying the rounding behavior for floating-point types.
  100. </p>
  101. </dd>
  102. <dt><code>VEC_LSHIFT_EXPR</code></dt>
  103. <dt><code>VEC_RSHIFT_EXPR</code></dt>
  104. <dd><p>These nodes represent whole vector left and right shifts, respectively.
  105. The first operand is the vector to shift; it will always be of vector type.
  106. The second operand is an expression for the number of bits by which to
  107. shift. Note that the result is undefined if the second operand is larger
  108. than or equal to the first operand&rsquo;s type size.
  109. </p>
  110. </dd>
  111. <dt><code>VEC_WIDEN_MULT_HI_EXPR</code></dt>
  112. <dt><code>VEC_WIDEN_MULT_LO_EXPR</code></dt>
  113. <dd><p>These nodes represent widening vector multiplication of the high and low
  114. parts of the two input vectors, respectively. Their operands are vectors
  115. that contain the same number of elements (<code>N</code>) of the same integral type.
  116. The result is a vector that contains half as many elements, of an integral type
  117. whose size is twice as wide. In the case of <code>VEC_WIDEN_MULT_HI_EXPR</code> the
  118. high <code>N/2</code> elements of the two vector are multiplied to produce the
  119. vector of <code>N/2</code> products. In the case of <code>VEC_WIDEN_MULT_LO_EXPR</code> the
  120. low <code>N/2</code> elements of the two vector are multiplied to produce the
  121. vector of <code>N/2</code> products.
  122. </p>
  123. </dd>
  124. <dt><code>VEC_UNPACK_HI_EXPR</code></dt>
  125. <dt><code>VEC_UNPACK_LO_EXPR</code></dt>
  126. <dd><p>These nodes represent unpacking of the high and low parts of the input vector,
  127. respectively. The single operand is a vector that contains <code>N</code> elements
  128. of the same integral or floating point type. The result is a vector
  129. that contains half as many elements, of an integral or floating point type
  130. whose size is twice as wide. In the case of <code>VEC_UNPACK_HI_EXPR</code> the
  131. high <code>N/2</code> elements of the vector are extracted and widened (promoted).
  132. In the case of <code>VEC_UNPACK_LO_EXPR</code> the low <code>N/2</code> elements of the
  133. vector are extracted and widened (promoted).
  134. </p>
  135. </dd>
  136. <dt><code>VEC_UNPACK_FLOAT_HI_EXPR</code></dt>
  137. <dt><code>VEC_UNPACK_FLOAT_LO_EXPR</code></dt>
  138. <dd><p>These nodes represent unpacking of the high and low parts of the input vector,
  139. where the values are converted from fixed point to floating point. The
  140. single operand is a vector that contains <code>N</code> elements of the same
  141. integral type. The result is a vector that contains half as many elements
  142. of a floating point type whose size is twice as wide. In the case of
  143. <code>VEC_UNPACK_FLOAT_HI_EXPR</code> the high <code>N/2</code> elements of the vector are
  144. extracted, converted and widened. In the case of <code>VEC_UNPACK_FLOAT_LO_EXPR</code>
  145. the low <code>N/2</code> elements of the vector are extracted, converted and widened.
  146. </p>
  147. </dd>
  148. <dt><code>VEC_UNPACK_FIX_TRUNC_HI_EXPR</code></dt>
  149. <dt><code>VEC_UNPACK_FIX_TRUNC_LO_EXPR</code></dt>
  150. <dd><p>These nodes represent unpacking of the high and low parts of the input vector,
  151. where the values are truncated from floating point to fixed point. The
  152. single operand is a vector that contains <code>N</code> elements of the same
  153. floating point type. The result is a vector that contains half as many
  154. elements of an integral type whose size is twice as wide. In the case of
  155. <code>VEC_UNPACK_FIX_TRUNC_HI_EXPR</code> the high <code>N/2</code> elements of the
  156. vector are extracted and converted with truncation. In the case of
  157. <code>VEC_UNPACK_FIX_TRUNC_LO_EXPR</code> the low <code>N/2</code> elements of the
  158. vector are extracted and converted with truncation.
  159. </p>
  160. </dd>
  161. <dt><code>VEC_PACK_TRUNC_EXPR</code></dt>
  162. <dd><p>This node represents packing of truncated elements of the two input vectors
  163. into the output vector. Input operands are vectors that contain the same
  164. number of elements of the same integral or floating point type. The result
  165. is a vector that contains twice as many elements of an integral or floating
  166. point type whose size is half as wide. The elements of the two vectors are
  167. demoted and merged (concatenated) to form the output vector.
  168. </p>
  169. </dd>
  170. <dt><code>VEC_PACK_SAT_EXPR</code></dt>
  171. <dd><p>This node represents packing of elements of the two input vectors into the
  172. output vector using saturation. Input operands are vectors that contain
  173. the same number of elements of the same integral type. The result is a
  174. vector that contains twice as many elements of an integral type whose size
  175. is half as wide. The elements of the two vectors are demoted and merged
  176. (concatenated) to form the output vector.
  177. </p>
  178. </dd>
  179. <dt><code>VEC_PACK_FIX_TRUNC_EXPR</code></dt>
  180. <dd><p>This node represents packing of elements of the two input vectors into the
  181. output vector, where the values are converted from floating point
  182. to fixed point. Input operands are vectors that contain the same number
  183. of elements of a floating point type. The result is a vector that contains
  184. twice as many elements of an integral type whose size is half as wide. The
  185. elements of the two vectors are merged (concatenated) to form the output
  186. vector.
  187. </p>
  188. </dd>
  189. <dt><code>VEC_PACK_FLOAT_EXPR</code></dt>
  190. <dd><p>This node represents packing of elements of the two input vectors into the
  191. output vector, where the values are converted from fixed point to floating
  192. point. Input operands are vectors that contain the same number of elements
  193. of an integral type. The result is a vector that contains twice as many
  194. elements of floating point type whose size is half as wide. The elements of
  195. the two vectors are merged (concatenated) to form the output vector.
  196. </p>
  197. </dd>
  198. <dt><code>VEC_COND_EXPR</code></dt>
  199. <dd><p>These nodes represent <code>?:</code> expressions. The three operands must be
  200. vectors of the same size and number of elements. The second and third
  201. operands must have the same type as the entire expression. The first
  202. operand is of signed integral vector type. If an element of the first
  203. operand evaluates to a zero value, the corresponding element of the
  204. result is taken from the third operand. If it evaluates to a minus one
  205. value, it is taken from the second operand. It should never evaluate to
  206. any other value currently, but optimizations should not rely on that
  207. property. In contrast with a <code>COND_EXPR</code>, all operands are always
  208. evaluated.
  209. </p>
  210. </dd>
  211. <dt><code>SAD_EXPR</code></dt>
  212. <dd><p>This node represents the Sum of Absolute Differences operation. The three
  213. operands must be vectors of integral types. The first and second operand
  214. must have the same type. The size of the vector element of the third
  215. operand must be at lease twice of the size of the vector element of the
  216. first and second one. The SAD is calculated between the first and second
  217. operands, added to the third operand, and returned.
  218. </p>
  219. </dd>
  220. </dl>
  221. <hr>
  222. <div class="header">
  223. <p>
  224. 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>
  225. </div>
  226. </body>
  227. </html>