summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/basic-powerpc-built-in-functions-available-on-isa-3_002e0.html
blob: be24800b2aedc00f5c8fb244e6466d8b7ce3ad76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<div class="subsubsection-level-extent" id="Basic-PowerPC-Built-in-Functions-Available-on-ISA-3_002e0"> <div class="nav-panel"> <p> Next: <a href="basic-powerpc-built-in-functions-available-on-isa-3_002e1" accesskey="n" rel="next">Basic PowerPC Built-in Functions Available on ISA 3.1</a>, Previous: <a href="basic-powerpc-built-in-functions-available-on-isa-2_002e07" accesskey="p" rel="prev">Basic PowerPC Built-in Functions Available on ISA 2.07</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-3_002e0-1"><span>6.60.22.5 Basic PowerPC Built-in Functions Available on ISA 3.0<a class="copiable-link" href="#Basic-PowerPC-Built-in-Functions-Available-on-ISA-3_002e0-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 3.0 or later. Unless specific options are explicitly disabled on the command line, specifying option <samp class="option">-mcpu=power9</samp> has the effect of enabling all the same options as for <samp class="option">-mcpu=power8</samp> in addition to the <samp class="option">-misel</samp> option. </p> <p>The following built-in functions are available on Linux 64-bit systems that use the ISA 3.0 instruction set (<samp class="option">-mcpu=power9</samp>): </p> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005faddf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">__float128</code> <strong class="def-name">__builtin_addf128_round_to_odd</strong> <code class="def-code-arguments">(__float128, __float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005faddf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Perform a 128-bit IEEE floating point add using round to odd as the rounding mode. </p></dd>
</dl> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005fsubf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">__float128</code> <strong class="def-name">__builtin_subf128_round_to_odd</strong> <code class="def-code-arguments">(__float128, __float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005fsubf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Perform a 128-bit IEEE floating point subtract using round to odd as the rounding mode. </p></dd>
</dl> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005fmulf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">__float128</code> <strong class="def-name">__builtin_mulf128_round_to_odd</strong> <code class="def-code-arguments">(__float128, __float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005fmulf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Perform a 128-bit IEEE floating point multiply using round to odd as the rounding mode. </p></dd>
</dl> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005fdivf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">__float128</code> <strong class="def-name">__builtin_divf128_round_to_odd</strong> <code class="def-code-arguments">(__float128, __float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005fdivf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Perform a 128-bit IEEE floating point divide using round to odd as the rounding mode. </p></dd>
</dl> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005fsqrtf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">__float128</code> <strong class="def-name">__builtin_sqrtf128_round_to_odd</strong> <code class="def-code-arguments">(__float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005fsqrtf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Perform a 128-bit IEEE floating point square root using round to odd as the rounding mode. </p></dd>
</dl> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005ffmaf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">__float128</code> <strong class="def-name">__builtin_fmaf128_round_to_odd</strong> <code class="def-code-arguments">(__float128, __float128, __float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005ffmaf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Perform a 128-bit IEEE floating point fused multiply and add operation using round to odd as the rounding mode. </p></dd>
</dl> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-_005f_005fbuiltin_005ftruncf128_005fround_005fto_005fodd">
<span class="category-def">Built-in Function: </span><span><code class="def-type">double</code> <strong class="def-name">__builtin_truncf128_round_to_odd</strong> <code class="def-code-arguments">(__float128)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005ftruncf128_005fround_005fto_005fodd"> ¶</a></span>
</dt> <dd><p>Convert a 128-bit IEEE floating point value to <code class="code">double</code> using round to odd as the rounding mode. </p></dd>
</dl> <p>The following additional built-in functions are also available for the PowerPC family of processors, starting with ISA 3.0 or later: </p> <dl class="first-deftypefn"> <dt class="deftypefn" id="index-long">
<span class="category-def">Built-in Function: </span><span><code class="def-type">long</code> <strong class="def-name">long</strong> <code class="def-code-arguments">__builtin_darn (void)</code><a class="copiable-link" href="#index-long"> ¶</a></span>
</dt> <dt class="deftypefnx def-cmd-deftypefn" id="index-long-1">
<span class="category-def">Built-in Function: </span><span><code class="def-type">long</code> <strong class="def-name">long</strong> <code class="def-code-arguments">__builtin_darn_raw (void)</code><a class="copiable-link" href="#index-long-1"> ¶</a></span>
</dt> <dt class="deftypefnx def-cmd-deftypefn" id="index-_005f_005fbuiltin_005fdarn_005f32">
<span class="category-def">Built-in Function: </span><span><code class="def-type">int</code> <strong class="def-name">__builtin_darn_32</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-_005f_005fbuiltin_005fdarn_005f32"> ¶</a></span>
</dt> <dd><p>The <code class="code">__builtin_darn</code> and <code class="code">__builtin_darn_raw</code> functions require a 64-bit environment supporting ISA 3.0 or later. The <code class="code">__builtin_darn</code> function provides a 64-bit conditioned random number. The <code class="code">__builtin_darn_raw</code> function provides a 64-bit raw random number. The <code class="code">__builtin_darn_32</code> function provides a 32-bit conditioned random number. </p></dd>
</dl> <p>The following additional built-in functions are also available for the PowerPC family of processors, starting with ISA 3.0 or later: </p> <div class="example smallexample"> <pre class="example-preformatted" data-language="cpp">int __builtin_byte_in_set (unsigned char u, unsigned long long set);
int __builtin_byte_in_range (unsigned char u, unsigned int range);
int __builtin_byte_in_either_range (unsigned char u, unsigned int ranges);

