summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html
new repository
Diffstat (limited to 'devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html')
-rw-r--r--devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html b/devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html
new file mode 100644
index 00000000..304d8f8b
--- /dev/null
+++ b/devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-2_002e05.html
@@ -0,0 +1,37 @@
+<div class="subsubsection-level-extent" id="Basic-PowerPC-Built-in-Functions-Available-on-ISA-2_002e05"> <div class="nav-panel"> <p> Next: <a href="basic-powerpc-built-in-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-in-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-in-functions" accesskey="u" rel="up">Basic PowerPC Built-in Functions</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="subsubsection" id="Basic-PowerPC-Built-in-Functions-Available-on-ISA-2_002e05-1"><span>6.60.22.2 Basic PowerPC Built-in Functions Available on ISA 2.05<a class="copiable-link" href="#Basic-PowerPC-Built-in-Functions-Available-on-ISA-2_002e05-1"> ΒΆ</a></span></h1> <p>The basic built-in functions described in this section are available on the PowerPC family of processors starting with ISA 2.05 or later. Unless specific options are explicitly disabled on the command line, specifying option <samp class="option">-mcpu=power6</samp> has the effect of enabling the <samp class="option">-mpowerpc64</samp>, <samp class="option">-mpowerpc-gpopt</samp>, <samp class="option">-mpowerpc-gfxopt</samp>, <samp class="option">-mmfcrf</samp>, <samp class="option">-mpopcntb</samp>, <samp class="option">-mfprnd</samp>, <samp class="option">-mcmpb</samp>, <samp class="option">-mhard-dfp</samp>, and <samp class="option">-mrecip-precision</samp> options. Specify the <samp class="option">-maltivec</samp> option explicitly in combination with the above options if desired. </p> <p>The following functions require option <samp class="option">-mcmpb</samp>. </p>
+<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">unsigned long long __builtin_cmpb (unsigned long long int, unsigned long long int);
+unsigned int __builtin_cmpb (unsigned int, unsigned int);</pre>
+</div> <p>The <code class="code">__builtin_cmpb</code> function performs a byte-wise compare on the contents of its two arguments, returning the result of the byte-wise comparison as the returned value. For each byte comparison, the corresponding byte of the return value holds 0xff if the input bytes are equal and 0 if the input bytes are not equal. If either of the arguments to this built-in function is wider than 32 bits, the function call expands into the form that expects <code class="code">unsigned long long int</code> arguments which is only available on 64-bit targets. </p> <p>The following built-in functions are available when hardware decimal floating point (<samp class="option">-mhard-dfp</samp>) is available: </p>
+<div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">void __builtin_set_fpscr_drn(int);
+_Decimal64 __builtin_ddedpd (int, _Decimal64);
+_Decimal128 __builtin_ddedpdq (int, _Decimal128);
+_Decimal64 __builtin_denbcd (int, _Decimal64);
+_Decimal128 __builtin_denbcdq (int, _Decimal128);
+_Decimal64 __builtin_diex (long long, _Decimal64);
+_Decimal128 _builtin_diexq (long long, _Decimal128);
+_Decimal64 __builtin_dscli (_Decimal64, int);
+_Decimal128 __builtin_dscliq (_Decimal128, int);
+_Decimal64 __builtin_dscri (_Decimal64, int);
+_Decimal128 __builtin_dscriq (_Decimal128, int);
+long long __builtin_dxex (_Decimal64);
+long long __builtin_dxexq (_Decimal128);
+_Decimal128 __builtin_pack_dec128 (unsigned long long, unsigned long long);
+unsigned long long __builtin_unpack_dec128 (_Decimal128, int);
+
+The <code class="code">__builtin_set_fpscr_drn</code> builtin allows changing the three decimal
+floating point rounding mode bits. The argument is a 3-bit value. The
+argument can either be a <code class="code">const int</code> or the value can be stored in
+a variable.
+The builtin uses the ISA 3.0 instruction <code class="code">mffscdrn</code> if available.
+Otherwise the builtin reads the FPSCR, masks the current decimal rounding
+mode bits out and OR's in the new value.</pre>
+</div> <p>The following functions require <samp class="option">-mhard-float</samp>, <samp class="option">-mpowerpc-gfxopt</samp>, and <samp class="option">-mpopcntb</samp> options. </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">double __builtin_recipdiv (double, double);
+float __builtin_recipdivf (float, float);
+double __builtin_rsqrt (double);
+float __builtin_rsqrtf (float);</pre>
+</div> <p>The <code class="code">vec_rsqrt</code>, <code class="code">__builtin_rsqrt</code>, and <code class="code">__builtin_rsqrtf</code> functions generate multiple instructions to implement the reciprocal sqrt functionality using reciprocal sqrt estimate instructions. </p> <p>The <code class="code">__builtin_recipdiv</code>, and <code class="code">__builtin_recipdivf</code> functions generate multiple instructions to implement division using the reciprocal estimate instructions. </p> <p>The following functions require <samp class="option">-mhard-float</samp> and <samp class="option">-mmultiple</samp> options. </p> <p>The <code class="code">__builtin_unpack_longdouble</code> function takes a <code class="code">long double</code> argument and a compile time constant of 0 or 1. If the constant is 0, the first <code class="code">double</code> within the <code class="code">long double</code> is returned, otherwise the second <code class="code">double</code> is returned. The <code class="code">__builtin_unpack_longdouble</code> function is only available if <code class="code">long double</code> uses the IBM extended double representation. </p> <p>The <code class="code">__builtin_pack_longdouble</code> function takes two <code class="code">double</code> arguments and returns a <code class="code">long double</code> value that combines the two arguments. The <code class="code">__builtin_pack_longdouble</code> function is only available if <code class="code">long double</code> uses the IBM extended double representation. </p> <p>The <code class="code">__builtin_unpack_ibm128</code> function takes a <code class="code">__ibm128</code> argument and a compile time constant of 0 or 1. If the constant is 0, the first <code class="code">double</code> within the <code class="code">__ibm128</code> is returned, otherwise the second <code class="code">double</code> is returned. </p> <p>The <code class="code">__builtin_pack_ibm128</code> function takes two <code class="code">double</code> arguments and returns a <code class="code">__ibm128</code> value that combines the two arguments. </p> <p>Additional built-in functions are available for the 64-bit PowerPC family of processors, for efficient use of 128-bit floating point (<code class="code">__float128</code>) values. </p> </div> <div class="nav-panel"> <p> Next: <a href="basic-powerpc-built-in-functions-available-on-isa-2_002e06">Basic PowerPC Built-in Functions Available on ISA 2.06</a>, Previous: <a href="basic-powerpc-built-in-functions-available-on-all-configurations">Basic PowerPC Built-in Functions Available on all Configurations</a>, Up: <a href="basic-powerpc-built-in-functions">Basic PowerPC Built-in Functions</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
+ <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Basic-PowerPC-Built-in-Functions-Available-on-ISA-2_002e05.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Basic-PowerPC-Built-in-Functions-Available-on-ISA-2_002e05.html</a>
+ </p>
+</div>