Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 1 | # |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2 | # Copyright (C) 2014 The Android Open Source Project |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | header: |
Jean-Luc Brouillet | 20b27d6 | 2015-04-03 14:39:53 -0700 | [diff] [blame] | 18 | summary: Mathematical Constants and Functions |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 19 | description: |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 20 | The mathematical functions below can be applied to scalars and vectors. When applied |
| 21 | to vectors, the returned value is a vector of the function applied to each entry of the input. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 22 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 23 | For example:<code><br/> |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 24 | float3 a, b;<br/> |
| 25 | // The following call sets<br/> |
| 26 | // a.x to sin(b.x),<br/> |
| 27 | // a.y to sin(b.y), and<br/> |
| 28 | // a.z to sin(b.z).<br/> |
| 29 | a = sin(b);<br/> |
| 30 | </code> |
| 31 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 32 | See <a href='rs_vector_math.html'>Vector Math Functions</a> for functions like @distance() and @length() that interpret |
| 33 | instead the input as a single vector in n-dimensional space. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 34 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 35 | The precision of the mathematical operations on 32 bit floats is affected by the pragmas |
| 36 | rs_fp_relaxed and rs_fp_full. Under rs_fp_relaxed, subnormal values may be flushed to zero and |
| 37 | rounding may be done towards zero. In comparison, rs_fp_full requires correct handling of |
| 38 | subnormal values, i.e. smaller than 1.17549435e-38f. rs_fp_rull also requires round to nearest |
| 39 | with ties to even. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 40 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 41 | Different precision/speed tradeoffs can be achieved by using variants of the common math |
| 42 | functions. Functions with a name starting with<ul> |
| 43 | <li>native_: May have custom hardware implementations with weaker precision. Additionally, |
| 44 | subnormal values may be flushed to zero, rounding towards zero may be used, and NaN and |
| 45 | infinity input may not be handled correctly.</li> |
| 46 | <li>half_: May perform internal computations using 16 bit floats. Additionally, subnormal |
| 47 | values may be flushed to zero, and rounding towards zero may be used.</li> |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 48 | </ul> |
| 49 | end: |
| 50 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 51 | # TODO Add f16 versions of these constants. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 52 | constant: M_1_PI |
| 53 | value: 0.318309886183790671537767526745028724f |
| 54 | summary: 1 / pi, as a 32 bit float |
| 55 | description: |
| 56 | The inverse of pi, as a 32 bit float. |
| 57 | end: |
| 58 | |
| 59 | constant: M_2_PI |
| 60 | value: 0.636619772367581343075535053490057448f |
| 61 | summary: 2 / pi, as a 32 bit float |
| 62 | description: |
| 63 | 2 divided by pi, as a 32 bit float. |
| 64 | end: |
| 65 | |
| 66 | constant: M_2_PIl |
| 67 | value: 0.636619772367581343075535053490057448f |
| 68 | hidden: |
Jean-Luc Brouillet | 36e2be5 | 2015-04-30 14:41:24 -0700 | [diff] [blame] | 69 | deprecated: 22, Use M_2_PI instead. |
Jean-Luc Brouillet | 20b27d6 | 2015-04-03 14:39:53 -0700 | [diff] [blame] | 70 | summary: 2 / pi, as a 32 bit float |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 71 | description: |
Jean-Luc Brouillet | 20b27d6 | 2015-04-03 14:39:53 -0700 | [diff] [blame] | 72 | 2 divided by pi, as a 32 bit float. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 73 | end: |
| 74 | |
| 75 | constant: M_2_SQRTPI |
| 76 | value: 1.128379167095512573896158903121545172f |
| 77 | summary: 2 / sqrt(pi), as a 32 bit float |
| 78 | description: |
| 79 | 2 divided by the square root of pi, as a 32 bit float. |
| 80 | end: |
| 81 | |
| 82 | constant: M_E |
| 83 | value: 2.718281828459045235360287471352662498f |
| 84 | summary: e, as a 32 bit float |
| 85 | description: |
| 86 | The number e, the base of the natural logarithm, as a 32 bit float. |
| 87 | end: |
| 88 | |
| 89 | constant: M_LN10 |
| 90 | value: 2.302585092994045684017991454684364208f |
| 91 | summary: log_e(10), as a 32 bit float |
| 92 | description: |
| 93 | The natural logarithm of 10, as a 32 bit float. |
| 94 | end: |
| 95 | |
| 96 | constant: M_LN2 |
| 97 | value: 0.693147180559945309417232121458176568f |
| 98 | summary: log_e(2), as a 32 bit float |
| 99 | description: |
| 100 | The natural logarithm of 2, as a 32 bit float. |
| 101 | end: |
| 102 | |
| 103 | constant: M_LOG10E |
| 104 | value: 0.434294481903251827651128918916605082f |
| 105 | summary: log_10(e), as a 32 bit float |
| 106 | description: |
| 107 | The logarithm base 10 of e, as a 32 bit float. |
| 108 | end: |
| 109 | |
| 110 | constant: M_LOG2E |
| 111 | value: 1.442695040888963407359924681001892137f |
| 112 | summary: log_2(e), as a 32 bit float |
| 113 | description: |
| 114 | The logarithm base 2 of e, as a 32 bit float. |
| 115 | end: |
| 116 | |
| 117 | constant: M_PI |
| 118 | value: 3.141592653589793238462643383279502884f |
| 119 | summary: pi, as a 32 bit float |
| 120 | description: |
| 121 | The constant pi, as a 32 bit float. |
| 122 | end: |
| 123 | |
| 124 | constant: M_PI_2 |
| 125 | value: 1.570796326794896619231321691639751442f |
| 126 | summary: pi / 2, as a 32 bit float |
| 127 | description: |
| 128 | Pi divided by 2, as a 32 bit float. |
| 129 | end: |
| 130 | |
| 131 | constant: M_PI_4 |
| 132 | value: 0.785398163397448309615660845819875721f |
| 133 | summary: pi / 4, as a 32 bit float |
| 134 | description: |
| 135 | Pi divided by 4, as a 32 bit float. |
| 136 | end: |
| 137 | |
| 138 | constant: M_SQRT1_2 |
| 139 | value: 0.707106781186547524400844362104849039f |
| 140 | summary: 1 / sqrt(2), as a 32 bit float |
| 141 | description: |
| 142 | The inverse of the square root of 2, as a 32 bit float. |
| 143 | end: |
| 144 | |
| 145 | constant: M_SQRT2 |
| 146 | value: 1.414213562373095048801688724209698079f |
| 147 | summary: sqrt(2), as a 32 bit float |
| 148 | description: |
| 149 | The square root of 2, as a 32 bit float. |
| 150 | end: |
| 151 | |
| 152 | function: abs |
| 153 | version: 9 |
| 154 | attrib: const |
| 155 | w: 1, 2, 3, 4 |
| 156 | t: i8, i16, i32 |
| 157 | ret: u#2#1 |
| 158 | arg: #2#1 v |
| 159 | summary: Absolute value of an integer |
| 160 | description: |
| 161 | Returns the absolute value of an integer. |
| 162 | |
| 163 | For floats, use @fabs(). |
| 164 | end: |
| 165 | |
| 166 | function: acos |
| 167 | version: 9 |
| 168 | attrib: const |
| 169 | w: 1, 2, 3, 4 |
| 170 | t: f32 |
| 171 | ret: #2#1 |
| 172 | arg: #2#1 v, range(-1,1) |
| 173 | summary: Inverse cosine |
| 174 | description: |
| 175 | Returns the inverse cosine, in radians. |
| 176 | |
| 177 | See also @native_acos(). |
| 178 | end: |
| 179 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 180 | function: acos |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 181 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 182 | attrib: const |
| 183 | w: 1, 2, 3, 4 |
| 184 | t: f16 |
| 185 | ret: #2#1 |
| 186 | arg: #2#1 v |
| 187 | test: none |
| 188 | end: |
| 189 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 190 | function: acosh |
| 191 | version: 9 |
| 192 | attrib: const |
| 193 | w: 1, 2, 3, 4 |
| 194 | t: f32 |
| 195 | ret: #2#1 |
| 196 | arg: #2#1 v |
| 197 | summary: Inverse hyperbolic cosine |
| 198 | description: |
| 199 | Returns the inverse hyperbolic cosine, in radians. |
| 200 | |
| 201 | See also @native_acosh(). |
| 202 | end: |
| 203 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 204 | function: acosh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 205 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 206 | attrib: const |
| 207 | w: 1, 2, 3, 4 |
| 208 | t: f16 |
| 209 | ret: #2#1 |
| 210 | arg: #2#1 v |
| 211 | test: none |
| 212 | end: |
| 213 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 214 | function: acospi |
| 215 | version: 9 |
| 216 | attrib: const |
| 217 | w: 1, 2, 3, 4 |
| 218 | t: f32 |
| 219 | ret: #2#1 |
| 220 | arg: #2#1 v, range(-1,1) |
| 221 | summary: Inverse cosine divided by pi |
| 222 | description: |
| 223 | Returns the inverse cosine in radians, divided by pi. |
| 224 | |
| 225 | To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>. |
| 226 | |
| 227 | See also @native_acospi(). |
| 228 | end: |
| 229 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 230 | function: acospi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 231 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 232 | attrib: const |
| 233 | w: 1, 2, 3, 4 |
| 234 | t: f16 |
| 235 | ret: #2#1 |
| 236 | arg: #2#1 v |
| 237 | test: none |
| 238 | end: |
| 239 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 240 | function: asin |
| 241 | version: 9 |
| 242 | attrib: const |
| 243 | w: 1, 2, 3, 4 |
| 244 | t: f32 |
| 245 | ret: #2#1 |
| 246 | arg: #2#1 v, range(-1,1) |
| 247 | summary: Inverse sine |
| 248 | description: |
| 249 | Returns the inverse sine, in radians. |
| 250 | |
| 251 | See also @native_asin(). |
| 252 | end: |
| 253 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 254 | function: asin |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 255 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 256 | attrib: const |
| 257 | w: 1, 2, 3, 4 |
| 258 | t: f16 |
| 259 | ret: #2#1 |
| 260 | arg: #2#1 v |
| 261 | test: none |
| 262 | end: |
| 263 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 264 | function: asinh |
| 265 | version: 9 |
| 266 | attrib: const |
| 267 | w: 1, 2, 3, 4 |
| 268 | t: f32 |
| 269 | ret: #2#1 |
| 270 | arg: #2#1 v |
| 271 | summary: Inverse hyperbolic sine |
| 272 | description: |
| 273 | Returns the inverse hyperbolic sine, in radians. |
| 274 | |
| 275 | See also @native_asinh(). |
| 276 | end: |
| 277 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 278 | function: asinh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 279 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 280 | attrib: const |
| 281 | w: 1, 2, 3, 4 |
| 282 | t: f16 |
| 283 | ret: #2#1 |
| 284 | arg: #2#1 v |
| 285 | test: none |
| 286 | end: |
| 287 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 288 | function: asinpi |
| 289 | version: 9 |
| 290 | attrib: const |
| 291 | w: 1, 2, 3, 4 |
| 292 | t: f32 |
| 293 | ret: #2#1 |
| 294 | arg: #2#1 v, range(-1,1) |
| 295 | summary: Inverse sine divided by pi |
| 296 | description: |
| 297 | Returns the inverse sine in radians, divided by pi. |
| 298 | |
| 299 | To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>. |
| 300 | |
| 301 | See also @native_asinpi(). |
| 302 | end: |
| 303 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 304 | function: asinpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 305 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 306 | attrib: const |
| 307 | w: 1, 2, 3, 4 |
| 308 | t: f16 |
| 309 | ret: #2#1 |
| 310 | arg: #2#1 v |
| 311 | test: none |
| 312 | end: |
| 313 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 314 | function: atan |
| 315 | version: 9 |
| 316 | attrib: const |
| 317 | w: 1, 2, 3, 4 |
| 318 | t: f32 |
| 319 | ret: #2#1 |
| 320 | arg: #2#1 v, range(-1,1) |
| 321 | summary: Inverse tangent |
| 322 | description: |
| 323 | Returns the inverse tangent, in radians. |
| 324 | |
| 325 | See also @native_atan(). |
| 326 | end: |
| 327 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 328 | function: atan |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 329 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 330 | attrib: const |
| 331 | w: 1, 2, 3, 4 |
| 332 | t: f16 |
| 333 | ret: #2#1 |
| 334 | arg: #2#1 v |
| 335 | test: none |
| 336 | end: |
| 337 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 338 | function: atan2 |
| 339 | version: 9 |
| 340 | attrib: const |
| 341 | w: 1, 2, 3, 4 |
| 342 | t: f32 |
| 343 | ret: #2#1 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 344 | arg: #2#1 numerator, "Numerator." |
| 345 | arg: #2#1 denominator, "Denominator. Can be 0." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 346 | summary: Inverse tangent of a ratio |
| 347 | description: |
| 348 | Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians. |
| 349 | |
| 350 | See also @native_atan2(). |
| 351 | end: |
| 352 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 353 | function: atan2 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 354 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 355 | attrib: const |
| 356 | w: 1, 2, 3, 4 |
| 357 | t: f16 |
| 358 | ret: #2#1 |
| 359 | arg: #2#1 numerator |
| 360 | arg: #2#1 denominator |
| 361 | test: none |
| 362 | end: |
| 363 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 364 | function: atan2pi |
| 365 | version: 9 |
| 366 | attrib: const |
| 367 | w: 1, 2, 3, 4 |
| 368 | t: f32 |
| 369 | ret: #2#1 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 370 | arg: #2#1 numerator, "Numerator." |
| 371 | arg: #2#1 denominator, "Denominator. Can be 0." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 372 | summary: Inverse tangent of a ratio, divided by pi |
| 373 | description: |
| 374 | Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians, divided by pi. |
| 375 | |
| 376 | To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>. |
| 377 | |
| 378 | See also @native_atan2pi(). |
| 379 | end: |
| 380 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 381 | function: atan2pi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 382 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 383 | attrib: const |
| 384 | w: 1, 2, 3, 4 |
| 385 | t: f16 |
| 386 | ret: #2#1 |
| 387 | arg: #2#1 numerator |
| 388 | arg: #2#1 denominator |
| 389 | test: none |
| 390 | end: |
| 391 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 392 | function: atanh |
| 393 | version: 9 |
| 394 | attrib: const |
| 395 | w: 1, 2, 3, 4 |
| 396 | t: f32 |
| 397 | ret: #2#1 |
| 398 | arg: #2#1 v, range(-1,1) |
| 399 | summary: Inverse hyperbolic tangent |
| 400 | description: |
| 401 | Returns the inverse hyperbolic tangent, in radians. |
| 402 | |
| 403 | See also @native_atanh(). |
| 404 | end: |
| 405 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 406 | function: atanh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 407 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 408 | attrib: const |
| 409 | w: 1, 2, 3, 4 |
| 410 | t: f16 |
| 411 | ret: #2#1 |
| 412 | arg: #2#1 v |
| 413 | test: none |
| 414 | end: |
| 415 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 416 | function: atanpi |
| 417 | version: 9 |
| 418 | attrib: const |
| 419 | w: 1, 2, 3, 4 |
| 420 | t: f32 |
| 421 | ret: #2#1 |
| 422 | arg: #2#1 v, range(-1,1) |
| 423 | summary: Inverse tangent divided by pi |
| 424 | description: |
| 425 | Returns the inverse tangent in radians, divided by pi. |
| 426 | |
| 427 | To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>. |
| 428 | |
| 429 | See also @native_atanpi(). |
| 430 | end: |
| 431 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 432 | function: atanpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 433 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 434 | attrib: const |
| 435 | w: 1, 2, 3, 4 |
| 436 | t: f16 |
| 437 | ret: #2#1 |
| 438 | arg: #2#1 v |
| 439 | test: none |
| 440 | end: |
| 441 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 442 | function: cbrt |
| 443 | version: 9 |
| 444 | attrib: const |
| 445 | w: 1, 2, 3, 4 |
| 446 | t: f32 |
| 447 | ret: #2#1 |
| 448 | arg: #2#1 v |
| 449 | summary: Cube root |
| 450 | description: |
| 451 | Returns the cube root. |
| 452 | |
| 453 | See also @native_cbrt(). |
| 454 | end: |
| 455 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 456 | function: cbrt |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 457 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 458 | attrib: const |
| 459 | w: 1, 2, 3, 4 |
| 460 | t: f16 |
| 461 | ret: #2#1 |
| 462 | arg: #2#1 v |
| 463 | test: none |
| 464 | end: |
| 465 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 466 | function: ceil |
| 467 | version: 9 |
| 468 | attrib: const |
| 469 | w: 1, 2, 3, 4 |
| 470 | t: f32 |
| 471 | ret: #2#1 |
| 472 | arg: #2#1 v |
| 473 | summary: Smallest integer not less than a value |
| 474 | description: |
| 475 | Returns the smallest integer not less than a value. |
| 476 | |
| 477 | For example, <code>ceil(1.2f)</code> returns 2.f, and <code>ceil(-1.2f)</code> returns -1.f. |
| 478 | |
| 479 | See also @floor(). |
| 480 | end: |
| 481 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 482 | function: ceil |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 483 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 484 | attrib: const |
| 485 | w: 1, 2, 3, 4 |
| 486 | t: f16 |
| 487 | ret: #2#1 |
| 488 | arg: #2#1 v |
| 489 | test: none |
| 490 | end: |
| 491 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 492 | function: clamp |
| 493 | version: 9 |
| 494 | attrib: const |
| 495 | w: 1, 2, 3, 4 |
| 496 | t: f32 |
| 497 | ret: #2#1 |
| 498 | arg: #2#1 value, "Value to be clamped." |
| 499 | arg: #2#1 min_value, "Lower bound, a scalar or matching vector." |
| 500 | arg: #2#1 max_value, above(min_value), "High bound, must match the type of low." |
| 501 | summary: Restrain a value to a range |
| 502 | description: |
| 503 | Clamps a value to a specified high and low bound. clamp() returns min_value |
| 504 | if value < min_value, max_value if value > max_value, otherwise value. |
| 505 | |
| 506 | There are two variants of clamp: one where the min and max are scalars applied |
| 507 | to all entries of the value, the other where the min and max are also vectors. |
| 508 | |
| 509 | If min_value is greater than max_value, the results are undefined. |
| 510 | end: |
| 511 | |
| 512 | function: clamp |
| 513 | version: 9 |
| 514 | attrib: const |
| 515 | w: 2, 3, 4 |
| 516 | t: f32 |
| 517 | ret: #2#1 |
| 518 | arg: #2#1 value |
| 519 | arg: #2 min_value |
| 520 | arg: #2 max_value, above(min_value) |
| 521 | end: |
| 522 | |
| 523 | function: clamp |
| 524 | version: 19 |
| 525 | attrib: const |
| 526 | w: 1, 2, 3, 4 |
| 527 | t: u8, u16, u32, u64, i8, i16, i32, i64 |
| 528 | ret: #2#1 |
| 529 | arg: #2#1 value |
| 530 | arg: #2#1 min_value |
| 531 | arg: #2#1 max_value, above(min_value) |
| 532 | end: |
| 533 | |
| 534 | function: clamp |
| 535 | version: 19 |
| 536 | attrib: const |
| 537 | w: 2, 3, 4 |
| 538 | t: u8, u16, u32, u64, i8, i16, i32, i64 |
| 539 | ret: #2#1 |
| 540 | arg: #2#1 value |
| 541 | arg: #2 min_value |
| 542 | arg: #2 max_value, above(min_value) |
| 543 | end: |
| 544 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 545 | function: clamp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 546 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 547 | attrib: const |
| 548 | w: 1, 2, 3, 4 |
| 549 | t: f16 |
| 550 | ret: #2#1 |
| 551 | arg: #2#1 value |
| 552 | arg: #2#1 min_value |
| 553 | arg: #2#1 max_value, above(min_value) |
| 554 | test: none |
| 555 | end: |
| 556 | |
| 557 | function: clamp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 558 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 559 | attrib: const |
| 560 | w: 2, 3, 4 |
| 561 | t: f16 |
| 562 | ret: #2#1 |
| 563 | arg: #2#1 value |
| 564 | arg: #2 min_value |
| 565 | arg: #2 max_value, above(min_value) |
| 566 | test: none |
| 567 | end: |
| 568 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 569 | function: clz |
| 570 | version: 9 |
| 571 | attrib: const |
| 572 | w: 1, 2, 3, 4 |
| 573 | t: u8, u16, u32, i8, i16, i32 |
| 574 | ret: #2#1 |
| 575 | arg: #2#1 value |
| 576 | summary: Number of leading 0 bits |
| 577 | description: |
| 578 | Returns the number of leading 0-bits in a value. |
| 579 | |
| 580 | For example, <code>clz((char)0x03)</code> returns 6. |
| 581 | end: |
| 582 | |
| 583 | function: copysign |
| 584 | version: 9 |
| 585 | attrib: const |
| 586 | w: 1, 2, 3, 4 |
| 587 | t: f32 |
| 588 | ret: #2#1 |
| 589 | arg: #2#1 magnitude_value |
| 590 | arg: #2#1 sign_value |
| 591 | summary: Copies the sign of a number to another |
| 592 | description: |
| 593 | Copies the sign from sign_value to magnitude_value. |
| 594 | |
| 595 | The value returned is either magnitude_value or -magnitude_value. |
| 596 | |
| 597 | For example, <code>copysign(4.0f, -2.7f)</code> returns -4.0f and <code>copysign(-4.0f, 2.7f)</code> returns 4.0f. |
| 598 | end: |
| 599 | |
Pirama Arumuga Nainar | d021b48 | 2016-02-04 11:40:05 -0800 | [diff] [blame] | 600 | function: copysign |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 601 | version: 24 |
Pirama Arumuga Nainar | d021b48 | 2016-02-04 11:40:05 -0800 | [diff] [blame] | 602 | attrib: const |
| 603 | w: 1, 2, 3, 4 |
| 604 | t: f16 |
| 605 | ret: #2#1 |
| 606 | arg: #2#1 magnitude_value |
| 607 | arg: #2#1 sign_value |
| 608 | test: none |
| 609 | end: |
| 610 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 611 | function: cos |
| 612 | version: 9 |
| 613 | attrib: const |
| 614 | w: 1, 2, 3, 4 |
| 615 | t: f32 |
| 616 | ret: #2#1 |
| 617 | arg: #2#1 v |
| 618 | summary: Cosine |
| 619 | description: |
| 620 | Returns the cosine of an angle measured in radians. |
| 621 | |
| 622 | See also @native_cos(). |
| 623 | end: |
| 624 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 625 | function: cos |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 626 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 627 | attrib: const |
| 628 | w: 1, 2, 3, 4 |
| 629 | t: f16 |
| 630 | ret: #2#1 |
| 631 | arg: #2#1 v |
| 632 | test: none |
| 633 | end: |
| 634 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 635 | function: cosh |
| 636 | version: 9 |
| 637 | attrib: const |
| 638 | w: 1, 2, 3, 4 |
| 639 | t: f32 |
| 640 | ret: #2#1 |
| 641 | arg: #2#1 v |
| 642 | summary: Hypebolic cosine |
| 643 | description: |
| 644 | Returns the hypebolic cosine of v, where v is measured in radians. |
| 645 | |
| 646 | See also @native_cosh(). |
| 647 | end: |
| 648 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 649 | function: cosh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 650 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 651 | attrib: const |
| 652 | w: 1, 2, 3, 4 |
| 653 | t: f16 |
| 654 | ret: #2#1 |
| 655 | arg: #2#1 v |
| 656 | test: none |
| 657 | end: |
| 658 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 659 | function: cospi |
| 660 | version: 9 |
| 661 | attrib: const |
| 662 | w: 1, 2, 3, 4 |
| 663 | t: f32 |
| 664 | ret: #2#1 |
| 665 | arg: #2#1 v |
| 666 | summary: Cosine of a number multiplied by pi |
| 667 | description: |
| 668 | Returns the cosine of <code>(v * pi)</code>, where <code>(v * pi)</code> is measured in radians. |
| 669 | |
| 670 | To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>. |
| 671 | |
| 672 | See also @native_cospi(). |
| 673 | end: |
| 674 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 675 | function: cospi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 676 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 677 | attrib: const |
| 678 | w: 1, 2, 3, 4 |
| 679 | t: f16 |
| 680 | ret: #2#1 |
| 681 | arg: #2#1 v |
| 682 | test: none |
| 683 | end: |
| 684 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 685 | function: degrees |
| 686 | version: 9 |
| 687 | attrib: const |
| 688 | w: 1, 2, 3, 4 |
| 689 | t: f32 |
| 690 | ret: #2#1 |
| 691 | arg: #2#1 v |
| 692 | summary: Converts radians into degrees |
| 693 | description: |
| 694 | Converts from radians to degrees. |
| 695 | end: |
| 696 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 697 | function: degrees |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 698 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 699 | attrib: const |
| 700 | w: 1, 2, 3, 4 |
| 701 | t: f16 |
| 702 | ret: #2#1 |
| 703 | arg: #2#1 v |
| 704 | test: none |
| 705 | end: |
| 706 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 707 | function: erf |
| 708 | version: 9 |
| 709 | attrib: const |
| 710 | w: 1, 2, 3, 4 |
| 711 | t: f32 |
| 712 | ret: #2#1 |
| 713 | arg: #2#1 v |
| 714 | summary: Mathematical error function |
| 715 | description: |
| 716 | Returns the error function. |
| 717 | end: |
| 718 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 719 | function: erf |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 720 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 721 | attrib: const |
| 722 | w: 1, 2, 3, 4 |
| 723 | t: f16 |
| 724 | ret: #2#1 |
| 725 | arg: #2#1 v |
| 726 | test: none |
| 727 | end: |
| 728 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 729 | function: erfc |
| 730 | version: 9 |
| 731 | attrib: const |
| 732 | w: 1, 2, 3, 4 |
| 733 | t: f32 |
| 734 | ret: #2#1 |
| 735 | arg: #2#1 v |
| 736 | summary: Mathematical complementary error function |
| 737 | description: |
| 738 | Returns the complementary error function. |
| 739 | end: |
| 740 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 741 | function: erfc |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 742 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 743 | attrib: const |
| 744 | w: 1, 2, 3, 4 |
| 745 | t: f16 |
| 746 | ret: #2#1 |
| 747 | arg: #2#1 v |
| 748 | test: none |
| 749 | end: |
| 750 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 751 | function: exp |
| 752 | version: 9 |
| 753 | attrib: const |
| 754 | w: 1, 2, 3, 4 |
| 755 | t: f32 |
| 756 | ret: #2#1 |
| 757 | arg: #2#1 v |
| 758 | summary: e raised to a number |
| 759 | description: |
| 760 | Returns e raised to v, i.e. e ^ v. |
| 761 | |
| 762 | See also @native_exp(). |
| 763 | end: |
| 764 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 765 | function: exp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 766 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 767 | attrib: const |
| 768 | w: 1, 2, 3, 4 |
| 769 | t: f16 |
| 770 | ret: #2#1 |
| 771 | arg: #2#1 v |
| 772 | test: none |
| 773 | end: |
| 774 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 775 | function: exp10 |
| 776 | version: 9 |
| 777 | attrib: const |
| 778 | w: 1, 2, 3, 4 |
| 779 | t: f32 |
| 780 | ret: #2#1 |
| 781 | arg: #2#1 v |
| 782 | summary: 10 raised to a number |
| 783 | description: |
| 784 | Returns 10 raised to v, i.e. 10.f ^ v. |
| 785 | |
| 786 | See also @native_exp10(). |
| 787 | end: |
| 788 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 789 | function: exp10 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 790 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 791 | attrib: const |
| 792 | w: 1, 2, 3, 4 |
| 793 | t: f16 |
| 794 | ret: #2#1 |
| 795 | arg: #2#1 v |
| 796 | test: none |
| 797 | end: |
| 798 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 799 | function: exp2 |
| 800 | version: 9 |
| 801 | attrib: const |
| 802 | w: 1, 2, 3, 4 |
| 803 | t: f32 |
| 804 | ret: #2#1 |
| 805 | arg: #2#1 v |
| 806 | summary: 2 raised to a number |
| 807 | description: |
| 808 | Returns 2 raised to v, i.e. 2.f ^ v. |
| 809 | |
| 810 | See also @native_exp2(). |
| 811 | end: |
| 812 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 813 | function: exp2 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 814 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 815 | attrib: const |
| 816 | w: 1, 2, 3, 4 |
| 817 | t: f16 |
| 818 | ret: #2#1 |
| 819 | arg: #2#1 v |
| 820 | test: none |
| 821 | end: |
| 822 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 823 | function: expm1 |
| 824 | version: 9 |
| 825 | attrib: const |
| 826 | w: 1, 2, 3, 4 |
| 827 | t: f32 |
| 828 | ret: #2#1 |
| 829 | arg: #2#1 v |
| 830 | summary: e raised to a number minus one |
| 831 | description: |
| 832 | Returns e raised to v minus 1, i.e. (e ^ v) - 1. |
| 833 | |
| 834 | See also @native_expm1(). |
| 835 | end: |
| 836 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 837 | function: expm1 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 838 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 839 | attrib: const |
| 840 | w: 1, 2, 3, 4 |
| 841 | t: f16 |
| 842 | ret: #2#1 |
| 843 | arg: #2#1 v |
| 844 | test: none |
| 845 | end: |
| 846 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 847 | function: fabs |
| 848 | version: 9 |
| 849 | attrib: const |
| 850 | w: 1, 2, 3, 4 |
| 851 | t: f32 |
| 852 | ret: #2#1 |
| 853 | arg: #2#1 v |
| 854 | summary: Absolute value of a float |
| 855 | description: |
| 856 | Returns the absolute value of the float v. |
| 857 | |
| 858 | For integers, use @abs(). |
| 859 | end: |
| 860 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 861 | function: fabs |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 862 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 863 | attrib: const |
| 864 | w: 1, 2, 3, 4 |
| 865 | t: f16 |
| 866 | ret: #2#1 |
| 867 | arg: #2#1 v |
| 868 | test: none |
| 869 | end: |
| 870 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 871 | function: fdim |
| 872 | version: 9 |
| 873 | attrib: const |
| 874 | w: 1, 2, 3, 4 |
| 875 | t: f32 |
| 876 | ret: #2#1 |
| 877 | arg: #2#1 a |
| 878 | arg: #2#1 b |
| 879 | summary: Positive difference between two values |
| 880 | description: |
| 881 | Returns the positive difference between two values. |
| 882 | |
| 883 | If a > b, returns (a - b) otherwise returns 0f. |
| 884 | end: |
| 885 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 886 | function: fdim |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 887 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 888 | attrib: const |
| 889 | w: 1, 2, 3, 4 |
| 890 | t: f16 |
| 891 | ret: #2#1 |
| 892 | arg: #2#1 a |
| 893 | arg: #2#1 b |
| 894 | test: none |
| 895 | end: |
| 896 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 897 | function: floor |
| 898 | version: 9 |
| 899 | attrib: const |
| 900 | w: 1, 2, 3, 4 |
| 901 | t: f32 |
| 902 | ret: #2#1 |
| 903 | arg: #2#1 v |
| 904 | summary: Smallest integer not greater than a value |
| 905 | description: |
| 906 | Returns the smallest integer not greater than a value. |
| 907 | |
| 908 | For example, <code>floor(1.2f)</code> returns 1.f, and <code>floor(-1.2f)</code> returns -2.f. |
| 909 | |
| 910 | See also @ceil(). |
| 911 | end: |
| 912 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 913 | function: floor |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 914 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 915 | attrib: const |
| 916 | w: 1, 2, 3, 4 |
| 917 | t: f16 |
| 918 | ret: #2#1 |
| 919 | arg: #2#1 v |
| 920 | test: none |
| 921 | end: |
| 922 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 923 | function: fma |
| 924 | version: 9 |
| 925 | attrib: const |
| 926 | w: 1, 2, 3, 4 |
| 927 | t: f32 |
| 928 | ret: #2#1 |
| 929 | arg: #2#1 multiplicand1 |
| 930 | arg: #2#1 multiplicand2 |
| 931 | arg: #2#1 offset |
| 932 | summary: Multiply and add |
| 933 | description: |
| 934 | Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>. |
| 935 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 936 | This function is similar to @mad(). fma() retains full precision of the multiplied result |
| 937 | and rounds only after the addition. @mad() rounds after the multiplication and the addition. |
| 938 | This extra precision is not guaranteed in rs_fp_relaxed mode. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 939 | end: |
| 940 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 941 | function: fma |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 942 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 943 | attrib: const |
| 944 | w: 1, 2, 3, 4 |
| 945 | t: f16 |
| 946 | ret: #2#1 |
| 947 | arg: #2#1 multiplicand1 |
| 948 | arg: #2#1 multiplicand2 |
| 949 | arg: #2#1 offset |
| 950 | test: none |
| 951 | end: |
| 952 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 953 | function: fmax |
| 954 | version: 9 |
| 955 | attrib: const |
| 956 | w: 1, 2, 3, 4 |
| 957 | t: f32 |
| 958 | ret: #2#1 |
| 959 | arg: #2#1 a |
| 960 | arg: #2#1 b |
| 961 | summary: Maximum of two floats |
| 962 | description: |
| 963 | Returns the maximum of a and b, i.e. <code>(a < b ? b : a)</code>. |
| 964 | |
| 965 | The @max() function returns identical results but can be applied to more data types. |
| 966 | end: |
| 967 | |
| 968 | function: fmax |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 969 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 970 | attrib: const |
| 971 | w: 1, 2, 3, 4 |
| 972 | t: f16 |
| 973 | ret: #2#1 |
| 974 | arg: #2#1 a |
| 975 | arg: #2#1 b |
| 976 | test: none |
| 977 | end: |
| 978 | |
| 979 | function: fmax |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 980 | version: 9 |
| 981 | attrib: const |
| 982 | w: 2, 3, 4 |
| 983 | t: f32 |
| 984 | ret: #2#1 |
| 985 | arg: #2#1 a |
| 986 | arg: #2 b |
| 987 | end: |
| 988 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 989 | function: fmax |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 990 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 991 | attrib: const |
| 992 | w: 2, 3, 4 |
| 993 | t: f16 |
| 994 | ret: #2#1 |
| 995 | arg: #2#1 a |
| 996 | arg: #2 b |
| 997 | test: none |
| 998 | end: |
| 999 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1000 | function: fmin |
| 1001 | version: 9 |
| 1002 | attrib: const |
| 1003 | w: 1, 2, 3, 4 |
| 1004 | t: f32 |
| 1005 | ret: #2#1 |
| 1006 | arg: #2#1 a |
| 1007 | arg: #2#1 b |
| 1008 | summary: Minimum of two floats |
| 1009 | description: |
| 1010 | Returns the minimum of a and b, i.e. <code>(a > b ? b : a)</code>. |
| 1011 | |
| 1012 | The @min() function returns identical results but can be applied to more data types. |
| 1013 | end: |
| 1014 | |
| 1015 | function: fmin |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1016 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1017 | attrib: const |
| 1018 | w: 1, 2, 3, 4 |
| 1019 | t: f16 |
| 1020 | ret: #2#1 |
| 1021 | arg: #2#1 a |
| 1022 | arg: #2#1 b |
| 1023 | test: none |
| 1024 | end: |
| 1025 | |
| 1026 | function: fmin |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1027 | version: 9 |
| 1028 | attrib: const |
| 1029 | w: 2, 3, 4 |
| 1030 | t: f32 |
| 1031 | ret: #2#1 |
| 1032 | arg: #2#1 a |
| 1033 | arg: #2 b |
| 1034 | end: |
| 1035 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1036 | function: fmin |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1037 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1038 | attrib: const |
| 1039 | w: 2, 3, 4 |
| 1040 | t: f16 |
| 1041 | ret: #2#1 |
| 1042 | arg: #2#1 a |
| 1043 | arg: #2 b |
| 1044 | test: none |
| 1045 | end: |
| 1046 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1047 | function: fmod |
| 1048 | version: 9 |
| 1049 | attrib: const |
| 1050 | w: 1, 2, 3, 4 |
| 1051 | t: f32 |
| 1052 | ret: #2#1 |
| 1053 | arg: #2#1 numerator |
| 1054 | arg: #2#1 denominator |
| 1055 | summary: Modulo |
| 1056 | description: |
| 1057 | Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero. |
| 1058 | |
| 1059 | The function @remainder() is similar but rounds toward the closest interger. |
| 1060 | For example, <code>fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f) |
| 1061 | while <code>@remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f). |
| 1062 | end: |
| 1063 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1064 | function: fmod |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1065 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1066 | attrib: const |
| 1067 | w: 1, 2, 3, 4 |
| 1068 | t: f16 |
| 1069 | ret: #2#1 |
| 1070 | arg: #2#1 numerator |
| 1071 | arg: #2#1 denominator |
| 1072 | test: none |
| 1073 | end: |
| 1074 | |
| 1075 | # TODO Add (both variants) of fract for f16 |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1076 | function: fract |
| 1077 | version: 9 |
| 1078 | w: 1, 2, 3, 4 |
| 1079 | t: f32 |
| 1080 | ret: #2#1 |
| 1081 | arg: #2#1 v, "Input value." |
| 1082 | arg: #2#1* floor, "If floor is not null, *floor will be set to the floor of v." |
| 1083 | summary: Positive fractional part |
| 1084 | description: |
| 1085 | Returns the positive fractional part of v, i.e. <code>v - floor(v)</code>. |
| 1086 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1087 | For example, <code>fract(1.3f, &val)</code> returns 0.3f and sets val to 1.f. |
| 1088 | <code>fract(-1.3f, &val)</code> returns 0.7f and sets val to -2.f. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1089 | end: |
| 1090 | |
| 1091 | function: fract |
Verena Beckham | 9cbc99b | 2015-11-16 12:25:54 +0000 | [diff] [blame] | 1092 | version: 9 23 |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1093 | attrib: const |
| 1094 | w: 1, 2, 3, 4 |
| 1095 | t: f32 |
| 1096 | ret: #2#1 |
| 1097 | arg: #2#1 v |
| 1098 | inline: |
| 1099 | #2#1 unused; |
| 1100 | return fract(v, &unused); |
| 1101 | end: |
| 1102 | |
Verena Beckham | 9cbc99b | 2015-11-16 12:25:54 +0000 | [diff] [blame] | 1103 | function: fract |
| 1104 | version: 24 |
| 1105 | w: 1, 2, 3, 4 |
| 1106 | t: f32 |
| 1107 | ret: #2#1 |
| 1108 | arg: #2#1 v |
| 1109 | end: |
| 1110 | |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1111 | function: fract |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1112 | version: 24 |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1113 | w: 1, 2, 3, 4 |
| 1114 | t: f16 |
| 1115 | ret: #2#1 |
| 1116 | arg: #2#1 v |
| 1117 | arg: #2#1* floor |
| 1118 | test: none |
| 1119 | end: |
| 1120 | |
| 1121 | function: fract |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1122 | version: 24 |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1123 | w: 1, 2, 3, 4 |
| 1124 | t: f16 |
| 1125 | ret: #2#1 |
| 1126 | arg: #2#1 v |
| 1127 | test: none |
| 1128 | end: |
| 1129 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1130 | # TODO Add f16 frexp |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1131 | function: frexp |
| 1132 | version: 9 |
| 1133 | w: 1, 2, 3, 4 |
| 1134 | t: f32 |
| 1135 | ret: #2#1 |
| 1136 | arg: #2#1 v, "Input value." |
| 1137 | arg: int#1* exponent, "If exponent is not null, *exponent will be set to the exponent of v." |
| 1138 | summary: Binary mantissa and exponent |
| 1139 | description: |
| 1140 | Returns the binary mantissa and exponent of v, i.e. <code>v == mantissa * 2 ^ exponent</code>. |
| 1141 | |
| 1142 | The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive). |
| 1143 | |
| 1144 | See @ldexp() for the reverse operation. See also @logb() and @ilogb(). |
| 1145 | end: |
| 1146 | |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1147 | function: frexp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1148 | version: 24 |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1149 | w: 1, 2, 3, 4 |
| 1150 | t: f16 |
| 1151 | ret: #2#1 |
| 1152 | arg: #2#1 v |
| 1153 | arg: int#1* exponent |
| 1154 | test: none |
| 1155 | end: |
| 1156 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1157 | function: half_recip |
| 1158 | version: 17 |
| 1159 | attrib: const |
| 1160 | w: 1, 2, 3, 4 |
| 1161 | t: f32 |
| 1162 | ret: #2#1 |
| 1163 | arg: #2#1 v |
| 1164 | summary: Reciprocal computed to 16 bit precision |
| 1165 | description: |
| 1166 | Returns the approximate reciprocal of a value. |
| 1167 | |
| 1168 | The precision is that of a 16 bit floating point value. |
| 1169 | |
| 1170 | See also @native_recip(). |
| 1171 | end: |
| 1172 | |
| 1173 | function: half_rsqrt |
| 1174 | version: 17 |
| 1175 | attrib: const |
| 1176 | w: 1, 2, 3, 4 |
| 1177 | t: f32 |
| 1178 | ret: #2#1 |
| 1179 | arg: #2#1 v |
| 1180 | summary: Reciprocal of a square root computed to 16 bit precision |
| 1181 | description: |
| 1182 | Returns the approximate value of <code>(1.f / sqrt(value))</code>. |
| 1183 | |
| 1184 | The precision is that of a 16 bit floating point value. |
| 1185 | |
| 1186 | See also @rsqrt(), @native_rsqrt(). |
| 1187 | end: |
| 1188 | |
| 1189 | function: half_sqrt |
| 1190 | version: 17 |
| 1191 | attrib: const |
| 1192 | w: 1, 2, 3, 4 |
| 1193 | t: f32 |
| 1194 | ret: #2#1 |
| 1195 | arg: #2#1 v |
| 1196 | summary: Square root computed to 16 bit precision |
| 1197 | description: |
| 1198 | Returns the approximate square root of a value. |
| 1199 | |
| 1200 | The precision is that of a 16 bit floating point value. |
| 1201 | |
| 1202 | See also @sqrt(), @native_sqrt(). |
| 1203 | end: |
| 1204 | |
| 1205 | function: hypot |
| 1206 | version: 9 |
| 1207 | attrib: const |
| 1208 | w: 1, 2, 3, 4 |
| 1209 | t: f32 |
| 1210 | ret: #2#1 |
| 1211 | arg: #2#1 a |
| 1212 | arg: #2#1 b |
| 1213 | summary: Hypotenuse |
| 1214 | description: |
| 1215 | Returns the hypotenuse, i.e. <code>sqrt(a * a + b * b)</code>. |
| 1216 | |
| 1217 | See also @native_hypot(). |
| 1218 | end: |
| 1219 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1220 | function: hypot |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1221 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1222 | attrib: const |
| 1223 | w: 1, 2, 3, 4 |
| 1224 | t: f16 |
| 1225 | ret: #2#1 |
| 1226 | arg: #2#1 a |
| 1227 | arg: #2#1 b |
| 1228 | test: none |
| 1229 | end: |
| 1230 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1231 | function: ilogb |
| 1232 | version: 9 |
| 1233 | attrib: const |
| 1234 | w: 1, 2, 3, 4 |
| 1235 | t: f32 |
| 1236 | ret: int#1 |
| 1237 | arg: float#1 v |
| 1238 | summary: Base two exponent |
| 1239 | description: |
| 1240 | Returns the base two exponent of a value, where the mantissa is between |
| 1241 | 1.f (inclusive) and 2.f (exclusive). |
| 1242 | |
| 1243 | For example, <code>ilogb(8.5f)</code> returns 3. |
| 1244 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1245 | Because of the difference in mantissa, this number is one less than is returned by @frexp(). |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1246 | |
| 1247 | @logb() is similar but returns a float. |
| 1248 | test: custom |
| 1249 | end: |
| 1250 | |
Pirama Arumuga Nainar | d021b48 | 2016-02-04 11:40:05 -0800 | [diff] [blame] | 1251 | function: ilogb |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1252 | version: 24 |
Pirama Arumuga Nainar | d021b48 | 2016-02-04 11:40:05 -0800 | [diff] [blame] | 1253 | attrib: const |
| 1254 | w: 1, 2, 3, 4 |
| 1255 | t: f16 |
| 1256 | ret: int#1 |
| 1257 | arg: half#1 v |
| 1258 | test: none |
| 1259 | end: |
| 1260 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1261 | function: ldexp |
| 1262 | version: 9 |
| 1263 | attrib: const |
| 1264 | w: 1, 2, 3, 4 |
| 1265 | ret: float#1 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1266 | arg: float#1 mantissa, "Mantissa." |
| 1267 | arg: int#1 exponent, "Exponent, a single component or matching vector." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1268 | summary: Creates a floating point from mantissa and exponent |
| 1269 | description: |
| 1270 | Returns the floating point created from the mantissa and exponent, |
| 1271 | i.e. (mantissa * 2 ^ exponent). |
| 1272 | |
| 1273 | See @frexp() for the reverse operation. |
| 1274 | end: |
| 1275 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1276 | function: ldexp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1277 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1278 | attrib: const |
| 1279 | w: 1, 2, 3, 4 |
| 1280 | ret: half#1 |
| 1281 | arg: half#1 mantissa |
| 1282 | arg: int#1 exponent |
| 1283 | test: none |
| 1284 | end: |
| 1285 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1286 | function: ldexp |
| 1287 | version: 9 |
| 1288 | attrib: const |
| 1289 | w: 2, 3, 4 |
| 1290 | ret: float#1 |
| 1291 | arg: float#1 mantissa |
| 1292 | arg: int exponent |
| 1293 | end: |
| 1294 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1295 | function: ldexp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1296 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1297 | attrib: const |
| 1298 | w: 2, 3, 4 |
| 1299 | ret: half#1 |
| 1300 | arg: half#1 mantissa |
| 1301 | arg: int exponent |
| 1302 | test: none |
| 1303 | end: |
| 1304 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1305 | function: lgamma |
| 1306 | version: 9 |
| 1307 | attrib: const |
| 1308 | w: 1, 2, 3, 4 |
| 1309 | t: f32 |
| 1310 | ret: #2#1 |
| 1311 | arg: #2#1 v |
| 1312 | summary: Natural logarithm of the gamma function |
| 1313 | description: |
| 1314 | Returns the natural logarithm of the absolute value of the gamma function, |
| 1315 | i.e. <code>@log(@fabs(@tgamma(v)))</code>. |
| 1316 | |
| 1317 | See also @tgamma(). |
| 1318 | end: |
| 1319 | |
| 1320 | function: lgamma |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1321 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1322 | attrib: const |
| 1323 | w: 1, 2, 3, 4 |
| 1324 | t: f16 |
| 1325 | ret: #2#1 |
| 1326 | arg: #2#1 v |
| 1327 | test: none |
| 1328 | end: |
| 1329 | |
| 1330 | function: lgamma |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1331 | version: 9 |
| 1332 | w: 1, 2, 3, 4 |
| 1333 | t: f32 |
| 1334 | ret: #2#1 |
| 1335 | arg: #2#1 v |
| 1336 | arg: int#1* sign_of_gamma, "If sign_of_gamma is not null, *sign_of_gamma will be set to -1.f if the gamma of v is negative, otherwise to 1.f." |
| 1337 | test: custom |
| 1338 | #TODO Temporary until bionic & associated drivers are fixed |
| 1339 | end: |
| 1340 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1341 | function: lgamma |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1342 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1343 | w: 1, 2, 3, 4 |
| 1344 | t: f16 |
| 1345 | ret: #2#1 |
| 1346 | arg: #2#1 v |
| 1347 | arg: int#1* sign_of_gamma |
| 1348 | test: none |
| 1349 | end: |
| 1350 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1351 | function: log |
| 1352 | version: 9 |
| 1353 | attrib: const |
| 1354 | w: 1, 2, 3, 4 |
| 1355 | t: f32 |
| 1356 | ret: #2#1 |
| 1357 | arg: #2#1 v |
| 1358 | summary: Natural logarithm |
| 1359 | description: |
| 1360 | Returns the natural logarithm. |
| 1361 | |
| 1362 | See also @native_log(). |
| 1363 | end: |
| 1364 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1365 | function: log |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1366 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1367 | attrib: const |
| 1368 | w: 1, 2, 3, 4 |
| 1369 | t: f16 |
| 1370 | ret: #2#1 |
| 1371 | arg: #2#1 v |
| 1372 | test: none |
| 1373 | end: |
| 1374 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1375 | function: log10 |
| 1376 | version: 9 |
| 1377 | attrib: const |
| 1378 | w: 1, 2, 3, 4 |
| 1379 | t: f32 |
| 1380 | ret: #2#1 |
| 1381 | arg: #2#1 v |
| 1382 | summary: Base 10 logarithm |
| 1383 | description: |
| 1384 | Returns the base 10 logarithm. |
| 1385 | |
| 1386 | See also @native_log10(). |
| 1387 | end: |
| 1388 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1389 | function: log10 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1390 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1391 | attrib: const |
| 1392 | w: 1, 2, 3, 4 |
| 1393 | t: f16 |
| 1394 | ret: #2#1 |
| 1395 | arg: #2#1 v |
| 1396 | test: none |
| 1397 | end: |
| 1398 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1399 | function: log1p |
| 1400 | version: 9 |
| 1401 | attrib: const |
| 1402 | w: 1, 2, 3, 4 |
| 1403 | t: f32 |
| 1404 | ret: #2#1 |
| 1405 | arg: #2#1 v |
| 1406 | summary: Natural logarithm of a value plus 1 |
| 1407 | description: |
| 1408 | Returns the natural logarithm of <code>(v + 1.f)</code>. |
| 1409 | |
| 1410 | See also @native_log1p(). |
| 1411 | end: |
| 1412 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1413 | function: log1p |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1414 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1415 | attrib: const |
| 1416 | w: 1, 2, 3, 4 |
| 1417 | t: f16 |
| 1418 | ret: #2#1 |
| 1419 | arg: #2#1 v |
| 1420 | test: none |
| 1421 | end: |
| 1422 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1423 | function: log2 |
| 1424 | version: 9 |
| 1425 | attrib: const |
| 1426 | w: 1, 2, 3, 4 |
| 1427 | t: f32 |
| 1428 | ret: #2#1 |
| 1429 | arg: #2#1 v |
| 1430 | summary: Base 2 logarithm |
| 1431 | description: |
| 1432 | Returns the base 2 logarithm. |
| 1433 | |
| 1434 | See also @native_log2(). |
| 1435 | end: |
| 1436 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1437 | function: log2 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1438 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1439 | attrib: const |
| 1440 | w: 1, 2, 3, 4 |
| 1441 | t: f16 |
| 1442 | ret: #2#1 |
| 1443 | arg: #2#1 v |
| 1444 | test: none |
| 1445 | end: |
| 1446 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1447 | function: logb |
| 1448 | version: 9 |
| 1449 | attrib: const |
| 1450 | w: 1, 2, 3, 4 |
| 1451 | t: f32 |
| 1452 | ret: #2#1 |
| 1453 | arg: #2#1 v |
| 1454 | summary: Base two exponent |
| 1455 | description: |
| 1456 | Returns the base two exponent of a value, where the mantissa is between |
| 1457 | 1.f (inclusive) and 2.f (exclusive). |
| 1458 | |
| 1459 | For example, <code>logb(8.5f)</code> returns 3.f. |
| 1460 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1461 | Because of the difference in mantissa, this number is one less than is returned by frexp(). |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1462 | |
| 1463 | @ilogb() is similar but returns an integer. |
| 1464 | end: |
| 1465 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1466 | function: logb |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1467 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1468 | attrib: const |
| 1469 | w: 1, 2, 3, 4 |
| 1470 | t: f16 |
| 1471 | ret: #2#1 |
| 1472 | arg: #2#1 v |
| 1473 | test: none |
| 1474 | end: |
| 1475 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1476 | function: mad |
| 1477 | version: 9 |
| 1478 | attrib: const |
| 1479 | w: 1, 2, 3, 4 |
| 1480 | t: f32 |
| 1481 | ret: #2#1 |
| 1482 | arg: #2#1 multiplicand1 |
| 1483 | arg: #2#1 multiplicand2 |
| 1484 | arg: #2#1 offset |
| 1485 | summary: Multiply and add |
| 1486 | description: |
| 1487 | Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>. |
| 1488 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1489 | This function is similar to @fma(). @fma() retains full precision of the multiplied result |
| 1490 | and rounds only after the addition. mad() rounds after the multiplication and the addition. |
| 1491 | In rs_fp_relaxed mode, mad() may not do the rounding after multiplicaiton. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1492 | end: |
| 1493 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1494 | function: mad |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1495 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1496 | attrib: const |
| 1497 | w: 1, 2, 3, 4 |
| 1498 | t: f16 |
| 1499 | ret: #2#1 |
| 1500 | arg: #2#1 multiplicand1 |
| 1501 | arg: #2#1 multiplicand2 |
| 1502 | arg: #2#1 offset |
| 1503 | test: none |
| 1504 | end: |
| 1505 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1506 | function: max |
| 1507 | version: 9 |
| 1508 | attrib: const |
| 1509 | w: 1, 2, 3, 4 |
| 1510 | t: f32 |
| 1511 | ret: #2#1 |
| 1512 | arg: #2#1 a |
| 1513 | arg: #2#1 b |
| 1514 | summary: Maximum |
| 1515 | description: |
| 1516 | Returns the maximum value of two arguments. |
| 1517 | end: |
| 1518 | |
| 1519 | function: max |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1520 | version:24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1521 | attrib: const |
| 1522 | w: 1, 2, 3, 4 |
| 1523 | t: f16 |
| 1524 | ret: #2#1 |
| 1525 | arg: #2#1 a |
| 1526 | arg: #2#1 b |
| 1527 | test: none |
| 1528 | end: |
| 1529 | |
| 1530 | function: max |
Jean-Luc Brouillet | 7cf263d | 2015-08-20 17:30:41 -0700 | [diff] [blame] | 1531 | version: 9 |
| 1532 | attrib: const |
| 1533 | w: 2, 3, 4 |
| 1534 | t: f32 |
| 1535 | ret: #2#1 |
| 1536 | arg: #2#1 a |
| 1537 | arg: #2 b |
| 1538 | end: |
| 1539 | |
| 1540 | function: max |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1541 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1542 | attrib: const |
| 1543 | w: 2, 3, 4 |
| 1544 | t: f16 |
| 1545 | ret: #2#1 |
| 1546 | arg: #2#1 a |
| 1547 | arg: #2 b |
| 1548 | test: none |
| 1549 | end: |
| 1550 | |
| 1551 | function: max |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1552 | version: 9 20 |
| 1553 | attrib: const |
| 1554 | w: 1 |
| 1555 | t: i8, i16, i32, u8, u16, u32 |
| 1556 | ret: #2#1 |
| 1557 | arg: #2#1 a |
| 1558 | arg: #2#1 b |
| 1559 | inline: |
| 1560 | return (a > b ? a : b); |
| 1561 | end: |
| 1562 | |
| 1563 | function: max |
| 1564 | version: 9 20 |
| 1565 | attrib: const |
| 1566 | w: 2 |
| 1567 | t: i8, i16, i32, u8, u16, u32 |
| 1568 | ret: #2#1 |
| 1569 | arg: #2#1 a |
| 1570 | arg: #2#1 b |
| 1571 | inline: |
| 1572 | #2#1 tmp; |
| 1573 | tmp.x = (a.x > b.x ? a.x : b.x); |
| 1574 | tmp.y = (a.y > b.y ? a.y : b.y); |
| 1575 | return tmp; |
| 1576 | end: |
| 1577 | |
| 1578 | function: max |
| 1579 | version: 9 20 |
| 1580 | attrib: const |
| 1581 | w: 3 |
| 1582 | t: i8, i16, i32, u8, u16, u32 |
| 1583 | ret: #2#1 |
| 1584 | arg: #2#1 a |
| 1585 | arg: #2#1 b |
| 1586 | inline: |
| 1587 | #2#1 tmp; |
| 1588 | tmp.x = (a.x > b.x ? a.x : b.x); |
| 1589 | tmp.y = (a.y > b.y ? a.y : b.y); |
| 1590 | tmp.z = (a.z > b.z ? a.z : b.z); |
| 1591 | return tmp; |
| 1592 | end: |
| 1593 | |
| 1594 | function: max |
| 1595 | version: 9 20 |
| 1596 | attrib: const |
| 1597 | w: 4 |
| 1598 | t: i8, i16, i32, u8, u16, u32 |
| 1599 | ret: #2#1 |
| 1600 | arg: #2#1 a |
| 1601 | arg: #2#1 b |
| 1602 | inline: |
| 1603 | #2#1 tmp; |
| 1604 | tmp.x = (a.x > b.x ? a.x : b.x); |
| 1605 | tmp.y = (a.y > b.y ? a.y : b.y); |
| 1606 | tmp.z = (a.z > b.z ? a.z : b.z); |
| 1607 | tmp.w = (a.w > b.w ? a.w : b.w); |
| 1608 | return tmp; |
| 1609 | end: |
| 1610 | |
| 1611 | function: max |
| 1612 | version: 21 |
| 1613 | attrib: const |
| 1614 | w: 1, 2, 3, 4 |
| 1615 | t: i8, i16, i32, i64, u8, u16, u32, u64 |
| 1616 | ret: #2#1 |
| 1617 | arg: #2#1 a |
| 1618 | arg: #2#1 b |
| 1619 | end: |
| 1620 | |
| 1621 | function: min |
| 1622 | version: 9 |
| 1623 | attrib: const |
| 1624 | w: 1, 2, 3, 4 |
| 1625 | t: f32 |
| 1626 | ret: #2#1 |
| 1627 | arg: #2#1 a |
| 1628 | arg: #2#1 b |
| 1629 | summary: Minimum |
| 1630 | description: |
| 1631 | Returns the minimum value of two arguments. |
| 1632 | end: |
| 1633 | |
| 1634 | function: min |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1635 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1636 | attrib: const |
| 1637 | w: 1, 2, 3, 4 |
| 1638 | t: f16 |
| 1639 | ret: #2#1 |
| 1640 | arg: #2#1 a |
| 1641 | arg: #2#1 b |
| 1642 | test: none |
| 1643 | end: |
| 1644 | |
| 1645 | function: min |
Jean-Luc Brouillet | 7cf263d | 2015-08-20 17:30:41 -0700 | [diff] [blame] | 1646 | version: 9 |
| 1647 | attrib: const |
| 1648 | w: 2, 3, 4 |
| 1649 | t: f32 |
| 1650 | ret: #2#1 |
| 1651 | arg: #2#1 a |
| 1652 | arg: #2 b |
| 1653 | end: |
| 1654 | |
| 1655 | function: min |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1656 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1657 | attrib: const |
| 1658 | w: 2, 3, 4 |
| 1659 | t: f16 |
| 1660 | ret: #2#1 |
| 1661 | arg: #2#1 a |
| 1662 | arg: #2 b |
| 1663 | test: none |
| 1664 | end: |
| 1665 | |
| 1666 | function: min |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1667 | version: 9 20 |
| 1668 | attrib: const |
| 1669 | w: 1 |
| 1670 | t: i8, i16, i32, u8, u16, u32 |
| 1671 | ret: #2#1 |
| 1672 | arg: #2#1 a |
| 1673 | arg: #2#1 b |
| 1674 | inline: |
| 1675 | return (a < b ? a : b); |
| 1676 | end: |
| 1677 | |
| 1678 | function: min |
| 1679 | version: 9 20 |
| 1680 | attrib: const |
| 1681 | w: 2 |
| 1682 | t: i8, i16, i32, u8, u16, u32 |
| 1683 | ret: #2#1 |
| 1684 | arg: #2#1 a |
| 1685 | arg: #2#1 b |
| 1686 | inline: |
| 1687 | #2#1 tmp; |
| 1688 | tmp.x = (a.x < b.x ? a.x : b.x); |
| 1689 | tmp.y = (a.y < b.y ? a.y : b.y); |
| 1690 | return tmp; |
| 1691 | end: |
| 1692 | |
| 1693 | function: min |
| 1694 | version: 9 20 |
| 1695 | attrib: const |
| 1696 | w: 3 |
| 1697 | t: i8, i16, i32, u8, u16, u32 |
| 1698 | ret: #2#1 |
| 1699 | arg: #2#1 a |
| 1700 | arg: #2#1 b |
| 1701 | inline: |
| 1702 | #2#1 tmp; |
| 1703 | tmp.x = (a.x < b.x ? a.x : b.x); |
| 1704 | tmp.y = (a.y < b.y ? a.y : b.y); |
| 1705 | tmp.z = (a.z < b.z ? a.z : b.z); |
| 1706 | return tmp; |
| 1707 | end: |
| 1708 | |
| 1709 | function: min |
| 1710 | version: 9 20 |
| 1711 | attrib: const |
| 1712 | w: 4 |
| 1713 | t: i8, i16, i32, u8, u16, u32 |
| 1714 | ret: #2#1 |
| 1715 | arg: #2#1 a |
| 1716 | arg: #2#1 b |
| 1717 | inline: |
| 1718 | #2#1 tmp; |
| 1719 | tmp.x = (a.x < b.x ? a.x : b.x); |
| 1720 | tmp.y = (a.y < b.y ? a.y : b.y); |
| 1721 | tmp.z = (a.z < b.z ? a.z : b.z); |
| 1722 | tmp.w = (a.w < b.w ? a.w : b.w); |
| 1723 | return tmp; |
| 1724 | end: |
| 1725 | |
| 1726 | function: min |
| 1727 | version: 21 |
| 1728 | attrib: const |
| 1729 | w: 1, 2, 3, 4 |
| 1730 | t: i8, i16, i32, i64, u8, u16, u32, u64 |
| 1731 | ret: #2#1 |
| 1732 | arg: #2#1 a |
| 1733 | arg: #2#1 b |
| 1734 | end: |
| 1735 | |
| 1736 | function: mix |
| 1737 | version: 9 |
| 1738 | attrib: const |
| 1739 | w: 1, 2, 3, 4 |
| 1740 | t: f32 |
| 1741 | ret: #2#1 |
| 1742 | arg: #2#1 start |
| 1743 | arg: #2#1 stop |
| 1744 | arg: #2#1 fraction |
| 1745 | summary: Mixes two values |
| 1746 | description: |
| 1747 | Returns start + ((stop - start) * fraction). |
| 1748 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1749 | This can be useful for mixing two values. For example, to create a new color that is |
| 1750 | 40% color1 and 60% color2, use <code>mix(color1, color2, 0.6f)</code>. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1751 | end: |
| 1752 | |
| 1753 | function: mix |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1754 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1755 | attrib: const |
| 1756 | w: 1, 2, 3, 4 |
| 1757 | t: f16 |
| 1758 | ret: #2#1 |
| 1759 | arg: #2#1 start |
| 1760 | arg: #2#1 stop |
| 1761 | arg: #2#1 fraction |
| 1762 | test: none |
| 1763 | end: |
| 1764 | |
| 1765 | function: mix |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1766 | version: 9 |
| 1767 | attrib: const |
| 1768 | w: 2, 3, 4 |
| 1769 | t: f32 |
| 1770 | ret: #2#1 |
| 1771 | arg: #2#1 start |
| 1772 | arg: #2#1 stop |
| 1773 | arg: #2 fraction |
| 1774 | end: |
| 1775 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1776 | function: mix |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1777 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1778 | attrib: const |
| 1779 | w: 2, 3, 4 |
| 1780 | t: f16 |
| 1781 | ret: #2#1 |
| 1782 | arg: #2#1 start |
| 1783 | arg: #2#1 stop |
| 1784 | arg: #2 fraction |
| 1785 | test: none |
| 1786 | end: |
| 1787 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1788 | function: modf |
| 1789 | version: 9 |
| 1790 | w: 1, 2, 3, 4 |
| 1791 | t: f32 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1792 | ret: #2#1, "Floating point portion of the value." |
| 1793 | arg: #2#1 v, "Source value." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1794 | arg: #2#1* integral_part, "*integral_part will be set to the integral portion of the number." |
| 1795 | summary: Integral and fractional components |
| 1796 | description: |
| 1797 | Returns the integral and fractional components of a number. |
| 1798 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1799 | Both components will have the same sign as x. For example, for an input of -3.72f, |
Pirama Arumuga Nainar | e6128ff | 2015-12-06 17:32:42 -0800 | [diff] [blame] | 1800 | *integral_part will be set to -3.f and .72f will be returned. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1801 | end: |
| 1802 | |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1803 | function: modf |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1804 | version: 24 |
Pirama Arumuga Nainar | 91ad891 | 2016-02-05 16:50:13 -0800 | [diff] [blame] | 1805 | w: 1, 2, 3, 4 |
| 1806 | t: f16 |
| 1807 | ret: #2#1 |
| 1808 | arg: #2#1 v |
| 1809 | arg: #2#1* integral_part |
| 1810 | test: none |
| 1811 | end: |
| 1812 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1813 | function: nan |
| 1814 | version: 9 |
| 1815 | attrib: const |
| 1816 | w: 1 |
| 1817 | t: f32 |
| 1818 | ret: #2#1 |
| 1819 | arg: uint#1 v, "Not used." |
| 1820 | #TODO We're not using the argument. Once we do, add this documentation line: |
| 1821 | # The argument is embedded into the return value and can be used to distinguish various NaNs. |
| 1822 | summary: Not a Number |
| 1823 | description: |
| 1824 | Returns a NaN value (Not a Number). |
| 1825 | end: |
| 1826 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1827 | function: nan_half |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1828 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1829 | attrib: const |
| 1830 | t: f16 |
| 1831 | ret: #1 |
| 1832 | summary: Not a Number |
| 1833 | description: |
| 1834 | Returns a half-precision floating point NaN value (Not a Number). |
| 1835 | test: none |
| 1836 | end: |
| 1837 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1838 | function: native_acos |
| 1839 | version: 21 |
| 1840 | attrib: const |
| 1841 | w: 1, 2, 3, 4 |
| 1842 | t: f32 |
| 1843 | ret: #2#1 |
| 1844 | arg: #2#1 v, range(-1,1) |
| 1845 | summary: Approximate inverse cosine |
| 1846 | description: |
| 1847 | Returns the approximate inverse cosine, in radians. |
| 1848 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1849 | This function yields undefined results from input values less than -1 or greater than 1. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1850 | |
| 1851 | See also @acos(). |
| 1852 | # TODO Temporary |
| 1853 | test: limited(0.0005) |
| 1854 | end: |
| 1855 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1856 | function: native_acos |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1857 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1858 | attrib: const |
| 1859 | w: 1, 2, 3, 4 |
| 1860 | t: f16 |
| 1861 | ret: #2#1 |
| 1862 | # TODO Need range(-1,1) here similar to the float version? |
| 1863 | arg: #2#1 v |
| 1864 | test: none |
| 1865 | end: |
| 1866 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1867 | function: native_acosh |
| 1868 | version: 21 |
| 1869 | attrib: const |
| 1870 | w: 1, 2, 3, 4 |
| 1871 | t: f32 |
| 1872 | ret: #2#1 |
| 1873 | arg: #2#1 v |
| 1874 | summary: Approximate inverse hyperbolic cosine |
| 1875 | description: |
| 1876 | Returns the approximate inverse hyperbolic cosine, in radians. |
| 1877 | |
| 1878 | See also @acosh(). |
| 1879 | # TODO Temporary |
| 1880 | test: limited(0.0005) |
| 1881 | end: |
| 1882 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1883 | function: native_acosh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1884 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1885 | attrib: const |
| 1886 | w: 1, 2, 3, 4 |
| 1887 | t: f16 |
| 1888 | ret: #2#1 |
| 1889 | arg: #2#1 v |
| 1890 | test: none |
| 1891 | end: |
| 1892 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1893 | function: native_acospi |
| 1894 | version: 21 |
| 1895 | attrib: const |
| 1896 | w: 1, 2, 3, 4 |
| 1897 | t: f32 |
| 1898 | ret: #2#1 |
| 1899 | arg: #2#1 v, range(-1,1) |
| 1900 | summary: Approximate inverse cosine divided by pi |
| 1901 | description: |
| 1902 | Returns the approximate inverse cosine in radians, divided by pi. |
| 1903 | |
| 1904 | To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>. |
| 1905 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1906 | This function yields undefined results from input values less than -1 or greater than 1. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1907 | |
| 1908 | See also @acospi(). |
| 1909 | # TODO Temporary |
| 1910 | test: limited(0.0005) |
| 1911 | end: |
| 1912 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1913 | function: native_acospi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1914 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1915 | attrib: const |
| 1916 | w: 1, 2, 3, 4 |
| 1917 | t: f16 |
| 1918 | ret: #2#1 |
| 1919 | # TODO Need range(-1,1) here similar to the float version? |
| 1920 | arg: #2#1 v |
| 1921 | test: none |
| 1922 | end: |
| 1923 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1924 | function: native_asin |
| 1925 | version: 21 |
| 1926 | attrib: const |
| 1927 | w: 1, 2, 3, 4 |
| 1928 | t: f32 |
| 1929 | ret: #2#1 |
| 1930 | arg: #2#1 v, range(-1,1) |
| 1931 | summary: Approximate inverse sine |
| 1932 | description: |
| 1933 | Returns the approximate inverse sine, in radians. |
| 1934 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1935 | This function yields undefined results from input values less than -1 or greater than 1. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1936 | |
| 1937 | See also @asin(). |
| 1938 | # TODO Temporary |
| 1939 | test: limited(0.0005) |
| 1940 | end: |
| 1941 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1942 | function: native_asin |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1943 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1944 | attrib: const |
| 1945 | w: 1, 2, 3, 4 |
| 1946 | t: f16 |
| 1947 | ret: #2#1 |
| 1948 | # TODO Need range(-1,1) here similar to the float version? |
| 1949 | arg: #2#1 v |
| 1950 | test: none |
| 1951 | end: |
| 1952 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1953 | function: native_asinh |
| 1954 | version: 21 |
| 1955 | attrib: const |
| 1956 | w: 1, 2, 3, 4 |
| 1957 | t: f32 |
| 1958 | ret: #2#1 |
| 1959 | arg: #2#1 v |
| 1960 | summary: Approximate inverse hyperbolic sine |
| 1961 | description: |
| 1962 | Returns the approximate inverse hyperbolic sine, in radians. |
| 1963 | |
| 1964 | See also @asinh(). |
| 1965 | # TODO Temporary |
| 1966 | test: limited(0.0005) |
| 1967 | end: |
| 1968 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1969 | function: native_asinh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 1970 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1971 | attrib: const |
| 1972 | w: 1, 2, 3, 4 |
| 1973 | t: f16 |
| 1974 | ret: #2#1 |
| 1975 | arg: #2#1 v |
| 1976 | test: none |
| 1977 | end: |
| 1978 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1979 | function: native_asinpi |
| 1980 | version: 21 |
| 1981 | attrib: const |
| 1982 | w: 1, 2, 3, 4 |
| 1983 | t: f32 |
| 1984 | ret: #2#1 |
| 1985 | arg: #2#1 v, range(-1,1) |
| 1986 | summary: Approximate inverse sine divided by pi |
| 1987 | description: |
| 1988 | Returns the approximate inverse sine in radians, divided by pi. |
| 1989 | |
| 1990 | To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>. |
| 1991 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 1992 | This function yields undefined results from input values less than -1 or greater than 1. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 1993 | |
| 1994 | See also @asinpi(). |
| 1995 | # TODO Temporary |
| 1996 | test: limited(0.0005) |
| 1997 | end: |
| 1998 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 1999 | function: native_asinpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2000 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2001 | attrib: const |
| 2002 | w: 1, 2, 3, 4 |
| 2003 | t: f16 |
| 2004 | ret: #2#1 |
| 2005 | # TODO Need range(-1,1) here similar to the float version? |
| 2006 | arg: #2#1 v |
| 2007 | test: none |
| 2008 | end: |
| 2009 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2010 | function: native_atan |
| 2011 | version: 21 |
| 2012 | attrib: const |
| 2013 | w: 1, 2, 3, 4 |
| 2014 | t: f32 |
| 2015 | ret: #2#1 |
| 2016 | arg: #2#1 v, range(-1,1) |
| 2017 | summary: Approximate inverse tangent |
| 2018 | description: |
| 2019 | Returns the approximate inverse tangent, in radians. |
| 2020 | |
| 2021 | See also @atan(). |
| 2022 | # TODO Temporary |
| 2023 | test: limited(0.0005) |
| 2024 | end: |
| 2025 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2026 | function: native_atan |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2027 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2028 | attrib: const |
| 2029 | w: 1, 2, 3, 4 |
| 2030 | t: f16 |
| 2031 | ret: #2#1 |
| 2032 | # TODO Need range(-1,1) here similar to the float version? |
| 2033 | arg: #2#1 v |
| 2034 | test: none |
| 2035 | end: |
| 2036 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2037 | function: native_atan2 |
| 2038 | version: 21 |
| 2039 | attrib: const |
| 2040 | w: 1, 2, 3, 4 |
| 2041 | t: f32 |
| 2042 | ret: #2#1 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2043 | arg: #2#1 numerator, "Numerator." |
| 2044 | arg: #2#1 denominator, "Denominator. Can be 0." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2045 | summary: Approximate inverse tangent of a ratio |
| 2046 | description: |
| 2047 | Returns the approximate inverse tangent of <code>(numerator / denominator)</code>, in radians. |
| 2048 | |
| 2049 | See also @atan2(). |
| 2050 | # TODO Temporary |
| 2051 | test: limited(0.0005) |
| 2052 | end: |
| 2053 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2054 | function: native_atan2 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2055 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2056 | attrib: const |
| 2057 | w: 1, 2, 3, 4 |
| 2058 | t: f16 |
| 2059 | ret: #2#1 |
| 2060 | arg: #2#1 numerator |
| 2061 | arg: #2#1 denominator |
| 2062 | test: none |
| 2063 | end: |
| 2064 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2065 | function: native_atan2pi |
| 2066 | version: 21 |
| 2067 | attrib: const |
| 2068 | w: 1, 2, 3, 4 |
| 2069 | t: f32 |
| 2070 | ret: #2#1 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2071 | arg: #2#1 numerator, "Numerator." |
| 2072 | arg: #2#1 denominator, "Denominator. Can be 0." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2073 | summary: Approximate inverse tangent of a ratio, divided by pi |
| 2074 | description: |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2075 | Returns the approximate inverse tangent of <code>(numerator / denominator)</code>, |
| 2076 | in radians, divided by pi. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2077 | |
| 2078 | To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>. |
| 2079 | |
| 2080 | See also @atan2pi(). |
| 2081 | # TODO Temporary |
| 2082 | test: limited(0.0005) |
| 2083 | end: |
| 2084 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2085 | function: native_atan2pi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2086 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2087 | attrib: const |
| 2088 | w: 1, 2, 3, 4 |
| 2089 | t: f16 |
| 2090 | ret: #2#1 |
| 2091 | arg: #2#1 numerator |
| 2092 | arg: #2#1 denominator |
| 2093 | test: none |
| 2094 | end: |
| 2095 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2096 | function: native_atanh |
| 2097 | version: 21 |
| 2098 | attrib: const |
| 2099 | w: 1, 2, 3, 4 |
| 2100 | t: f32 |
| 2101 | ret: #2#1 |
| 2102 | arg: #2#1 v, range(-1,1) |
| 2103 | summary: Approximate inverse hyperbolic tangent |
| 2104 | description: |
| 2105 | Returns the approximate inverse hyperbolic tangent, in radians. |
| 2106 | |
| 2107 | See also @atanh(). |
| 2108 | # TODO Temporary |
| 2109 | test: limited(0.0005) |
| 2110 | end: |
| 2111 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2112 | function: native_atanh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2113 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2114 | attrib: const |
| 2115 | w: 1, 2, 3, 4 |
| 2116 | t: f16 |
| 2117 | ret: #2#1 |
| 2118 | # TODO Need range(-1,1) here similar to the float version? |
| 2119 | arg: #2#1 v |
| 2120 | test: none |
| 2121 | end: |
| 2122 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2123 | function: native_atanpi |
| 2124 | version: 21 |
| 2125 | attrib: const |
| 2126 | w: 1, 2, 3, 4 |
| 2127 | t: f32 |
| 2128 | ret: #2#1 |
| 2129 | arg: #2#1 v, range(-1,1) |
| 2130 | summary: Approximate inverse tangent divided by pi |
| 2131 | description: |
| 2132 | Returns the approximate inverse tangent in radians, divided by pi. |
| 2133 | |
| 2134 | To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>. |
| 2135 | |
| 2136 | See also @atanpi(). |
| 2137 | # TODO Temporary |
| 2138 | test: limited(0.0005) |
| 2139 | end: |
| 2140 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2141 | function: native_atanpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2142 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2143 | attrib: const |
| 2144 | w: 1, 2, 3, 4 |
| 2145 | t: f16 |
| 2146 | ret: #2#1 |
| 2147 | # TODO Need range(-1,1) here similar to the float version? |
| 2148 | arg: #2#1 v |
| 2149 | test: none |
| 2150 | end: |
| 2151 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2152 | function: native_cbrt |
| 2153 | version: 21 |
| 2154 | attrib: const |
| 2155 | w: 1, 2, 3, 4 |
| 2156 | t: f32 |
| 2157 | ret: #2#1 |
| 2158 | arg: #2#1 v |
| 2159 | summary: Approximate cube root |
| 2160 | description: |
| 2161 | Returns the approximate cubic root. |
| 2162 | |
| 2163 | See also @cbrt(). |
| 2164 | end: |
| 2165 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2166 | function: native_cbrt |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2167 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2168 | attrib: const |
| 2169 | w: 1, 2, 3, 4 |
| 2170 | t: f16 |
| 2171 | ret: #2#1 |
| 2172 | arg: #2#1 v |
| 2173 | test: none |
| 2174 | end: |
| 2175 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2176 | function: native_cos |
| 2177 | version: 21 |
| 2178 | attrib: const |
| 2179 | w: 1, 2, 3, 4 |
| 2180 | t: f32 |
| 2181 | ret: #2#1 |
| 2182 | arg: #2#1 v |
| 2183 | summary: Approximate cosine |
| 2184 | description: |
| 2185 | Returns the approximate cosine of an angle measured in radians. |
| 2186 | |
| 2187 | See also @cos(). |
| 2188 | end: |
| 2189 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2190 | function: native_cos |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2191 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2192 | attrib: const |
| 2193 | w: 1, 2, 3, 4 |
| 2194 | t: f16 |
| 2195 | ret: #2#1 |
| 2196 | arg: #2#1 v |
| 2197 | test: none |
| 2198 | end: |
| 2199 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2200 | function: native_cosh |
| 2201 | version: 21 |
| 2202 | attrib: const |
| 2203 | w: 1, 2, 3, 4 |
| 2204 | t: f32 |
| 2205 | ret: #2#1 |
| 2206 | arg: #2#1 v |
| 2207 | summary: Approximate hypebolic cosine |
| 2208 | description: |
| 2209 | Returns the approximate hypebolic cosine. |
| 2210 | |
| 2211 | See also @cosh(). |
| 2212 | end: |
| 2213 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2214 | function: native_cosh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2215 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2216 | attrib: const |
| 2217 | w: 1, 2, 3, 4 |
| 2218 | t: f16 |
| 2219 | ret: #2#1 |
| 2220 | arg: #2#1 v |
| 2221 | test: none |
| 2222 | end: |
| 2223 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2224 | function: native_cospi |
| 2225 | version: 21 |
| 2226 | attrib: const |
| 2227 | w: 1, 2, 3, 4 |
| 2228 | t: f32 |
| 2229 | ret: #2#1 |
| 2230 | arg: #2#1 v |
| 2231 | summary: Approximate cosine of a number multiplied by pi |
| 2232 | description: |
| 2233 | Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians. |
| 2234 | |
| 2235 | To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>. |
| 2236 | |
| 2237 | See also @cospi(). |
| 2238 | end: |
| 2239 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2240 | function: native_cospi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2241 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2242 | attrib: const |
| 2243 | w: 1, 2, 3, 4 |
| 2244 | t: f16 |
| 2245 | ret: #2#1 |
| 2246 | arg: #2#1 v |
| 2247 | test: none |
| 2248 | end: |
| 2249 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2250 | function: native_divide |
| 2251 | version: 21 |
| 2252 | attrib: const |
| 2253 | w: 1, 2, 3, 4 |
| 2254 | t: f32 |
| 2255 | ret: #2#1 |
| 2256 | arg: #2#1 left_vector |
| 2257 | arg: #2#1 right_vector |
| 2258 | summary: Approximate division |
| 2259 | description: |
| 2260 | Computes the approximate division of two values. |
| 2261 | end: |
| 2262 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2263 | function: native_divide |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2264 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2265 | attrib: const |
| 2266 | w: 1, 2, 3, 4 |
| 2267 | t: f16 |
| 2268 | ret: #2#1 |
| 2269 | arg: #2#1 left_vector |
| 2270 | arg: #2#1 right_vector |
| 2271 | test: none |
| 2272 | end: |
| 2273 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2274 | function: native_exp |
| 2275 | version: 18 |
| 2276 | attrib: const |
| 2277 | w: 1, 2, 3, 4 |
| 2278 | t: f32 |
| 2279 | ret: #2#1 |
| 2280 | arg: #2#1 v, range(-86,86) |
| 2281 | summary: Approximate e raised to a number |
| 2282 | description: |
| 2283 | Fast approximate exp. |
| 2284 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2285 | It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be |
| 2286 | expected from using 16 bit floating point values. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2287 | |
| 2288 | See also @exp(). |
| 2289 | test: limited |
| 2290 | end: |
| 2291 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2292 | function: native_exp |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2293 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2294 | attrib: const |
| 2295 | w: 1, 2, 3, 4 |
| 2296 | t: f16 |
| 2297 | ret: #2#1 |
| 2298 | # TODO Need range(-86, 86) here similar to the float version? |
| 2299 | arg: #2#1 v |
| 2300 | test: none |
| 2301 | end: |
| 2302 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2303 | function: native_exp10 |
| 2304 | version: 18 |
| 2305 | attrib: const |
| 2306 | w: 1, 2, 3, 4 |
| 2307 | t: f32 |
| 2308 | ret: #2#1 |
| 2309 | arg: #2#1 v, range(-37,37) |
| 2310 | summary: Approximate 10 raised to a number |
| 2311 | description: |
| 2312 | Fast approximate exp10. |
| 2313 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2314 | It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be |
| 2315 | expected from using 16 bit floating point values. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2316 | |
| 2317 | See also @exp10(). |
| 2318 | test: limited |
| 2319 | end: |
| 2320 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2321 | function: native_exp10 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2322 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2323 | attrib: const |
| 2324 | w: 1, 2, 3, 4 |
| 2325 | t: f16 |
| 2326 | ret: #2#1 |
| 2327 | # TODO Need range(-37, 37) here similar to the float version? |
| 2328 | arg: #2#1 v |
| 2329 | test: none |
| 2330 | end: |
| 2331 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2332 | function: native_exp2 |
| 2333 | version: 18 |
| 2334 | attrib: const |
| 2335 | w: 1, 2, 3, 4 |
| 2336 | t: f32 |
| 2337 | ret: #2#1 |
| 2338 | arg: #2#1 v, range(-125,125) |
| 2339 | summary: Approximate 2 raised to a number |
| 2340 | description: |
| 2341 | Fast approximate exp2. |
| 2342 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2343 | It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be |
| 2344 | expected from using 16 bit floating point values. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2345 | |
| 2346 | See also @exp2(). |
| 2347 | test: limited |
| 2348 | end: |
| 2349 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2350 | function: native_exp2 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2351 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2352 | attrib: const |
| 2353 | w: 1, 2, 3, 4 |
| 2354 | t: f16 |
| 2355 | ret: #2#1 |
| 2356 | # TODO Need range(-125, 125) here similar to the float version? |
| 2357 | arg: #2#1 v |
| 2358 | test: none |
| 2359 | end: |
| 2360 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2361 | function: native_expm1 |
| 2362 | version: 21 |
| 2363 | attrib: const |
| 2364 | w: 1, 2, 3, 4 |
| 2365 | t: f32 |
| 2366 | ret: #2#1 |
| 2367 | arg: #2#1 v |
| 2368 | summary: Approximate e raised to a number minus one |
| 2369 | description: |
| 2370 | Returns the approximate (e ^ v) - 1. |
| 2371 | |
| 2372 | See also @expm1(). |
| 2373 | end: |
| 2374 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2375 | function: native_expm1 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2376 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2377 | attrib: const |
| 2378 | w: 1, 2, 3, 4 |
| 2379 | t: f16 |
| 2380 | ret: #2#1 |
| 2381 | arg: #2#1 v |
| 2382 | test: none |
| 2383 | end: |
| 2384 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2385 | function: native_hypot |
| 2386 | version: 21 |
| 2387 | attrib: const |
| 2388 | w: 1, 2, 3, 4 |
| 2389 | t: f32 |
| 2390 | ret: #2#1 |
| 2391 | arg: #2#1 a |
| 2392 | arg: #2#1 b |
| 2393 | summary: Approximate hypotenuse |
| 2394 | description: |
| 2395 | Returns the approximate native_sqrt(a * a + b * b) |
| 2396 | |
| 2397 | See also @hypot(). |
| 2398 | end: |
| 2399 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2400 | function: native_hypot |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2401 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2402 | attrib: const |
| 2403 | w: 1, 2, 3, 4 |
| 2404 | t: f16 |
| 2405 | ret: #2#1 |
| 2406 | arg: #2#1 a |
| 2407 | arg: #2#1 b |
| 2408 | test: none |
| 2409 | end: |
| 2410 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2411 | function: native_log |
| 2412 | version: 18 |
| 2413 | attrib: const |
| 2414 | w: 1, 2, 3, 4 |
| 2415 | t: f32 |
| 2416 | ret: #2#1 |
| 2417 | arg: #2#1 v, range(10e-10,10e10) |
| 2418 | summary: Approximate natural logarithm |
| 2419 | description: |
| 2420 | Fast approximate log. |
| 2421 | |
| 2422 | It is not accurate for values very close to zero. |
| 2423 | |
| 2424 | See also @log(). |
| 2425 | test: limited |
| 2426 | end: |
| 2427 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2428 | function: native_log |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2429 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2430 | attrib: const |
| 2431 | w: 1, 2, 3, 4 |
| 2432 | t: f16 |
| 2433 | ret: #2#1 |
| 2434 | # TODO Need range(10e-10,10e10) here similar to the float version? |
| 2435 | arg: #2#1 v |
| 2436 | test: none |
| 2437 | end: |
| 2438 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2439 | function: native_log10 |
| 2440 | version: 18 |
| 2441 | attrib: const |
| 2442 | w: 1, 2, 3, 4 |
| 2443 | t: f32 |
| 2444 | ret: #2#1 |
| 2445 | arg: #2#1 v, range(10e-10,10e10) |
| 2446 | summary: Approximate base 10 logarithm |
| 2447 | description: |
| 2448 | Fast approximate log10. |
| 2449 | |
| 2450 | It is not accurate for values very close to zero. |
| 2451 | |
| 2452 | See also @log10(). |
| 2453 | test: limited |
| 2454 | end: |
| 2455 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2456 | function: native_log10 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2457 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2458 | attrib: const |
| 2459 | w: 1, 2, 3, 4 |
| 2460 | t: f16 |
| 2461 | ret: #2#1 |
| 2462 | # TODO Need range(10e-10,10e10) here similar to the float version? |
| 2463 | arg: #2#1 v |
| 2464 | test: none |
| 2465 | end: |
| 2466 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2467 | function: native_log1p |
| 2468 | version: 21 |
| 2469 | attrib: const |
| 2470 | w: 1, 2, 3, 4 |
| 2471 | t: f32 |
| 2472 | ret: #2#1 |
| 2473 | arg: #2#1 v |
| 2474 | summary: Approximate natural logarithm of a value plus 1 |
| 2475 | description: |
| 2476 | Returns the approximate natural logarithm of (v + 1.0f) |
| 2477 | |
| 2478 | See also @log1p(). |
| 2479 | end: |
| 2480 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2481 | function: native_log1p |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2482 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2483 | attrib: const |
| 2484 | w: 1, 2, 3, 4 |
| 2485 | t: f16 |
| 2486 | ret: #2#1 |
| 2487 | arg: #2#1 v |
| 2488 | test: none |
| 2489 | end: |
| 2490 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2491 | function: native_log2 |
| 2492 | version: 18 |
| 2493 | attrib: const |
| 2494 | w: 1, 2, 3, 4 |
| 2495 | t: f32 |
| 2496 | ret: #2#1 |
| 2497 | arg: #2#1 v, range(10e-10,10e10) |
| 2498 | summary: Approximate base 2 logarithm |
| 2499 | description: |
| 2500 | Fast approximate log2. |
| 2501 | |
| 2502 | It is not accurate for values very close to zero. |
| 2503 | |
| 2504 | See also @log2(). |
| 2505 | test: limited |
| 2506 | end: |
| 2507 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2508 | function: native_log2 |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2509 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2510 | attrib: const |
| 2511 | w: 1, 2, 3, 4 |
| 2512 | t: f16 |
| 2513 | ret: #2#1 |
| 2514 | # TODO Need range(10e-10,10e10) here similar to the float version? |
| 2515 | arg: #2#1 v |
| 2516 | test: none |
| 2517 | end: |
| 2518 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2519 | function: native_powr |
| 2520 | version: 18 |
| 2521 | attrib: const |
| 2522 | w: 1, 2, 3, 4 |
| 2523 | t: f32 |
| 2524 | ret: #2#1 |
| 2525 | arg: #2#1 base, range(0,256), "Must be between 0.f and 256.f. The function is not accurate for values very close to zero." |
| 2526 | arg: #2#1 exponent, range(-15,15), "Must be between -15.f and 15.f." |
| 2527 | summary: Approximate positive base raised to an exponent |
| 2528 | description: |
| 2529 | Fast approximate (base ^ exponent). |
| 2530 | |
| 2531 | See also @powr(). |
| 2532 | test: limited |
| 2533 | end: |
| 2534 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2535 | function: native_powr |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2536 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2537 | attrib: const |
| 2538 | w: 1, 2, 3, 4 |
| 2539 | t: f16 |
| 2540 | ret: #2#1 |
| 2541 | # TODO Need range(0, 256) here similar to the float version? |
| 2542 | arg: #2#1 base |
| 2543 | # TODO Need range(-15,15) here similar to the float version? |
| 2544 | arg: #2#1 exponent |
| 2545 | test: none |
| 2546 | end: |
| 2547 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2548 | function: native_recip |
| 2549 | version: 21 |
| 2550 | attrib: const |
| 2551 | w: 1, 2, 3, 4 |
| 2552 | t: f32 |
| 2553 | ret: #2#1 |
| 2554 | arg: #2#1 v |
| 2555 | summary: Approximate reciprocal |
| 2556 | description: |
| 2557 | Returns the approximate approximate reciprocal of a value. |
| 2558 | |
| 2559 | See also @half_recip(). |
| 2560 | end: |
| 2561 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2562 | function: native_recip |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2563 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2564 | attrib: const |
| 2565 | w: 1, 2, 3, 4 |
| 2566 | t: f16 |
| 2567 | ret: #2#1 |
| 2568 | arg: #2#1 v |
| 2569 | test: none |
| 2570 | end: |
| 2571 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2572 | function: native_rootn |
| 2573 | version: 21 |
| 2574 | attrib: const |
| 2575 | w: 1, 2, 3, 4 |
| 2576 | t: f32 |
| 2577 | ret: #2#1 |
| 2578 | arg: #2#1 v |
| 2579 | arg: int#1 n |
| 2580 | summary: Approximate nth root |
| 2581 | description: |
| 2582 | Compute the approximate Nth root of a value. |
| 2583 | |
| 2584 | See also @rootn(). |
| 2585 | end: |
| 2586 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2587 | function: native_rootn |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2588 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2589 | attrib: const |
| 2590 | w: 1, 2, 3, 4 |
| 2591 | t: f16 |
| 2592 | ret: #2#1 |
| 2593 | arg: #2#1 v |
| 2594 | arg: int#1 n |
| 2595 | test: none |
| 2596 | end: |
| 2597 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2598 | function: native_rsqrt |
| 2599 | version: 21 |
| 2600 | attrib: const |
| 2601 | w: 1, 2, 3, 4 |
| 2602 | t: f32 |
| 2603 | ret: #2#1 |
| 2604 | arg: #2#1 v |
| 2605 | summary: Approximate reciprocal of a square root |
| 2606 | description: |
| 2607 | Returns approximate (1 / sqrt(v)). |
| 2608 | |
| 2609 | See also @rsqrt(), @half_rsqrt(). |
| 2610 | end: |
| 2611 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2612 | function: native_rsqrt |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2613 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2614 | attrib: const |
| 2615 | w: 1, 2, 3, 4 |
| 2616 | t: f16 |
| 2617 | ret: #2#1 |
| 2618 | arg: #2#1 v |
| 2619 | test: none |
| 2620 | end: |
| 2621 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2622 | function: native_sin |
| 2623 | version: 21 |
| 2624 | attrib: const |
| 2625 | w: 1, 2, 3, 4 |
| 2626 | t: f32 |
| 2627 | ret: #2#1 |
| 2628 | arg: #2#1 v |
| 2629 | summary: Approximate sine |
| 2630 | description: |
| 2631 | Returns the approximate sine of an angle measured in radians. |
| 2632 | |
| 2633 | See also @sin(). |
| 2634 | end: |
| 2635 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2636 | function: native_sin |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2637 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2638 | attrib: const |
| 2639 | w: 1, 2, 3, 4 |
| 2640 | t: f16 |
| 2641 | ret: #2#1 |
| 2642 | arg: #2#1 v |
| 2643 | test: none |
| 2644 | end: |
| 2645 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2646 | function: native_sincos |
| 2647 | version: 21 |
| 2648 | w: 1, 2, 3, 4 |
| 2649 | t: f32 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2650 | ret: #2#1, "Sine." |
| 2651 | arg: #2#1 v, "Incoming value in radians." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2652 | arg: #2#1* cos, "*cos will be set to the cosine value." |
| 2653 | summary: Approximate sine and cosine |
| 2654 | description: |
| 2655 | Returns the approximate sine and cosine of a value. |
| 2656 | |
| 2657 | See also @sincos(). |
| 2658 | # TODO Temporary |
| 2659 | test: limited(0.0005) |
| 2660 | end: |
| 2661 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2662 | function: native_sincos |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2663 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2664 | w: 1, 2, 3, 4 |
| 2665 | t: f16 |
| 2666 | ret: #2#1 |
| 2667 | arg: #2#1 v |
| 2668 | arg: #2#1* cos |
| 2669 | test: none |
| 2670 | end: |
| 2671 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2672 | function: native_sinh |
| 2673 | version: 21 |
| 2674 | attrib: const |
| 2675 | w: 1, 2, 3, 4 |
| 2676 | t: f32 |
| 2677 | ret: #2#1 |
| 2678 | arg: #2#1 v |
| 2679 | summary: Approximate hyperbolic sine |
| 2680 | description: |
| 2681 | Returns the approximate hyperbolic sine of a value specified in radians. |
| 2682 | |
| 2683 | See also @sinh(). |
| 2684 | end: |
| 2685 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2686 | function: native_sinh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2687 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2688 | attrib: const |
| 2689 | w: 1, 2, 3, 4 |
| 2690 | t: f16 |
| 2691 | ret: #2#1 |
| 2692 | arg: #2#1 v |
| 2693 | test: none |
| 2694 | end: |
| 2695 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2696 | function: native_sinpi |
| 2697 | version: 21 |
| 2698 | attrib: const |
| 2699 | w: 1, 2, 3, 4 |
| 2700 | t: f32 |
| 2701 | ret: #2#1 |
| 2702 | arg: #2#1 v |
| 2703 | summary: Approximate sine of a number multiplied by pi |
| 2704 | description: |
| 2705 | Returns the approximate sine of (v * pi), where (v * pi) is measured in radians. |
| 2706 | |
| 2707 | To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>. |
| 2708 | |
| 2709 | See also @sinpi(). |
| 2710 | end: |
| 2711 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2712 | function: native_sinpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2713 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2714 | attrib: const |
| 2715 | w: 1, 2, 3, 4 |
| 2716 | t: f16 |
| 2717 | ret: #2#1 |
| 2718 | arg: #2#1 v |
| 2719 | test: none |
| 2720 | end: |
| 2721 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2722 | function: native_sqrt |
| 2723 | version: 21 |
| 2724 | attrib: const |
| 2725 | w: 1, 2, 3, 4 |
| 2726 | t: f32 |
| 2727 | ret: #2#1 |
| 2728 | arg: #2#1 v |
| 2729 | summary: Approximate square root |
| 2730 | description: |
| 2731 | Returns the approximate sqrt(v). |
| 2732 | |
| 2733 | See also @sqrt(), @half_sqrt(). |
| 2734 | end: |
| 2735 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2736 | function: native_sqrt |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2737 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2738 | attrib: const |
| 2739 | w: 1, 2, 3, 4 |
| 2740 | t: f16 |
| 2741 | ret: #2#1 |
| 2742 | arg: #2#1 v |
| 2743 | test: none |
| 2744 | end: |
| 2745 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2746 | function: native_tan |
| 2747 | version: 21 |
| 2748 | attrib: const |
| 2749 | w: 1, 2, 3, 4 |
| 2750 | t: f32 |
| 2751 | ret: #2#1 |
| 2752 | arg: #2#1 v |
| 2753 | summary: Approximate tangent |
| 2754 | description: |
| 2755 | Returns the approximate tangent of an angle measured in radians. |
| 2756 | end: |
| 2757 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2758 | function: native_tan |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2759 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2760 | attrib: const |
| 2761 | w: 1, 2, 3, 4 |
| 2762 | t: f16 |
| 2763 | ret: #2#1 |
| 2764 | arg: #2#1 v |
| 2765 | test: none |
| 2766 | end: |
| 2767 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2768 | function: native_tanh |
| 2769 | version: 21 |
| 2770 | attrib: const |
| 2771 | w: 1, 2, 3, 4 |
| 2772 | t: f32 |
| 2773 | ret: #2#1 |
| 2774 | arg: #2#1 v |
| 2775 | summary: Approximate hyperbolic tangent |
| 2776 | description: |
| 2777 | Returns the approximate hyperbolic tangent of a value. |
| 2778 | |
| 2779 | See also @tanh(). |
| 2780 | end: |
| 2781 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2782 | function: native_tanh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2783 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2784 | attrib: const |
| 2785 | w: 1, 2, 3, 4 |
| 2786 | t: f16 |
| 2787 | ret: #2#1 |
| 2788 | arg: #2#1 v |
| 2789 | test: none |
| 2790 | end: |
| 2791 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2792 | function: native_tanpi |
| 2793 | version: 21 |
| 2794 | attrib: const |
| 2795 | w: 1, 2, 3, 4 |
| 2796 | t: f32 |
| 2797 | ret: #2#1 |
| 2798 | arg: #2#1 v |
| 2799 | summary: Approximate tangent of a number multiplied by pi |
| 2800 | description: |
| 2801 | Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians. |
| 2802 | |
| 2803 | To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>. |
| 2804 | |
| 2805 | See also @tanpi(). |
| 2806 | end: |
| 2807 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2808 | function: native_tanpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2809 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2810 | attrib: const |
| 2811 | w: 1, 2, 3, 4 |
| 2812 | t: f16 |
| 2813 | ret: #2#1 |
| 2814 | arg: #2#1 v |
| 2815 | test: none |
| 2816 | end: |
| 2817 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2818 | function: nextafter |
| 2819 | version: 9 |
| 2820 | attrib: const |
| 2821 | w: 1, 2, 3, 4 |
| 2822 | t: f32 |
| 2823 | ret: #2#1 |
| 2824 | arg: #2#1 v |
| 2825 | arg: #2#1 target |
| 2826 | summary: Next floating point number |
| 2827 | description: |
| 2828 | Returns the next representable floating point number from v towards target. |
| 2829 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2830 | In rs_fp_relaxed mode, a denormalized input value may not yield the next denormalized |
| 2831 | value, as support of denormalized values is optional in relaxed mode. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2832 | end: |
| 2833 | |
Pirama Arumuga Nainar | d021b48 | 2016-02-04 11:40:05 -0800 | [diff] [blame] | 2834 | function: nextafter |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2835 | version: 24 |
Pirama Arumuga Nainar | d021b48 | 2016-02-04 11:40:05 -0800 | [diff] [blame] | 2836 | attrib: const |
| 2837 | w: 1, 2, 3, 4 |
| 2838 | t: f16 |
| 2839 | ret: #2#1 |
| 2840 | arg: #2#1 v |
| 2841 | arg: #2#1 target |
| 2842 | test: none |
| 2843 | end: |
| 2844 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2845 | function: pow |
| 2846 | version: 9 |
| 2847 | attrib: const |
| 2848 | w: 1, 2, 3, 4 |
| 2849 | t: f32 |
| 2850 | ret: #2#1 |
| 2851 | arg: #2#1 base |
| 2852 | arg: #2#1 exponent |
| 2853 | summary: Base raised to an exponent |
| 2854 | description: |
| 2855 | Returns base raised to the power exponent, i.e. base ^ exponent. |
| 2856 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2857 | @pown() and @powr() are similar. @pown() takes an integer exponent. @powr() assumes the |
| 2858 | base to be non-negative. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2859 | end: |
| 2860 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2861 | function: pow |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2862 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2863 | attrib: const |
| 2864 | w: 1, 2, 3, 4 |
| 2865 | t: f16 |
| 2866 | ret: #2#1 |
| 2867 | arg: #2#1 base |
| 2868 | arg: #2#1 exponent |
| 2869 | test: none |
| 2870 | end: |
| 2871 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2872 | function: pown |
| 2873 | version: 9 |
| 2874 | attrib: const |
| 2875 | w: 1, 2, 3, 4 |
| 2876 | t: f32 |
| 2877 | ret: #2#1 |
| 2878 | arg: #2#1 base |
| 2879 | arg: int#1 exponent |
| 2880 | summary: Base raised to an integer exponent |
| 2881 | description: |
| 2882 | Returns base raised to the power exponent, i.e. base ^ exponent. |
| 2883 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2884 | @pow() and @powr() are similar. The both take a float exponent. @powr() also assumes the |
| 2885 | base to be non-negative. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2886 | end: |
| 2887 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2888 | function: pown |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2889 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2890 | attrib: const |
| 2891 | w: 1, 2, 3, 4 |
| 2892 | t: f16 |
| 2893 | ret: #2#1 |
| 2894 | arg: #2#1 base |
| 2895 | arg: int#1 exponent |
| 2896 | test: none |
| 2897 | end: |
| 2898 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2899 | function: powr |
| 2900 | version: 9 |
| 2901 | attrib: const |
| 2902 | w: 1, 2, 3, 4 |
| 2903 | t: f32 |
| 2904 | ret: #2#1 |
| 2905 | arg: #2#1 base, range(0,3000) |
| 2906 | arg: #2#1 exponent |
| 2907 | summary: Positive base raised to an exponent |
| 2908 | description: |
| 2909 | Returns base raised to the power exponent, i.e. base ^ exponent. base must be >= 0. |
| 2910 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2911 | @pow() and @pown() are similar. They both make no assumptions about the base. |
| 2912 | @pow() takes a float exponent while @pown() take an integer. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2913 | |
| 2914 | See also @native_powr(). |
| 2915 | end: |
| 2916 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2917 | function: powr |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2918 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2919 | attrib: const |
| 2920 | w: 1, 2, 3, 4 |
| 2921 | t: f16 |
| 2922 | ret: #2#1 |
| 2923 | # TODO Need range(0,3000) here similar to the float version? |
| 2924 | arg: #2#1 base |
| 2925 | arg: #2#1 exponent |
| 2926 | test: none |
| 2927 | end: |
| 2928 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2929 | function: radians |
| 2930 | version: 9 |
| 2931 | attrib: const |
| 2932 | w: 1, 2, 3, 4 |
| 2933 | t: f32 |
| 2934 | ret: #2#1 |
| 2935 | arg: #2#1 v |
| 2936 | summary: Converts degrees into radians |
| 2937 | description: |
| 2938 | Converts from degrees to radians. |
| 2939 | end: |
| 2940 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2941 | function: radians |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2942 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2943 | attrib: const |
| 2944 | w: 1, 2, 3, 4 |
| 2945 | t: f16 |
| 2946 | ret: #2#1 |
| 2947 | arg: #2#1 v |
| 2948 | test: none |
| 2949 | end: |
| 2950 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2951 | function: remainder |
| 2952 | version: 9 |
| 2953 | attrib: const |
| 2954 | w: 1, 2, 3, 4 |
| 2955 | t: f32 |
| 2956 | ret: #2#1 |
| 2957 | arg: #2#1 numerator |
| 2958 | arg: #2#1 denominator |
| 2959 | summary: Remainder of a division |
| 2960 | description: |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2961 | Returns the remainder of (numerator / denominator), where the quotient is rounded towards |
| 2962 | the nearest integer. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2963 | |
| 2964 | The function @fmod() is similar but rounds toward the closest interger. |
| 2965 | For example, <code>@fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f) |
| 2966 | while <code>remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f). |
| 2967 | end: |
| 2968 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2969 | function: remainder |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 2970 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 2971 | attrib: const |
| 2972 | w: 1, 2, 3, 4 |
| 2973 | t: f16 |
| 2974 | ret: #2#1 |
| 2975 | arg: #2#1 numerator |
| 2976 | arg: #2#1 denominator |
| 2977 | test: none |
| 2978 | end: |
| 2979 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2980 | function: remquo |
| 2981 | version: 9 |
| 2982 | w: 1, 2, 3, 4 |
| 2983 | t: f32 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2984 | ret: #2#1, "Remainder, precise only for the low three bits." |
| 2985 | arg: #2#1 numerator, "Numerator." |
| 2986 | arg: #2#1 denominator, "Denominator." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2987 | arg: int#1* quotient, "*quotient will be set to the integer quotient." |
| 2988 | summary: Remainder and quotient of a division |
| 2989 | description: |
| 2990 | Returns the quotient and the remainder of (numerator / denominator). |
| 2991 | |
| 2992 | Only the sign and lowest three bits of the quotient are guaranteed to be accurate. |
| 2993 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2994 | This function is useful for implementing periodic functions. The low three bits of the |
| 2995 | quotient gives the quadrant and the remainder the distance within the quadrant. |
| 2996 | For example, an implementation of @sin(x) could call <code>remquo(x, PI / 2.f, &quadrant)</code> |
| 2997 | to reduce very large value of x to something within a limited range. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 2998 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 2999 | Example: <code>remquo(-23.5f, 8.f, &quot)</code> sets the lowest three bits of quot to 3 |
| 3000 | and the sign negative. It returns 0.5f. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3001 | test: custom |
| 3002 | end: |
| 3003 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3004 | function: remquo |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3005 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3006 | w: 1, 2, 3, 4 |
| 3007 | t: f16 |
| 3008 | ret: #2#1 |
| 3009 | arg: #2#1 numerator |
| 3010 | arg: #2#1 denominator |
| 3011 | arg: int#1* quotient |
| 3012 | test: none |
| 3013 | end: |
| 3014 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3015 | function: rint |
| 3016 | version: 9 |
| 3017 | attrib: const |
| 3018 | w: 1, 2, 3, 4 |
| 3019 | t: f32 |
| 3020 | ret: #2#1 |
| 3021 | arg: #2#1 v |
| 3022 | summary: Round to even |
| 3023 | description: |
| 3024 | Rounds to the nearest integral value. |
| 3025 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 3026 | rint() rounds half values to even. For example, <code>rint(0.5f)</code> returns 0.f and |
| 3027 | <code>rint(1.5f)</code> returns 2.f. Similarly, <code>rint(-0.5f)</code> returns -0.f and |
| 3028 | <code>rint(-1.5f)</code> returns -2.f. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3029 | |
| 3030 | @round() is similar but rounds away from zero. @trunc() truncates the decimal fraction. |
| 3031 | end: |
| 3032 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3033 | function: rint |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3034 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3035 | attrib: const |
| 3036 | w: 1, 2, 3, 4 |
| 3037 | t: f16 |
| 3038 | ret: #2#1 |
| 3039 | arg: #2#1 v |
| 3040 | test: none |
| 3041 | end: |
| 3042 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3043 | function: rootn |
| 3044 | version: 9 |
| 3045 | attrib: const |
| 3046 | w: 1, 2, 3, 4 |
| 3047 | t: f32 |
| 3048 | ret: #2#1 |
| 3049 | arg: #2#1 v |
| 3050 | arg: int#1 n |
| 3051 | summary: Nth root |
| 3052 | description: |
| 3053 | Compute the Nth root of a value. |
| 3054 | |
| 3055 | See also @native_rootn(). |
| 3056 | end: |
| 3057 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3058 | function: rootn |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3059 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3060 | attrib: const |
| 3061 | w: 1, 2, 3, 4 |
| 3062 | t: f16 |
| 3063 | ret: #2#1 |
| 3064 | arg: #2#1 v |
| 3065 | arg: int#1 n |
| 3066 | test: none |
| 3067 | end: |
| 3068 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3069 | function: round |
| 3070 | version: 9 |
| 3071 | attrib: const |
| 3072 | w: 1, 2, 3, 4 |
| 3073 | t: f32 |
| 3074 | ret: #2#1 |
| 3075 | arg: #2#1 v |
| 3076 | summary: Round away from zero |
| 3077 | description: |
| 3078 | Round to the nearest integral value. |
| 3079 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 3080 | round() rounds half values away from zero. For example, <code>round(0.5f)</code> returns 1.f |
| 3081 | and <code>round(1.5f)</code> returns 2.f. Similarly, <code>round(-0.5f)</code> returns -1.f |
| 3082 | and <code>round(-1.5f)</code> returns -2.f. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3083 | |
| 3084 | @rint() is similar but rounds half values toward even. @trunc() truncates the decimal fraction. |
| 3085 | end: |
| 3086 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3087 | function: round |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3088 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3089 | attrib: const |
| 3090 | w: 1, 2, 3, 4 |
| 3091 | t: f16 |
| 3092 | ret: #2#1 |
| 3093 | arg: #2#1 v |
| 3094 | test: none |
| 3095 | end: |
| 3096 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3097 | function: rsqrt |
| 3098 | version: 9 |
| 3099 | attrib: const |
| 3100 | w: 1, 2, 3, 4 |
| 3101 | t: f32 |
| 3102 | ret: #2#1 |
| 3103 | arg: #2#1 v |
| 3104 | summary: Reciprocal of a square root |
| 3105 | description: |
| 3106 | Returns (1 / sqrt(v)). |
| 3107 | |
| 3108 | See also @half_rsqrt(), @native_rsqrt(). |
| 3109 | end: |
| 3110 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3111 | function: rsqrt |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3112 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3113 | attrib: const |
| 3114 | w: 1, 2, 3, 4 |
| 3115 | t: f16 |
| 3116 | ret: #2#1 |
| 3117 | arg: #2#1 v |
| 3118 | test: none |
| 3119 | end: |
| 3120 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3121 | function: sign |
| 3122 | version: 9 |
| 3123 | attrib: const |
| 3124 | w: 1, 2, 3, 4 |
| 3125 | t: f32 |
| 3126 | ret: #2#1 |
| 3127 | arg: #2#1 v |
| 3128 | summary: Sign of a value |
| 3129 | description: |
| 3130 | Returns the sign of a value. |
| 3131 | |
| 3132 | if (v < 0) return -1.f; |
| 3133 | else if (v > 0) return 1.f; |
| 3134 | else return 0.f; |
| 3135 | end: |
| 3136 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3137 | function: sign |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3138 | version:24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3139 | attrib: const |
| 3140 | w: 1, 2, 3, 4 |
| 3141 | t: f16 |
| 3142 | ret: #2#1 |
| 3143 | arg: #2#1 v |
| 3144 | test: none |
| 3145 | end: |
| 3146 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3147 | function: sin |
| 3148 | version: 9 |
| 3149 | attrib: const |
| 3150 | w: 1, 2, 3, 4 |
| 3151 | t: f32 |
| 3152 | ret: #2#1 |
| 3153 | arg: #2#1 v |
| 3154 | summary: Sine |
| 3155 | description: |
| 3156 | Returns the sine of an angle measured in radians. |
| 3157 | |
| 3158 | See also @native_sin(). |
| 3159 | end: |
| 3160 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3161 | function: sin |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3162 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3163 | attrib: const |
| 3164 | w: 1, 2, 3, 4 |
| 3165 | t: f16 |
| 3166 | ret: #2#1 |
| 3167 | arg: #2#1 v |
| 3168 | test: none |
| 3169 | end: |
| 3170 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3171 | function: sincos |
| 3172 | version: 9 |
| 3173 | w: 1, 2, 3, 4 |
| 3174 | t: f32 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 3175 | ret: #2#1, "Sine of v." |
| 3176 | arg: #2#1 v, "Incoming value in radians." |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3177 | arg: #2#1* cos, "*cos will be set to the cosine value." |
| 3178 | summary: Sine and cosine |
| 3179 | description: |
| 3180 | Returns the sine and cosine of a value. |
| 3181 | |
| 3182 | See also @native_sincos(). |
| 3183 | end: |
| 3184 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3185 | function: sincos |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3186 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3187 | w: 1, 2, 3, 4 |
| 3188 | t: f16 |
| 3189 | ret: #2#1 |
| 3190 | arg: #2#1 v |
| 3191 | arg: #2#1* cos |
| 3192 | test: none |
| 3193 | end: |
| 3194 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3195 | function: sinh |
| 3196 | version: 9 |
| 3197 | attrib: const |
| 3198 | w: 1, 2, 3, 4 |
| 3199 | t: f32 |
| 3200 | ret: #2#1 |
| 3201 | arg: #2#1 v |
| 3202 | summary: Hyperbolic sine |
| 3203 | description: |
| 3204 | Returns the hyperbolic sine of v, where v is measured in radians. |
| 3205 | |
| 3206 | See also @native_sinh(). |
| 3207 | end: |
| 3208 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3209 | function: sinh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3210 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3211 | attrib: const |
| 3212 | w: 1, 2, 3, 4 |
| 3213 | t: f16 |
| 3214 | ret: #2#1 |
| 3215 | arg: #2#1 v |
| 3216 | test: none |
| 3217 | end: |
| 3218 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3219 | function: sinpi |
| 3220 | version: 9 |
| 3221 | attrib: const |
| 3222 | w: 1, 2, 3, 4 |
| 3223 | t: f32 |
| 3224 | ret: #2#1 |
| 3225 | arg: #2#1 v |
| 3226 | summary: Sine of a number multiplied by pi |
| 3227 | description: |
| 3228 | Returns the sine of (v * pi), where (v * pi) is measured in radians. |
| 3229 | |
| 3230 | To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>. |
| 3231 | |
| 3232 | See also @native_sinpi(). |
| 3233 | end: |
| 3234 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3235 | function: sinpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3236 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3237 | attrib: const |
| 3238 | w: 1, 2, 3, 4 |
| 3239 | t: f16 |
| 3240 | ret: #2#1 |
| 3241 | arg: #2#1 v |
| 3242 | test: none |
| 3243 | end: |
| 3244 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3245 | function: sqrt |
| 3246 | version: 9 |
| 3247 | attrib: const |
| 3248 | w: 1, 2, 3, 4 |
| 3249 | t: f32 |
| 3250 | ret: #2#1 |
| 3251 | arg: #2#1 v |
| 3252 | summary: Square root |
| 3253 | description: |
| 3254 | Returns the square root of a value. |
| 3255 | |
| 3256 | See also @half_sqrt(), @native_sqrt(). |
| 3257 | end: |
| 3258 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3259 | function: sqrt |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3260 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3261 | attrib: const |
| 3262 | w: 1, 2, 3, 4 |
| 3263 | t: f16 |
| 3264 | ret: #2#1 |
| 3265 | arg: #2#1 v |
| 3266 | test: none |
| 3267 | end: |
| 3268 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3269 | function: step |
| 3270 | version: 9 |
| 3271 | attrib: const |
| 3272 | w: 1, 2, 3, 4 |
| 3273 | t: f32 |
| 3274 | ret: #2#1 |
| 3275 | arg: #2#1 edge |
| 3276 | arg: #2#1 v |
| 3277 | summary: 0 if less than a value, 0 otherwise |
| 3278 | description: |
| 3279 | Returns 0.f if v < edge, 1.f otherwise. |
| 3280 | |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 3281 | This can be useful to create conditional computations without using loops and branching |
| 3282 | instructions. For example, instead of computing <code>(a[i] < b[i]) ? 0.f : @atan2(a[i], b[i])</code> |
| 3283 | for the corresponding elements of a vector, you could instead use <code>step(a, b) * @atan2(a, b)</code>. |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3284 | end: |
| 3285 | |
| 3286 | function: step |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3287 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3288 | attrib: const |
| 3289 | w: 1, 2, 3, 4 |
| 3290 | t: f16 |
| 3291 | ret: #2#1 |
| 3292 | arg: #2#1 edge |
| 3293 | arg: #2#1 v |
| 3294 | test: none |
| 3295 | end: |
| 3296 | |
| 3297 | function: step |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3298 | version: 9 |
| 3299 | attrib: const |
| 3300 | w: 2, 3, 4 |
| 3301 | t: f32 |
| 3302 | ret: #2#1 |
| 3303 | arg: #2#1 edge |
| 3304 | arg: #2 v |
| 3305 | end: |
| 3306 | |
| 3307 | function: step |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3308 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3309 | attrib: const |
| 3310 | w: 2, 3, 4 |
| 3311 | t: f16 |
| 3312 | ret: #2#1 |
| 3313 | arg: #2#1 edge |
| 3314 | arg: #2 v |
| 3315 | test: none |
| 3316 | end: |
| 3317 | |
| 3318 | function: step |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3319 | version: 21 |
| 3320 | attrib: const |
| 3321 | w: 2, 3, 4 |
| 3322 | t: f32 |
| 3323 | ret: #2#1 |
| 3324 | arg: #2 edge |
| 3325 | arg: #2#1 v |
| 3326 | end: |
| 3327 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3328 | function: step |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3329 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3330 | attrib: const |
| 3331 | w: 2, 3, 4 |
| 3332 | t: f16 |
| 3333 | ret: #2#1 |
| 3334 | arg: #2 edge |
| 3335 | arg: #2#1 v |
| 3336 | test: none |
| 3337 | end: |
| 3338 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3339 | function: tan |
| 3340 | version: 9 |
| 3341 | attrib: const |
| 3342 | w: 1, 2, 3, 4 |
| 3343 | t: f32 |
| 3344 | ret: #2#1 |
| 3345 | arg: #2#1 v |
| 3346 | summary: Tangent |
| 3347 | description: |
| 3348 | Returns the tangent of an angle measured in radians. |
| 3349 | |
| 3350 | See also @native_tan(). |
| 3351 | end: |
| 3352 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3353 | function: tan |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3354 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3355 | attrib: const |
| 3356 | w: 1, 2, 3, 4 |
| 3357 | t: f16 |
| 3358 | ret: #2#1 |
| 3359 | arg: #2#1 v |
| 3360 | test: none |
| 3361 | end: |
| 3362 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3363 | function: tanh |
| 3364 | version: 9 |
| 3365 | attrib: const |
| 3366 | w: 1, 2, 3, 4 |
| 3367 | t: f32 |
| 3368 | ret: #2#1 |
| 3369 | arg: #2#1 v |
| 3370 | summary: Hyperbolic tangent |
| 3371 | description: |
| 3372 | Returns the hyperbolic tangent of a value. |
| 3373 | |
| 3374 | See also @native_tanh(). |
| 3375 | end: |
| 3376 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3377 | function: tanh |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3378 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3379 | attrib: const |
| 3380 | w: 1, 2, 3, 4 |
| 3381 | t: f16 |
| 3382 | ret: #2#1 |
| 3383 | arg: #2#1 v |
| 3384 | test: none |
| 3385 | end: |
| 3386 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3387 | function: tanpi |
| 3388 | version: 9 |
| 3389 | attrib: const |
| 3390 | w: 1, 2, 3, 4 |
| 3391 | t: f32 |
| 3392 | ret: #2#1 |
| 3393 | arg: #2#1 v |
| 3394 | summary: Tangent of a number multiplied by pi |
| 3395 | description: |
| 3396 | Returns the tangent of (v * pi), where (v * pi) is measured in radians. |
| 3397 | |
| 3398 | To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>. |
| 3399 | |
| 3400 | See also @native_tanpi(). |
| 3401 | end: |
| 3402 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3403 | function: tanpi |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3404 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3405 | attrib: const |
| 3406 | w: 1, 2, 3, 4 |
| 3407 | t: f16 |
| 3408 | ret: #2#1 |
| 3409 | arg: #2#1 v |
| 3410 | test: none |
| 3411 | end: |
| 3412 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3413 | function: tgamma |
| 3414 | version: 9 |
| 3415 | attrib: const |
| 3416 | w: 1, 2, 3, 4 |
| 3417 | t: f32 |
| 3418 | ret: #2#1 |
| 3419 | arg: #2#1 v |
| 3420 | summary: Gamma function |
| 3421 | description: |
| 3422 | Returns the gamma function of a value. |
| 3423 | |
| 3424 | See also @lgamma(). |
| 3425 | end: |
| 3426 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3427 | function: tgamma |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3428 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3429 | attrib: const |
| 3430 | w: 1, 2, 3, 4 |
| 3431 | t: f16 |
| 3432 | ret: #2#1 |
| 3433 | arg: #2#1 v |
| 3434 | test: none |
| 3435 | end: |
| 3436 | |
Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame] | 3437 | function: trunc |
| 3438 | version: 9 |
| 3439 | attrib: const |
| 3440 | w: 1, 2, 3, 4 |
| 3441 | t: f32 |
| 3442 | ret: #2#1 |
| 3443 | arg: #2#1 v |
| 3444 | summary: Truncates a floating point |
| 3445 | description: |
| 3446 | Rounds to integral using truncation. |
| 3447 | |
| 3448 | For example, <code>trunc(1.7f)</code> returns 1.f and <code>trunc(-1.7f)</code> returns -1.f. |
| 3449 | |
| 3450 | See @rint() and @round() for other rounding options. |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3451 | end: |
| 3452 | |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3453 | function: trunc |
Pirama Arumuga Nainar | 132b31f | 2016-02-18 14:46:28 -0800 | [diff] [blame^] | 3454 | version: 24 |
Pirama Arumuga Nainar | 193847b | 2015-12-09 15:54:35 -0800 | [diff] [blame] | 3455 | attrib: const |
| 3456 | w: 1, 2, 3, 4 |
| 3457 | t: f16 |
| 3458 | ret: #2#1 |
| 3459 | arg: #2#1 v |
| 3460 | test: none |
| 3461 | end: |
| 3462 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3463 | function: rsClamp |
Verena Beckham | a4d25bc | 2015-11-12 14:20:31 +0000 | [diff] [blame] | 3464 | attrib: const |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3465 | t: i8, i16, i32, u8, u16, u32 |
| 3466 | ret: #1 |
Jean-Luc Brouillet | 6386ceb | 2015-04-28 15:06:30 -0700 | [diff] [blame] | 3467 | arg: #1 amount, "Value to clamp." |
| 3468 | arg: #1 low, "Lower bound." |
| 3469 | arg: #1 high, "Upper bound." |
Jean-Luc Brouillet | 36e2be5 | 2015-04-30 14:41:24 -0700 | [diff] [blame] | 3470 | deprecated: 22, Use @clamp() instead. |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3471 | summary: Restrain a value to a range |
| 3472 | description: |
| 3473 | Clamp a value between low and high. |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3474 | test: none |
| 3475 | end: |
| 3476 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3477 | function: rsFrac |
| 3478 | attrib: const |
| 3479 | ret: float |
| 3480 | arg: float v |
Jean-Luc Brouillet | 36e2be5 | 2015-04-30 14:41:24 -0700 | [diff] [blame] | 3481 | deprecated: 22, Use @fract() instead. |
Jean-Luc Brouillet | 20b27d6 | 2015-04-03 14:39:53 -0700 | [diff] [blame] | 3482 | summary: Returns the fractional part of a float |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3483 | description: |
| 3484 | Returns the fractional part of a float |
| 3485 | test: none |
| 3486 | end: |
| 3487 | |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3488 | function: rsRand |
| 3489 | ret: int |
| 3490 | arg: int max_value |
Jean-Luc Brouillet | 20b27d6 | 2015-04-03 14:39:53 -0700 | [diff] [blame] | 3491 | summary: Pseudo-random number |
Jean-Luc Brouillet | c5184e2 | 2015-03-13 13:51:24 -0700 | [diff] [blame] | 3492 | description: |
| 3493 | Return a random value between 0 (or min_value) and max_malue. |
| 3494 | test: none |
| 3495 | end: |
| 3496 | |
| 3497 | function: rsRand |
| 3498 | ret: int |
| 3499 | arg: int min_value |
| 3500 | arg: int max_value |
| 3501 | test: none |
| 3502 | end: |
| 3503 | |
| 3504 | function: rsRand |
| 3505 | ret: float |
| 3506 | arg: float max_value |
| 3507 | test: none |
| 3508 | end: |
| 3509 | |
| 3510 | function: rsRand |
| 3511 | ret: float |
| 3512 | arg: float min_value |
| 3513 | arg: float max_value |
| 3514 | test: none |
| 3515 | end: |