Paired_002dSingle-Built_002din-Functions.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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>Using the GNU Compiler Collection (GCC): Paired-Single Built-in Functions</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): Paired-Single Built-in Functions">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): Paired-Single Built-in Functions">
  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="MIPS-Loongson-Built_002din-Functions.html#MIPS-Loongson-Built_002din-Functions" rel="up" title="MIPS Loongson Built-in Functions">
  30. <link href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions" rel="next" title="MIPS-3D Built-in Functions">
  31. <link href="Paired_002dSingle-Arithmetic.html#Paired_002dSingle-Arithmetic" rel="prev" title="Paired-Single Arithmetic">
  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="Paired_002dSingle-Built_002din-Functions"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions" accesskey="n" rel="next">MIPS-3D Built-in Functions</a>, Previous: <a href="Paired_002dSingle-Arithmetic.html#Paired_002dSingle-Arithmetic" accesskey="p" rel="prev">Paired-Single Arithmetic</a>, Up: <a href="MIPS-Loongson-Built_002din-Functions.html#MIPS-Loongson-Built_002din-Functions" accesskey="u" rel="up">MIPS Loongson Built-in Functions</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="Paired_002dSingle-Built_002din-Functions-1"></a>
  69. <h4 class="subsubsection">6.60.15.2 Paired-Single Built-in Functions</h4>
  70. <p>The following paired-single functions map directly to a particular
  71. MIPS instruction. Please refer to the architecture specification
  72. for details on what each instruction does.
  73. </p>
  74. <dl compact="compact">
  75. <dt><code>v2sf __builtin_mips_pll_ps (v2sf, v2sf)</code></dt>
  76. <dd><p>Pair lower lower (<code>pll.ps</code>).
  77. </p>
  78. </dd>
  79. <dt><code>v2sf __builtin_mips_pul_ps (v2sf, v2sf)</code></dt>
  80. <dd><p>Pair upper lower (<code>pul.ps</code>).
  81. </p>
  82. </dd>
  83. <dt><code>v2sf __builtin_mips_plu_ps (v2sf, v2sf)</code></dt>
  84. <dd><p>Pair lower upper (<code>plu.ps</code>).
  85. </p>
  86. </dd>
  87. <dt><code>v2sf __builtin_mips_puu_ps (v2sf, v2sf)</code></dt>
  88. <dd><p>Pair upper upper (<code>puu.ps</code>).
  89. </p>
  90. </dd>
  91. <dt><code>v2sf __builtin_mips_cvt_ps_s (float, float)</code></dt>
  92. <dd><p>Convert pair to paired single (<code>cvt.ps.s</code>).
  93. </p>
  94. </dd>
  95. <dt><code>float __builtin_mips_cvt_s_pl (v2sf)</code></dt>
  96. <dd><p>Convert pair lower to single (<code>cvt.s.pl</code>).
  97. </p>
  98. </dd>
  99. <dt><code>float __builtin_mips_cvt_s_pu (v2sf)</code></dt>
  100. <dd><p>Convert pair upper to single (<code>cvt.s.pu</code>).
  101. </p>
  102. </dd>
  103. <dt><code>v2sf __builtin_mips_abs_ps (v2sf)</code></dt>
  104. <dd><p>Absolute value (<code>abs.ps</code>).
  105. </p>
  106. </dd>
  107. <dt><code>v2sf __builtin_mips_alnv_ps (v2sf, v2sf, int)</code></dt>
  108. <dd><p>Align variable (<code>alnv.ps</code>).
  109. </p>
  110. <p><em>Note:</em> The value of the third parameter must be 0 or 4
  111. modulo 8, otherwise the result is unpredictable. Please read the
  112. instruction description for details.
  113. </p></dd>
  114. </dl>
  115. <p>The following multi-instruction functions are also available.
  116. In each case, <var>cond</var> can be any of the 16 floating-point conditions:
  117. <code>f</code>, <code>un</code>, <code>eq</code>, <code>ueq</code>, <code>olt</code>, <code>ult</code>,
  118. <code>ole</code>, <code>ule</code>, <code>sf</code>, <code>ngle</code>, <code>seq</code>, <code>ngl</code>,
  119. <code>lt</code>, <code>nge</code>, <code>le</code> or <code>ngt</code>.
  120. </p>
  121. <dl compact="compact">
  122. <dt><code>v2sf __builtin_mips_movt_c_<var>cond</var>_ps (v2sf <var>a</var>, v2sf <var>b</var>, v2sf <var>c</var>, v2sf <var>d</var>)</code></dt>
  123. <dt><code>v2sf __builtin_mips_movf_c_<var>cond</var>_ps (v2sf <var>a</var>, v2sf <var>b</var>, v2sf <var>c</var>, v2sf <var>d</var>)</code></dt>
  124. <dd><p>Conditional move based on floating-point comparison (<code>c.<var>cond</var>.ps</code>,
  125. <code>movt.ps</code>/<code>movf.ps</code>).
  126. </p>
  127. <p>The <code>movt</code> functions return the value <var>x</var> computed by:
  128. </p>
  129. <div class="smallexample">
  130. <pre class="smallexample">c.<var>cond</var>.ps <var>cc</var>,<var>a</var>,<var>b</var>
  131. mov.ps <var>x</var>,<var>c</var>
  132. movt.ps <var>x</var>,<var>d</var>,<var>cc</var>
  133. </pre></div>
  134. <p>The <code>movf</code> functions are similar but use <code>movf.ps</code> instead
  135. of <code>movt.ps</code>.
  136. </p>
  137. </dd>
  138. <dt><code>int __builtin_mips_upper_c_<var>cond</var>_ps (v2sf <var>a</var>, v2sf <var>b</var>)</code></dt>
  139. <dt><code>int __builtin_mips_lower_c_<var>cond</var>_ps (v2sf <var>a</var>, v2sf <var>b</var>)</code></dt>
  140. <dd><p>Comparison of two paired-single values (<code>c.<var>cond</var>.ps</code>,
  141. <code>bc1t</code>/<code>bc1f</code>).
  142. </p>
  143. <p>These functions compare <var>a</var> and <var>b</var> using <code>c.<var>cond</var>.ps</code>
  144. and return either the upper or lower half of the result. For example:
  145. </p>
  146. <div class="smallexample">
  147. <pre class="smallexample">v2sf a, b;
  148. if (__builtin_mips_upper_c_eq_ps (a, b))
  149. upper_halves_are_equal ();
  150. else
  151. upper_halves_are_unequal ();
  152. if (__builtin_mips_lower_c_eq_ps (a, b))
  153. lower_halves_are_equal ();
  154. else
  155. lower_halves_are_unequal ();
  156. </pre></div>
  157. </dd>
  158. </dl>
  159. <hr>
  160. <div class="header">
  161. <p>
  162. Next: <a href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions" accesskey="n" rel="next">MIPS-3D Built-in Functions</a>, Previous: <a href="Paired_002dSingle-Arithmetic.html#Paired_002dSingle-Arithmetic" accesskey="p" rel="prev">Paired-Single Arithmetic</a>, Up: <a href="MIPS-Loongson-Built_002din-Functions.html#MIPS-Loongson-Built_002din-Functions" accesskey="u" rel="up">MIPS Loongson Built-in Functions</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>
  163. </div>
  164. </body>
  165. </html>