Vectors.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>GNU Compiler Collection (GCC) Internals: Vectors</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Vectors">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Vectors">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Vectors"></a>
  63. <div class="header">
  64. <p>
  65. 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>
  66. </div>
  67. <hr>
  68. <a name="Vectors-1"></a>
  69. <h4 class="subsection">10.6.4 Vectors</h4>
  70. <a name="index-VEC_005fLSHIFT_005fEXPR"></a>
  71. <a name="index-VEC_005fRSHIFT_005fEXPR"></a>
  72. <a name="index-VEC_005fWIDEN_005fMULT_005fHI_005fEXPR"></a>
  73. <a name="index-VEC_005fWIDEN_005fMULT_005fLO_005fEXPR"></a>
  74. <a name="index-VEC_005fUNPACK_005fHI_005fEXPR"></a>
  75. <a name="index-VEC_005fUNPACK_005fLO_005fEXPR"></a>
  76. <a name="index-VEC_005fUNPACK_005fFLOAT_005fHI_005fEXPR"></a>
  77. <a name="index-VEC_005fUNPACK_005fFLOAT_005fLO_005fEXPR"></a>
  78. <a name="index-VEC_005fPACK_005fTRUNC_005fEXPR"></a>
  79. <a name="index-VEC_005fPACK_005fSAT_005fEXPR"></a>
  80. <a name="index-VEC_005fPACK_005fFIX_005fTRUNC_005fEXPR"></a>
  81. <a name="index-SAD_005fEXPR"></a>
  82. <dl compact="compact">
  83. <dt><code>VEC_LSHIFT_EXPR</code></dt>
  84. <dt><code>VEC_RSHIFT_EXPR</code></dt>
  85. <dd><p>These nodes represent whole vector left and right shifts, respectively.
  86. The first operand is the vector to shift; it will always be of vector type.
  87. The second operand is an expression for the number of bits by which to
  88. shift. Note that the result is undefined if the second operand is larger
  89. than or equal to the first operand&rsquo;s type size.
  90. </p>
  91. </dd>
  92. <dt><code>VEC_WIDEN_MULT_HI_EXPR</code></dt>
  93. <dt><code>VEC_WIDEN_MULT_LO_EXPR</code></dt>
  94. <dd><p>These nodes represent widening vector multiplication of the high and low
  95. parts of the two input vectors, respectively. Their operands are vectors
  96. that contain the same number of elements (<code>N</code>) of the same integral type.
  97. The result is a vector that contains half as many elements, of an integral type
  98. whose size is twice as wide. In the case of <code>VEC_WIDEN_MULT_HI_EXPR</code> the
  99. high <code>N/2</code> elements of the two vector are multiplied to produce the
  100. vector of <code>N/2</code> products. In the case of <code>VEC_WIDEN_MULT_LO_EXPR</code> the
  101. low <code>N/2</code> elements of the two vector are multiplied to produce the
  102. vector of <code>N/2</code> products.
  103. </p>
  104. </dd>
  105. <dt><code>VEC_UNPACK_HI_EXPR</code></dt>
  106. <dt><code>VEC_UNPACK_LO_EXPR</code></dt>
  107. <dd><p>These nodes represent unpacking of the high and low parts of the input vector,
  108. respectively. The single operand is a vector that contains <code>N</code> elements
  109. of the same integral or floating point type. The result is a vector
  110. that contains half as many elements, of an integral or floating point type
  111. whose size is twice as wide. In the case of <code>VEC_UNPACK_HI_EXPR</code> the
  112. high <code>N/2</code> elements of the vector are extracted and widened (promoted).
  113. In the case of <code>VEC_UNPACK_LO_EXPR</code> the low <code>N/2</code> elements of the
  114. vector are extracted and widened (promoted).
  115. </p>
  116. </dd>
  117. <dt><code>VEC_UNPACK_FLOAT_HI_EXPR</code></dt>
  118. <dt><code>VEC_UNPACK_FLOAT_LO_EXPR</code></dt>
  119. <dd><p>These nodes represent unpacking of the high and low parts of the input vector,
  120. where the values are converted from fixed point to floating point. The
  121. single operand is a vector that contains <code>N</code> elements of the same
  122. integral type. The result is a vector that contains half as many elements
  123. of a floating point type whose size is twice as wide. In the case of
  124. <code>VEC_UNPACK_HI_EXPR</code> the high <code>N/2</code> elements of the vector are
  125. extracted, converted and widened. In the case of <code>VEC_UNPACK_LO_EXPR</code>
  126. the low <code>N/2</code> elements of the vector are extracted, converted and widened.
  127. </p>
  128. </dd>
  129. <dt><code>VEC_PACK_TRUNC_EXPR</code></dt>
  130. <dd><p>This node represents packing of truncated elements of the two input vectors
  131. into the output vector. Input operands are vectors that contain the same
  132. number of elements of the same integral or floating point type. The result
  133. is a vector that contains twice as many elements of an integral or floating
  134. point type whose size is half as wide. The elements of the two vectors are
  135. demoted and merged (concatenated) to form the output vector.
  136. </p>
  137. </dd>
  138. <dt><code>VEC_PACK_SAT_EXPR</code></dt>
  139. <dd><p>This node represents packing of elements of the two input vectors into the
  140. output vector using saturation. Input operands are vectors that contain
  141. the same number of elements of the same integral type. The result is a
  142. vector that contains twice as many elements of an integral type whose size
  143. is half as wide. The elements of the two vectors are demoted and merged
  144. (concatenated) to form the output vector.
  145. </p>
  146. </dd>
  147. <dt><code>VEC_PACK_FIX_TRUNC_EXPR</code></dt>
  148. <dd><p>This node represents packing of elements of the two input vectors into the
  149. output vector, where the values are converted from floating point
  150. to fixed point. Input operands are vectors that contain the same number
  151. of elements of a floating point type. The result is a vector that contains
  152. twice as many elements of an integral type whose size is half as wide. The
  153. elements of the two vectors are merged (concatenated) to form the output
  154. vector.
  155. </p>
  156. </dd>
  157. <dt><code>VEC_COND_EXPR</code></dt>
  158. <dd><p>These nodes represent <code>?:</code> expressions. The three operands must be
  159. vectors of the same size and number of elements. The second and third
  160. operands must have the same type as the entire expression. The first
  161. operand is of signed integral vector type. If an element of the first
  162. operand evaluates to a zero value, the corresponding element of the
  163. result is taken from the third operand. If it evaluates to a minus one
  164. value, it is taken from the second operand. It should never evaluate to
  165. any other value currently, but optimizations should not rely on that
  166. property. In contrast with a <code>COND_EXPR</code>, all operands are always
  167. evaluated.
  168. </p>
  169. </dd>
  170. <dt><code>SAD_EXPR</code></dt>
  171. <dd><p>This node represents the Sum of Absolute Differences operation. The three
  172. operands must be vectors of integral types. The first and second operand
  173. must have the same type. The size of the vector element of the third
  174. operand must be at lease twice of the size of the vector element of the
  175. first and second one. The SAD is calculated between the first and second
  176. operands, added to the third operand, and returned.
  177. </p>
  178. </dd>
  179. </dl>
  180. <hr>
  181. <div class="header">
  182. <p>
  183. 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>
  184. </div>
  185. </body>
  186. </html>