int __builtin_dfp_dtstsfi_lt (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_lt (unsigned int comparison, _Decimal128 value);
int __builtin_dfp_dtstsfi_lt_dd (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_lt_td (unsigned int comparison, _Decimal128 value);

int __builtin_dfp_dtstsfi_gt (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_gt (unsigned int comparison, _Decimal128 value);
int __builtin_dfp_dtstsfi_gt_dd (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_gt_td (unsigned int comparison, _Decimal128 value);

int __builtin_dfp_dtstsfi_eq (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_eq (unsigned int comparison, _Decimal128 value);
int __builtin_dfp_dtstsfi_eq_dd (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_eq_td (unsigned int comparison, _Decimal128 value);

int __builtin_dfp_dtstsfi_ov (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_ov (unsigned int comparison, _Decimal128 value);
int __builtin_dfp_dtstsfi_ov_dd (unsigned int comparison, _Decimal64 value);
int __builtin_dfp_dtstsfi_ov_td (unsigned int comparison, _Decimal128 value);

double __builtin_mffsl(void);</pre>
</div> <p>The <code class="code">__builtin_byte_in_set</code> function requires a 64-bit environment supporting ISA 3.0 or later. This function returns a non-zero value if and only if its <code class="code">u</code> argument exactly equals one of the eight bytes contained within its 64-bit <code class="code">set</code> argument. </p> <p>The <code class="code">__builtin_byte_in_range</code> and <code class="code">__builtin_byte_in_either_range</code> require an environment supporting ISA 3.0 or later. For these two functions, the <code class="code">range</code> argument is encoded as 4 bytes, organized as <code class="code">hi_1:lo_1:hi_2:lo_2</code>. The <code class="code">__builtin_byte_in_range</code> function returns a non-zero value if and only if its <code class="code">u</code> argument is within the range bounded between <code class="code">lo_2</code> and <code class="code">hi_2</code> inclusive. The <code class="code">__builtin_byte_in_either_range</code> function returns non-zero if and only if its <code class="code">u</code> argument is within either the range bounded between <code class="code">lo_1</code> and <code class="code">hi_1</code> inclusive or the range bounded between <code class="code">lo_2</code> and <code class="code">hi_2</code> inclusive. </p> <p>The <code class="code">__builtin_dfp_dtstsfi_lt</code> function returns a non-zero value if and only if the number of signficant digits of its <code class="code">value</code> argument is less than its <code class="code">comparison</code> argument. The <code class="code">__builtin_dfp_dtstsfi_lt_dd</code> and <code class="code">__builtin_dfp_dtstsfi_lt_td</code> functions behave similarly, but require that the type of the <code class="code">value</code> argument be <code class="code">__Decimal64</code> and <code class="code">__Decimal128</code> respectively. </p> <p>The <code class="code">__builtin_dfp_dtstsfi_gt</code> function returns a non-zero value if and only if the number of signficant digits of its <code class="code">value</code> argument is greater than its <code class="code">comparison</code> argument. The <code class="code">__builtin_dfp_dtstsfi_gt_dd</code> and <code class="code">__builtin_dfp_dtstsfi_gt_td</code> functions behave similarly, but require that the type of the <code class="code">value</code> argument be <code class="code">__Decimal64</code> and <code class="code">__Decimal128</code> respectively. </p> <p>The <code class="code">__builtin_dfp_dtstsfi_eq</code> function returns a non-zero value if and only if the number of signficant digits of its <code class="code">value</code> argument equals its <code class="code">comparison</code> argument. The <code class="code">__builtin_dfp_dtstsfi_eq_dd</code> and <code class="code">__builtin_dfp_dtstsfi_eq_td</code> functions behave similarly, but require that the type of the <code class="code">value</code> argument be <code class="code">__Decimal64</code> and <code class="code">__Decimal128</code> respectively. </p> <p>The <code class="code">__builtin_dfp_dtstsfi_ov</code> function returns a non-zero value if and only if its <code class="code">value</code> argument has an undefined number of significant digits, such as when <code class="code">value</code> is an encoding of <code class="code">NaN</code>. The <code class="code">__builtin_dfp_dtstsfi_ov_dd</code> and <code class="code">__builtin_dfp_dtstsfi_ov_td</code> functions behave similarly, but require that the type of the <code class="code">value</code> argument be <code class="code">__Decimal64</code> and <code class="code">__Decimal128</code> respectively. </p> <p>The <code class="code">__builtin_mffsl</code> uses the ISA 3.0 <code class="code">mffsl</code> instruction to read the FPSCR. The instruction is a lower latency version of the <code class="code">mffs</code> instruction. If the <code class="code">mffsl</code> instruction is not available, then the builtin uses the older <code class="code">mffs</code> instruction to read the FPSCR. </p> </div>  <div class="nav-panel"> <p> Next: <a href="basic-powerpc-built-in-functions-available-on-isa-3_002e1">Basic PowerPC Built-in Functions Available on ISA 3.1</a>, Previous: <a href="basic-powerpc-built-in-functions-available-on-isa-2_002e07">Basic PowerPC Built-in Functions Available on ISA 2.07</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-3_002e0.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Basic-PowerPC-Built-in-Functions-Available-on-ISA-3_002e0.html</a>
  </p>
</div>