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.

221 lines
11KB

  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>MIPS Loongson Built-in Functions (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="MIPS Loongson Built-in Functions (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="MIPS Loongson 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="Paired_002dSingle-Arithmetic.html#Paired_002dSingle-Arithmetic" rel="next" title="Paired-Single Arithmetic">
  31. <link href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support" rel="prev" title="MIPS Paired-Single Support">
  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="MIPS-Loongson-Built_002din-Functions"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="MIPS-SIMD-Architecture-_0028MSA_0029-Support.html#MIPS-SIMD-Architecture-_0028MSA_0029-Support" accesskey="n" rel="next">MIPS SIMD Architecture (MSA) Support</a>, Previous: <a href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support" accesskey="p" rel="prev">MIPS Paired-Single Support</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="MIPS-Loongson-Built_002din-Functions-1"></a>
  68. <h4 class="subsection">6.60.16 MIPS Loongson Built-in Functions</h4>
  69. <p>GCC provides intrinsics to access the SIMD instructions provided by the
  70. ST Microelectronics Loongson-2E and -2F processors. These intrinsics,
  71. available after inclusion of the <code>loongson.h</code> header file,
  72. operate on the following 64-bit vector types:
  73. </p>
  74. <ul>
  75. <li> <code>uint8x8_t</code>, a vector of eight unsigned 8-bit integers;
  76. </li><li> <code>uint16x4_t</code>, a vector of four unsigned 16-bit integers;
  77. </li><li> <code>uint32x2_t</code>, a vector of two unsigned 32-bit integers;
  78. </li><li> <code>int8x8_t</code>, a vector of eight signed 8-bit integers;
  79. </li><li> <code>int16x4_t</code>, a vector of four signed 16-bit integers;
  80. </li><li> <code>int32x2_t</code>, a vector of two signed 32-bit integers.
  81. </li></ul>
  82. <p>The intrinsics provided are listed below; each is named after the
  83. machine instruction to which it corresponds, with suffixes added as
  84. appropriate to distinguish intrinsics that expand to the same machine
  85. instruction yet have different argument types. Refer to the architecture
  86. documentation for a description of the functionality of each
  87. instruction.
  88. </p>
  89. <div class="smallexample">
  90. <pre class="smallexample">int16x4_t packsswh (int32x2_t s, int32x2_t t);
  91. int8x8_t packsshb (int16x4_t s, int16x4_t t);
  92. uint8x8_t packushb (uint16x4_t s, uint16x4_t t);
  93. uint32x2_t paddw_u (uint32x2_t s, uint32x2_t t);
  94. uint16x4_t paddh_u (uint16x4_t s, uint16x4_t t);
  95. uint8x8_t paddb_u (uint8x8_t s, uint8x8_t t);
  96. int32x2_t paddw_s (int32x2_t s, int32x2_t t);
  97. int16x4_t paddh_s (int16x4_t s, int16x4_t t);
  98. int8x8_t paddb_s (int8x8_t s, int8x8_t t);
  99. uint64_t paddd_u (uint64_t s, uint64_t t);
  100. int64_t paddd_s (int64_t s, int64_t t);
  101. int16x4_t paddsh (int16x4_t s, int16x4_t t);
  102. int8x8_t paddsb (int8x8_t s, int8x8_t t);
  103. uint16x4_t paddush (uint16x4_t s, uint16x4_t t);
  104. uint8x8_t paddusb (uint8x8_t s, uint8x8_t t);
  105. uint64_t pandn_ud (uint64_t s, uint64_t t);
  106. uint32x2_t pandn_uw (uint32x2_t s, uint32x2_t t);
  107. uint16x4_t pandn_uh (uint16x4_t s, uint16x4_t t);
  108. uint8x8_t pandn_ub (uint8x8_t s, uint8x8_t t);
  109. int64_t pandn_sd (int64_t s, int64_t t);
  110. int32x2_t pandn_sw (int32x2_t s, int32x2_t t);
  111. int16x4_t pandn_sh (int16x4_t s, int16x4_t t);
  112. int8x8_t pandn_sb (int8x8_t s, int8x8_t t);
  113. uint16x4_t pavgh (uint16x4_t s, uint16x4_t t);
  114. uint8x8_t pavgb (uint8x8_t s, uint8x8_t t);
  115. uint32x2_t pcmpeqw_u (uint32x2_t s, uint32x2_t t);
  116. uint16x4_t pcmpeqh_u (uint16x4_t s, uint16x4_t t);
  117. uint8x8_t pcmpeqb_u (uint8x8_t s, uint8x8_t t);
  118. int32x2_t pcmpeqw_s (int32x2_t s, int32x2_t t);
  119. int16x4_t pcmpeqh_s (int16x4_t s, int16x4_t t);
  120. int8x8_t pcmpeqb_s (int8x8_t s, int8x8_t t);
  121. uint32x2_t pcmpgtw_u (uint32x2_t s, uint32x2_t t);
  122. uint16x4_t pcmpgth_u (uint16x4_t s, uint16x4_t t);
  123. uint8x8_t pcmpgtb_u (uint8x8_t s, uint8x8_t t);
  124. int32x2_t pcmpgtw_s (int32x2_t s, int32x2_t t);
  125. int16x4_t pcmpgth_s (int16x4_t s, int16x4_t t);
  126. int8x8_t pcmpgtb_s (int8x8_t s, int8x8_t t);
  127. uint16x4_t pextrh_u (uint16x4_t s, int field);
  128. int16x4_t pextrh_s (int16x4_t s, int field);
  129. uint16x4_t pinsrh_0_u (uint16x4_t s, uint16x4_t t);
  130. uint16x4_t pinsrh_1_u (uint16x4_t s, uint16x4_t t);
  131. uint16x4_t pinsrh_2_u (uint16x4_t s, uint16x4_t t);
  132. uint16x4_t pinsrh_3_u (uint16x4_t s, uint16x4_t t);
  133. int16x4_t pinsrh_0_s (int16x4_t s, int16x4_t t);
  134. int16x4_t pinsrh_1_s (int16x4_t s, int16x4_t t);
  135. int16x4_t pinsrh_2_s (int16x4_t s, int16x4_t t);
  136. int16x4_t pinsrh_3_s (int16x4_t s, int16x4_t t);
  137. int32x2_t pmaddhw (int16x4_t s, int16x4_t t);
  138. int16x4_t pmaxsh (int16x4_t s, int16x4_t t);
  139. uint8x8_t pmaxub (uint8x8_t s, uint8x8_t t);
  140. int16x4_t pminsh (int16x4_t s, int16x4_t t);
  141. uint8x8_t pminub (uint8x8_t s, uint8x8_t t);
  142. uint8x8_t pmovmskb_u (uint8x8_t s);
  143. int8x8_t pmovmskb_s (int8x8_t s);
  144. uint16x4_t pmulhuh (uint16x4_t s, uint16x4_t t);
  145. int16x4_t pmulhh (int16x4_t s, int16x4_t t);
  146. int16x4_t pmullh (int16x4_t s, int16x4_t t);
  147. int64_t pmuluw (uint32x2_t s, uint32x2_t t);
  148. uint8x8_t pasubub (uint8x8_t s, uint8x8_t t);
  149. uint16x4_t biadd (uint8x8_t s);
  150. uint16x4_t psadbh (uint8x8_t s, uint8x8_t t);
  151. uint16x4_t pshufh_u (uint16x4_t dest, uint16x4_t s, uint8_t order);
  152. int16x4_t pshufh_s (int16x4_t dest, int16x4_t s, uint8_t order);
  153. uint16x4_t psllh_u (uint16x4_t s, uint8_t amount);
  154. int16x4_t psllh_s (int16x4_t s, uint8_t amount);
  155. uint32x2_t psllw_u (uint32x2_t s, uint8_t amount);
  156. int32x2_t psllw_s (int32x2_t s, uint8_t amount);
  157. uint16x4_t psrlh_u (uint16x4_t s, uint8_t amount);
  158. int16x4_t psrlh_s (int16x4_t s, uint8_t amount);
  159. uint32x2_t psrlw_u (uint32x2_t s, uint8_t amount);
  160. int32x2_t psrlw_s (int32x2_t s, uint8_t amount);
  161. uint16x4_t psrah_u (uint16x4_t s, uint8_t amount);
  162. int16x4_t psrah_s (int16x4_t s, uint8_t amount);
  163. uint32x2_t psraw_u (uint32x2_t s, uint8_t amount);
  164. int32x2_t psraw_s (int32x2_t s, uint8_t amount);
  165. uint32x2_t psubw_u (uint32x2_t s, uint32x2_t t);
  166. uint16x4_t psubh_u (uint16x4_t s, uint16x4_t t);
  167. uint8x8_t psubb_u (uint8x8_t s, uint8x8_t t);
  168. int32x2_t psubw_s (int32x2_t s, int32x2_t t);
  169. int16x4_t psubh_s (int16x4_t s, int16x4_t t);
  170. int8x8_t psubb_s (int8x8_t s, int8x8_t t);
  171. uint64_t psubd_u (uint64_t s, uint64_t t);
  172. int64_t psubd_s (int64_t s, int64_t t);
  173. int16x4_t psubsh (int16x4_t s, int16x4_t t);
  174. int8x8_t psubsb (int8x8_t s, int8x8_t t);
  175. uint16x4_t psubush (uint16x4_t s, uint16x4_t t);
  176. uint8x8_t psubusb (uint8x8_t s, uint8x8_t t);
  177. uint32x2_t punpckhwd_u (uint32x2_t s, uint32x2_t t);
  178. uint16x4_t punpckhhw_u (uint16x4_t s, uint16x4_t t);
  179. uint8x8_t punpckhbh_u (uint8x8_t s, uint8x8_t t);
  180. int32x2_t punpckhwd_s (int32x2_t s, int32x2_t t);
  181. int16x4_t punpckhhw_s (int16x4_t s, int16x4_t t);
  182. int8x8_t punpckhbh_s (int8x8_t s, int8x8_t t);
  183. uint32x2_t punpcklwd_u (uint32x2_t s, uint32x2_t t);
  184. uint16x4_t punpcklhw_u (uint16x4_t s, uint16x4_t t);
  185. uint8x8_t punpcklbh_u (uint8x8_t s, uint8x8_t t);
  186. int32x2_t punpcklwd_s (int32x2_t s, int32x2_t t);
  187. int16x4_t punpcklhw_s (int16x4_t s, int16x4_t t);
  188. int8x8_t punpcklbh_s (int8x8_t s, int8x8_t t);
  189. </pre></div>
  190. <table class="menu" border="0" cellspacing="0">
  191. <tr><td align="left" valign="top">&bull; <a href="Paired_002dSingle-Arithmetic.html#Paired_002dSingle-Arithmetic" accesskey="1">Paired-Single Arithmetic</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
  192. </td></tr>
  193. <tr><td align="left" valign="top">&bull; <a href="Paired_002dSingle-Built_002din-Functions.html#Paired_002dSingle-Built_002din-Functions" accesskey="2">Paired-Single Built-in Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
  194. </td></tr>
  195. <tr><td align="left" valign="top">&bull; <a href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions" accesskey="3">MIPS-3D Built-in Functions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
  196. </td></tr>
  197. </table>
  198. <hr>
  199. <div class="header">
  200. <p>
  201. Next: <a href="MIPS-SIMD-Architecture-_0028MSA_0029-Support.html#MIPS-SIMD-Architecture-_0028MSA_0029-Support" accesskey="n" rel="next">MIPS SIMD Architecture (MSA) Support</a>, Previous: <a href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support" accesskey="p" rel="prev">MIPS Paired-Single Support</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>
  202. </div>
  203. </body>
  204. </html>