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

307 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>SPARC VIS Built-in Functions (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="SPARC VIS Built-in Functions (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="SPARC VIS Built-in Functions (Using the GNU Compiler Collection (GCC))">
  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="Target-Builtins.html#Target-Builtins" rel="up" title="Target Builtins">
  30. <link href="TI-C6X-Built_002din-Functions.html#TI-C6X-Built_002din-Functions" rel="next" title="TI C6X Built-in Functions">
  31. <link href="SH-Built_002din-Functions.html#SH-Built_002din-Functions" rel="prev" title="SH Built-in Functions">
  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="SPARC-VIS-Built_002din-Functions"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="TI-C6X-Built_002din-Functions.html#TI-C6X-Built_002din-Functions" accesskey="n" rel="next">TI C6X Built-in Functions</a>, Previous: <a href="SH-Built_002din-Functions.html#SH-Built_002din-Functions" accesskey="p" rel="prev">SH Built-in Functions</a>, Up: <a href="Target-Builtins.html#Target-Builtins" accesskey="u" rel="up">Target Builtins</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="SPARC-VIS-Built_002din-Functions-1"></a>
  68. <h4 class="subsection">6.60.30 SPARC VIS Built-in Functions</h4>
  69. <p>GCC supports SIMD operations on the SPARC using both the generic vector
  70. extensions (see <a href="Vector-Extensions.html#Vector-Extensions">Vector Extensions</a>) as well as built-in functions for
  71. the SPARC Visual Instruction Set (VIS). When you use the <samp>-mvis</samp>
  72. switch, the VIS extension is exposed as the following built-in functions:
  73. </p>
  74. <div class="smallexample">
  75. <pre class="smallexample">typedef int v1si __attribute__ ((vector_size (4)));
  76. typedef int v2si __attribute__ ((vector_size (8)));
  77. typedef short v4hi __attribute__ ((vector_size (8)));
  78. typedef short v2hi __attribute__ ((vector_size (4)));
  79. typedef unsigned char v8qi __attribute__ ((vector_size (8)));
  80. typedef unsigned char v4qi __attribute__ ((vector_size (4)));
  81. void __builtin_vis_write_gsr (int64_t);
  82. int64_t __builtin_vis_read_gsr (void);
  83. void * __builtin_vis_alignaddr (void *, long);
  84. void * __builtin_vis_alignaddrl (void *, long);
  85. int64_t __builtin_vis_faligndatadi (int64_t, int64_t);
  86. v2si __builtin_vis_faligndatav2si (v2si, v2si);
  87. v4hi __builtin_vis_faligndatav4hi (v4si, v4si);
  88. v8qi __builtin_vis_faligndatav8qi (v8qi, v8qi);
  89. v4hi __builtin_vis_fexpand (v4qi);
  90. v4hi __builtin_vis_fmul8x16 (v4qi, v4hi);
  91. v4hi __builtin_vis_fmul8x16au (v4qi, v2hi);
  92. v4hi __builtin_vis_fmul8x16al (v4qi, v2hi);
  93. v4hi __builtin_vis_fmul8sux16 (v8qi, v4hi);
  94. v4hi __builtin_vis_fmul8ulx16 (v8qi, v4hi);
  95. v2si __builtin_vis_fmuld8sux16 (v4qi, v2hi);
  96. v2si __builtin_vis_fmuld8ulx16 (v4qi, v2hi);
  97. v4qi __builtin_vis_fpack16 (v4hi);
  98. v8qi __builtin_vis_fpack32 (v2si, v8qi);
  99. v2hi __builtin_vis_fpackfix (v2si);
  100. v8qi __builtin_vis_fpmerge (v4qi, v4qi);
  101. int64_t __builtin_vis_pdist (v8qi, v8qi, int64_t);
  102. long __builtin_vis_edge8 (void *, void *);
  103. long __builtin_vis_edge8l (void *, void *);
  104. long __builtin_vis_edge16 (void *, void *);
  105. long __builtin_vis_edge16l (void *, void *);
  106. long __builtin_vis_edge32 (void *, void *);
  107. long __builtin_vis_edge32l (void *, void *);
  108. long __builtin_vis_fcmple16 (v4hi, v4hi);
  109. long __builtin_vis_fcmple32 (v2si, v2si);
  110. long __builtin_vis_fcmpne16 (v4hi, v4hi);
  111. long __builtin_vis_fcmpne32 (v2si, v2si);
  112. long __builtin_vis_fcmpgt16 (v4hi, v4hi);
  113. long __builtin_vis_fcmpgt32 (v2si, v2si);
  114. long __builtin_vis_fcmpeq16 (v4hi, v4hi);
  115. long __builtin_vis_fcmpeq32 (v2si, v2si);
  116. v4hi __builtin_vis_fpadd16 (v4hi, v4hi);
  117. v2hi __builtin_vis_fpadd16s (v2hi, v2hi);
  118. v2si __builtin_vis_fpadd32 (v2si, v2si);
  119. v1si __builtin_vis_fpadd32s (v1si, v1si);
  120. v4hi __builtin_vis_fpsub16 (v4hi, v4hi);
  121. v2hi __builtin_vis_fpsub16s (v2hi, v2hi);
  122. v2si __builtin_vis_fpsub32 (v2si, v2si);
  123. v1si __builtin_vis_fpsub32s (v1si, v1si);
  124. long __builtin_vis_array8 (long, long);
  125. long __builtin_vis_array16 (long, long);
  126. long __builtin_vis_array32 (long, long);
  127. </pre></div>
  128. <p>When you use the <samp>-mvis2</samp> switch, the VIS version 2.0 built-in
  129. functions also become available:
  130. </p>
  131. <div class="smallexample">
  132. <pre class="smallexample">long __builtin_vis_bmask (long, long);
  133. int64_t __builtin_vis_bshuffledi (int64_t, int64_t);
  134. v2si __builtin_vis_bshufflev2si (v2si, v2si);
  135. v4hi __builtin_vis_bshufflev2si (v4hi, v4hi);
  136. v8qi __builtin_vis_bshufflev2si (v8qi, v8qi);
  137. long __builtin_vis_edge8n (void *, void *);
  138. long __builtin_vis_edge8ln (void *, void *);
  139. long __builtin_vis_edge16n (void *, void *);
  140. long __builtin_vis_edge16ln (void *, void *);
  141. long __builtin_vis_edge32n (void *, void *);
  142. long __builtin_vis_edge32ln (void *, void *);
  143. </pre></div>
  144. <p>When you use the <samp>-mvis3</samp> switch, the VIS version 3.0 built-in
  145. functions also become available:
  146. </p>
  147. <div class="smallexample">
  148. <pre class="smallexample">void __builtin_vis_cmask8 (long);
  149. void __builtin_vis_cmask16 (long);
  150. void __builtin_vis_cmask32 (long);
  151. v4hi __builtin_vis_fchksm16 (v4hi, v4hi);
  152. v4hi __builtin_vis_fsll16 (v4hi, v4hi);
  153. v4hi __builtin_vis_fslas16 (v4hi, v4hi);
  154. v4hi __builtin_vis_fsrl16 (v4hi, v4hi);
  155. v4hi __builtin_vis_fsra16 (v4hi, v4hi);
  156. v2si __builtin_vis_fsll16 (v2si, v2si);
  157. v2si __builtin_vis_fslas16 (v2si, v2si);
  158. v2si __builtin_vis_fsrl16 (v2si, v2si);
  159. v2si __builtin_vis_fsra16 (v2si, v2si);
  160. long __builtin_vis_pdistn (v8qi, v8qi);
  161. v4hi __builtin_vis_fmean16 (v4hi, v4hi);
  162. int64_t __builtin_vis_fpadd64 (int64_t, int64_t);
  163. int64_t __builtin_vis_fpsub64 (int64_t, int64_t);
  164. v4hi __builtin_vis_fpadds16 (v4hi, v4hi);
  165. v2hi __builtin_vis_fpadds16s (v2hi, v2hi);
  166. v4hi __builtin_vis_fpsubs16 (v4hi, v4hi);
  167. v2hi __builtin_vis_fpsubs16s (v2hi, v2hi);
  168. v2si __builtin_vis_fpadds32 (v2si, v2si);
  169. v1si __builtin_vis_fpadds32s (v1si, v1si);
  170. v2si __builtin_vis_fpsubs32 (v2si, v2si);
  171. v1si __builtin_vis_fpsubs32s (v1si, v1si);
  172. long __builtin_vis_fucmple8 (v8qi, v8qi);
  173. long __builtin_vis_fucmpne8 (v8qi, v8qi);
  174. long __builtin_vis_fucmpgt8 (v8qi, v8qi);
  175. long __builtin_vis_fucmpeq8 (v8qi, v8qi);
  176. float __builtin_vis_fhadds (float, float);
  177. double __builtin_vis_fhaddd (double, double);
  178. float __builtin_vis_fhsubs (float, float);
  179. double __builtin_vis_fhsubd (double, double);
  180. float __builtin_vis_fnhadds (float, float);
  181. double __builtin_vis_fnhaddd (double, double);
  182. int64_t __builtin_vis_umulxhi (int64_t, int64_t);
  183. int64_t __builtin_vis_xmulx (int64_t, int64_t);
  184. int64_t __builtin_vis_xmulxhi (int64_t, int64_t);
  185. </pre></div>
  186. <p>When you use the <samp>-mvis4</samp> switch, the VIS version 4.0 built-in
  187. functions also become available:
  188. </p>
  189. <div class="smallexample">
  190. <pre class="smallexample">v8qi __builtin_vis_fpadd8 (v8qi, v8qi);
  191. v8qi __builtin_vis_fpadds8 (v8qi, v8qi);
  192. v8qi __builtin_vis_fpaddus8 (v8qi, v8qi);
  193. v4hi __builtin_vis_fpaddus16 (v4hi, v4hi);
  194. v8qi __builtin_vis_fpsub8 (v8qi, v8qi);
  195. v8qi __builtin_vis_fpsubs8 (v8qi, v8qi);
  196. v8qi __builtin_vis_fpsubus8 (v8qi, v8qi);
  197. v4hi __builtin_vis_fpsubus16 (v4hi, v4hi);
  198. long __builtin_vis_fpcmple8 (v8qi, v8qi);
  199. long __builtin_vis_fpcmpgt8 (v8qi, v8qi);
  200. long __builtin_vis_fpcmpule16 (v4hi, v4hi);
  201. long __builtin_vis_fpcmpugt16 (v4hi, v4hi);
  202. long __builtin_vis_fpcmpule32 (v2si, v2si);
  203. long __builtin_vis_fpcmpugt32 (v2si, v2si);
  204. v8qi __builtin_vis_fpmax8 (v8qi, v8qi);
  205. v4hi __builtin_vis_fpmax16 (v4hi, v4hi);
  206. v2si __builtin_vis_fpmax32 (v2si, v2si);
  207. v8qi __builtin_vis_fpmaxu8 (v8qi, v8qi);
  208. v4hi __builtin_vis_fpmaxu16 (v4hi, v4hi);
  209. v2si __builtin_vis_fpmaxu32 (v2si, v2si);
  210. v8qi __builtin_vis_fpmin8 (v8qi, v8qi);
  211. v4hi __builtin_vis_fpmin16 (v4hi, v4hi);
  212. v2si __builtin_vis_fpmin32 (v2si, v2si);
  213. v8qi __builtin_vis_fpminu8 (v8qi, v8qi);
  214. v4hi __builtin_vis_fpminu16 (v4hi, v4hi);
  215. v2si __builtin_vis_fpminu32 (v2si, v2si);
  216. </pre></div>
  217. <p>When you use the <samp>-mvis4b</samp> switch, the VIS version 4.0B
  218. built-in functions also become available:
  219. </p>
  220. <div class="smallexample">
  221. <pre class="smallexample">v8qi __builtin_vis_dictunpack8 (double, int);
  222. v4hi __builtin_vis_dictunpack16 (double, int);
  223. v2si __builtin_vis_dictunpack32 (double, int);
  224. long __builtin_vis_fpcmple8shl (v8qi, v8qi, int);
  225. long __builtin_vis_fpcmpgt8shl (v8qi, v8qi, int);
  226. long __builtin_vis_fpcmpeq8shl (v8qi, v8qi, int);
  227. long __builtin_vis_fpcmpne8shl (v8qi, v8qi, int);
  228. long __builtin_vis_fpcmple16shl (v4hi, v4hi, int);
  229. long __builtin_vis_fpcmpgt16shl (v4hi, v4hi, int);
  230. long __builtin_vis_fpcmpeq16shl (v4hi, v4hi, int);
  231. long __builtin_vis_fpcmpne16shl (v4hi, v4hi, int);
  232. long __builtin_vis_fpcmple32shl (v2si, v2si, int);
  233. long __builtin_vis_fpcmpgt32shl (v2si, v2si, int);
  234. long __builtin_vis_fpcmpeq32shl (v2si, v2si, int);
  235. long __builtin_vis_fpcmpne32shl (v2si, v2si, int);
  236. long __builtin_vis_fpcmpule8shl (v8qi, v8qi, int);
  237. long __builtin_vis_fpcmpugt8shl (v8qi, v8qi, int);
  238. long __builtin_vis_fpcmpule16shl (v4hi, v4hi, int);
  239. long __builtin_vis_fpcmpugt16shl (v4hi, v4hi, int);
  240. long __builtin_vis_fpcmpule32shl (v2si, v2si, int);
  241. long __builtin_vis_fpcmpugt32shl (v2si, v2si, int);
  242. long __builtin_vis_fpcmpde8shl (v8qi, v8qi, int);
  243. long __builtin_vis_fpcmpde16shl (v4hi, v4hi, int);
  244. long __builtin_vis_fpcmpde32shl (v2si, v2si, int);
  245. long __builtin_vis_fpcmpur8shl (v8qi, v8qi, int);
  246. long __builtin_vis_fpcmpur16shl (v4hi, v4hi, int);
  247. long __builtin_vis_fpcmpur32shl (v2si, v2si, int);
  248. </pre></div>
  249. <hr>
  250. <div class="header">
  251. <p>
  252. Next: <a href="TI-C6X-Built_002din-Functions.html#TI-C6X-Built_002din-Functions" accesskey="n" rel="next">TI C6X Built-in Functions</a>, Previous: <a href="SH-Built_002din-Functions.html#SH-Built_002din-Functions" accesskey="p" rel="prev">SH Built-in Functions</a>, Up: <a href="Target-Builtins.html#Target-Builtins" accesskey="u" rel="up">Target Builtins</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>
  253. </div>
  254. </body>
  255. </html>