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.

Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e05.html 10KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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>Basic PowerPC Built-in Functions Available on ISA 2.05 (Using the GNU Compiler Collection (GCC))</title>
  21. <meta name="description" content="Basic PowerPC Built-in Functions Available on ISA 2.05 (Using the GNU Compiler Collection (GCC))">
  22. <meta name="keywords" content="Basic PowerPC Built-in Functions Available on ISA 2.05 (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="Basic-PowerPC-Built_002din-Functions.html#Basic-PowerPC-Built_002din-Functions" rel="up" title="Basic PowerPC Built-in Functions">
  30. <link href="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06.html#Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06" rel="next" title="Basic PowerPC Built-in Functions Available on ISA 2.06">
  31. <link href="Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations.html#Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations" rel="prev" title="Basic PowerPC Built-in Functions Available on all Configurations">
  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="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e05"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06.html#Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06" accesskey="n" rel="next">Basic PowerPC Built-in Functions Available on ISA 2.06</a>, Previous: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations.html#Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations" accesskey="p" rel="prev">Basic PowerPC Built-in Functions Available on all Configurations</a>, Up: <a href="Basic-PowerPC-Built_002din-Functions.html#Basic-PowerPC-Built_002din-Functions" accesskey="u" rel="up">Basic PowerPC 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>
  65. </div>
  66. <hr>
  67. <a name="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e05-1"></a>
  68. <h4 class="subsubsection">6.60.22.2 Basic PowerPC Built-in Functions Available on ISA 2.05</h4>
  69. <p>The basic built-in functions described in this section are
  70. available on the PowerPC family of processors starting with ISA 2.05
  71. or later. Unless specific options are explicitly disabled on the
  72. command line, specifying option <samp>-mcpu=power6</samp> has the effect of
  73. enabling the <samp>-mpowerpc64</samp>, <samp>-mpowerpc-gpopt</samp>,
  74. <samp>-mpowerpc-gfxopt</samp>, <samp>-mmfcrf</samp>, <samp>-mpopcntb</samp>,
  75. <samp>-mfprnd</samp>, <samp>-mcmpb</samp>, <samp>-mhard-dfp</samp>, and
  76. <samp>-mrecip-precision</samp> options. Specify the
  77. <samp>-maltivec</samp> option explicitly in
  78. combination with the above options if desired.
  79. </p>
  80. <p>The following functions require option <samp>-mcmpb</samp>.
  81. </p><div class="smallexample">
  82. <pre class="smallexample">unsigned long long __builtin_cmpb (unsigned long long int, unsigned long long int);
  83. unsigned int __builtin_cmpb (unsigned int, unsigned int);
  84. </pre></div>
  85. <p>The <code>__builtin_cmpb</code> function
  86. performs a byte-wise compare on the contents of its two arguments,
  87. returning the result of the byte-wise comparison as the returned
  88. value. For each byte comparison, the corresponding byte of the return
  89. value holds 0xff if the input bytes are equal and 0 if the input bytes
  90. are not equal. If either of the arguments to this built-in function
  91. is wider than 32 bits, the function call expands into the form that
  92. expects <code>unsigned long long int</code> arguments
  93. which is only available on 64-bit targets.
  94. </p>
  95. <p>The following built-in functions are available
  96. when hardware decimal floating point
  97. (<samp>-mhard-dfp</samp>) is available:
  98. </p><div class="smallexample">
  99. <pre class="smallexample">void __builtin_set_fpscr_drn(int);
  100. _Decimal64 __builtin_ddedpd (int, _Decimal64);
  101. _Decimal128 __builtin_ddedpdq (int, _Decimal128);
  102. _Decimal64 __builtin_denbcd (int, _Decimal64);
  103. _Decimal128 __builtin_denbcdq (int, _Decimal128);
  104. _Decimal64 __builtin_diex (long long, _Decimal64);
  105. _Decimal128 _builtin_diexq (long long, _Decimal128);
  106. _Decimal64 __builtin_dscli (_Decimal64, int);
  107. _Decimal128 __builtin_dscliq (_Decimal128, int);
  108. _Decimal64 __builtin_dscri (_Decimal64, int);
  109. _Decimal128 __builtin_dscriq (_Decimal128, int);
  110. long long __builtin_dxex (_Decimal64);
  111. long long __builtin_dxexq (_Decimal128);
  112. _Decimal128 __builtin_pack_dec128 (unsigned long long, unsigned long long);
  113. unsigned long long __builtin_unpack_dec128 (_Decimal128, int);
  114. The <code>__builtin_set_fpscr_drn</code> builtin allows changing the three decimal
  115. floating point rounding mode bits. The argument is a 3-bit value. The
  116. argument can either be a <code>const int</code> or the value can be stored in
  117. a variable.
  118. The builtin uses the ISA 3.0 instruction <code>mffscdrn</code> if available.
  119. Otherwise the builtin reads the FPSCR, masks the current decimal rounding
  120. mode bits out and OR's in the new value.
  121. </pre></div>
  122. <p>The following functions require <samp>-mhard-float</samp>,
  123. <samp>-mpowerpc-gfxopt</samp>, and <samp>-mpopcntb</samp> options.
  124. </p>
  125. <div class="smallexample">
  126. <pre class="smallexample">double __builtin_recipdiv (double, double);
  127. float __builtin_recipdivf (float, float);
  128. double __builtin_rsqrt (double);
  129. float __builtin_rsqrtf (float);
  130. </pre></div>
  131. <p>The <code>vec_rsqrt</code>, <code>__builtin_rsqrt</code>, and
  132. <code>__builtin_rsqrtf</code> functions generate multiple instructions to
  133. implement the reciprocal sqrt functionality using reciprocal sqrt
  134. estimate instructions.
  135. </p>
  136. <p>The <code>__builtin_recipdiv</code>, and <code>__builtin_recipdivf</code>
  137. functions generate multiple instructions to implement division using
  138. the reciprocal estimate instructions.
  139. </p>
  140. <p>The following functions require <samp>-mhard-float</samp> and
  141. <samp>-mmultiple</samp> options.
  142. </p>
  143. <p>The <code>__builtin_unpack_longdouble</code> function takes a
  144. <code>long double</code> argument and a compile time constant of 0 or 1. If
  145. the constant is 0, the first <code>double</code> within the
  146. <code>long double</code> is returned, otherwise the second <code>double</code>
  147. is returned. The <code>__builtin_unpack_longdouble</code> function is only
  148. available if <code>long double</code> uses the IBM extended double
  149. representation.
  150. </p>
  151. <p>The <code>__builtin_pack_longdouble</code> function takes two <code>double</code>
  152. arguments and returns a <code>long double</code> value that combines the two
  153. arguments. The <code>__builtin_pack_longdouble</code> function is only
  154. available if <code>long double</code> uses the IBM extended double
  155. representation.
  156. </p>
  157. <p>The <code>__builtin_unpack_ibm128</code> function takes a <code>__ibm128</code>
  158. argument and a compile time constant of 0 or 1. If the constant is 0,
  159. the first <code>double</code> within the <code>__ibm128</code> is returned,
  160. otherwise the second <code>double</code> is returned.
  161. </p>
  162. <p>The <code>__builtin_pack_ibm128</code> function takes two <code>double</code>
  163. arguments and returns a <code>__ibm128</code> value that combines the two
  164. arguments.
  165. </p>
  166. <p>Additional built-in functions are available for the 64-bit PowerPC
  167. family of processors, for efficient use of 128-bit floating point
  168. (<code>__float128</code>) values.
  169. </p>
  170. <hr>
  171. <div class="header">
  172. <p>
  173. Next: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06.html#Basic-PowerPC-Built_002din-Functions-Available-on-ISA-2_002e06" accesskey="n" rel="next">Basic PowerPC Built-in Functions Available on ISA 2.06</a>, Previous: <a href="Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations.html#Basic-PowerPC-Built_002din-Functions-Available-on-all-Configurations" accesskey="p" rel="prev">Basic PowerPC Built-in Functions Available on all Configurations</a>, Up: <a href="Basic-PowerPC-Built_002din-Functions.html#Basic-PowerPC-Built_002din-Functions" accesskey="u" rel="up">Basic PowerPC 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>
  174. </div>
  175. </body>
  176. </html>