toolchain/share/doc/as.html/TIC54X_002dBuiltins.html

121 lines
8.7 KiB
HTML
Raw Permalink Normal View History

2024-01-10 05:24:32 +00:00
<html lang="en">
<head>
<title>TIC54X-Builtins - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="TIC54X_002dDependent.html#TIC54X_002dDependent" title="TIC54X-Dependent">
<link rel="prev" href="TIC54X_002dLocals.html#TIC54X_002dLocals" title="TIC54X-Locals">
<link rel="next" href="TIC54X_002dExt.html#TIC54X_002dExt" title="TIC54X-Ext">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="TIC54X-Builtins"></a>
<a name="TIC54X_002dBuiltins"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="TIC54X_002dExt.html#TIC54X_002dExt">TIC54X-Ext</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="TIC54X_002dLocals.html#TIC54X_002dLocals">TIC54X-Locals</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="TIC54X_002dDependent.html#TIC54X_002dDependent">TIC54X-Dependent</a>
<hr>
</div>
<h4 class="subsection">9.45.7 Math Builtins</h4>
<p><a name="index-math-builtins_002c-TIC54X-2210"></a><a name="index-TIC54X-builtin-math-functions-2211"></a><a name="index-builtin-math-functions_002c-TIC54X-2212"></a>
The following built-in functions may be used to generate a
floating-point value. All return a floating-point value except
&lsquo;<samp><span class="samp">$cvi</span></samp>&rsquo;, &lsquo;<samp><span class="samp">$int</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">$sgn</span></samp>&rsquo;, which return an integer
value.
<a name="index-g_t_0040code_007b_0024acos_007d-math-builtin_002c-TIC54X-2213"></a>
<dl><dt><code>$acos(</code><var>expr</var><code>)</code><dd>Returns the floating point arccosine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024asin_007d-math-builtin_002c-TIC54X-2214"></a><br><dt><code>$asin(</code><var>expr</var><code>)</code><dd>Returns the floating point arcsine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024atan_007d-math-builtin_002c-TIC54X-2215"></a><br><dt><code>$atan(</code><var>expr</var><code>)</code><dd>Returns the floating point arctangent of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024atan2_007d-math-builtin_002c-TIC54X-2216"></a><br><dt><code>$atan2(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point arctangent of <var>expr1</var> / <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024ceil_007d-math-builtin_002c-TIC54X-2217"></a><br><dt><code>$ceil(</code><var>expr</var><code>)</code><dd>Returns the smallest integer not less than <var>expr</var> as floating point.
<p><a name="index-g_t_0040code_007b_0024cosh_007d-math-builtin_002c-TIC54X-2218"></a><br><dt><code>$cosh(</code><var>expr</var><code>)</code><dd>Returns the floating point hyperbolic cosine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024cos_007d-math-builtin_002c-TIC54X-2219"></a><br><dt><code>$cos(</code><var>expr</var><code>)</code><dd>Returns the floating point cosine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024cvf_007d-math-builtin_002c-TIC54X-2220"></a><br><dt><code>$cvf(</code><var>expr</var><code>)</code><dd>Returns the integer value <var>expr</var> converted to floating-point.
<p><a name="index-g_t_0040code_007b_0024cvi_007d-math-builtin_002c-TIC54X-2221"></a><br><dt><code>$cvi(</code><var>expr</var><code>)</code><dd>Returns the floating point value <var>expr</var> converted to integer.
<p><a name="index-g_t_0040code_007b_0024exp_007d-math-builtin_002c-TIC54X-2222"></a><br><dt><code>$exp(</code><var>expr</var><code>)</code><dd>Returns the floating point value e ^ <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024fabs_007d-math-builtin_002c-TIC54X-2223"></a><br><dt><code>$fabs(</code><var>expr</var><code>)</code><dd>Returns the floating point absolute value of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024floor_007d-math-builtin_002c-TIC54X-2224"></a><br><dt><code>$floor(</code><var>expr</var><code>)</code><dd>Returns the largest integer that is not greater than <var>expr</var> as
floating point.
<p><a name="index-g_t_0040code_007b_0024fmod_007d-math-builtin_002c-TIC54X-2225"></a><br><dt><code>$fmod(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point remainder of <var>expr1</var> / <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024int_007d-math-builtin_002c-TIC54X-2226"></a><br><dt><code>$int(</code><var>expr</var><code>)</code><dd>Returns 1 if <var>expr</var> evaluates to an integer, zero otherwise.
<p><a name="index-g_t_0040code_007b_0024ldexp_007d-math-builtin_002c-TIC54X-2227"></a><br><dt><code>$ldexp(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point value <var>expr1</var> * 2 ^ <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024log10_007d-math-builtin_002c-TIC54X-2228"></a><br><dt><code>$log10(</code><var>expr</var><code>)</code><dd>Returns the base 10 logarithm of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024log_007d-math-builtin_002c-TIC54X-2229"></a><br><dt><code>$log(</code><var>expr</var><code>)</code><dd>Returns the natural logarithm of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024max_007d-math-builtin_002c-TIC54X-2230"></a><br><dt><code>$max(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point maximum of <var>expr1</var> and <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024min_007d-math-builtin_002c-TIC54X-2231"></a><br><dt><code>$min(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point minimum of <var>expr1</var> and <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024pow_007d-math-builtin_002c-TIC54X-2232"></a><br><dt><code>$pow(</code><var>expr1</var><code>,</code><var>expr2</var><code>)</code><dd>Returns the floating point value <var>expr1</var> ^ <var>expr2</var>.
<p><a name="index-g_t_0040code_007b_0024round_007d-math-builtin_002c-TIC54X-2233"></a><br><dt><code>$round(</code><var>expr</var><code>)</code><dd>Returns the nearest integer to <var>expr</var> as a floating point number.
<p><a name="index-g_t_0040code_007b_0024sgn_007d-math-builtin_002c-TIC54X-2234"></a><br><dt><code>$sgn(</code><var>expr</var><code>)</code><dd>Returns -1, 0, or 1 based on the sign of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024sin_007d-math-builtin_002c-TIC54X-2235"></a><br><dt><code>$sin(</code><var>expr</var><code>)</code><dd>Returns the floating point sine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024sinh_007d-math-builtin_002c-TIC54X-2236"></a><br><dt><code>$sinh(</code><var>expr</var><code>)</code><dd>Returns the floating point hyperbolic sine of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024sqrt_007d-math-builtin_002c-TIC54X-2237"></a><br><dt><code>$sqrt(</code><var>expr</var><code>)</code><dd>Returns the floating point square root of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024tan_007d-math-builtin_002c-TIC54X-2238"></a><br><dt><code>$tan(</code><var>expr</var><code>)</code><dd>Returns the floating point tangent of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024tanh_007d-math-builtin_002c-TIC54X-2239"></a><br><dt><code>$tanh(</code><var>expr</var><code>)</code><dd>Returns the floating point hyperbolic tangent of <var>expr</var>.
<p><a name="index-g_t_0040code_007b_0024trunc_007d-math-builtin_002c-TIC54X-2240"></a><br><dt><code>$trunc(</code><var>expr</var><code>)</code><dd>Returns the integer value of <var>expr</var> truncated towards zero as
floating point.
</dl>
</body></html>