rs_core_math.spec revision 0ec1635641a2075c9d2349219632650401f88881
1# 2# Copyright (C) 2013 The Android Open Source Project 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 17start: 18w: 2, 3, 4 19t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 20t: u8, u16, u32, u64, i8, i16, i32, i64, f32, f64 21name: convert_#3#1 22arg: #2#1 23ret: #3#1 24comment: 25 Component wise conversion from #2#1 to #3#1 26version: 9 27end: 28 29start: 30w: 1, 2, 3, 4 31t: f32 32name: acos 33ret: #2#1 34arg: #2#1 35comment: 36 acos 37version: 9 38end: 39 40start: 41w: 1, 2, 3, 4 42t: f32 43name: acosh 44ret: #2#1 45arg: #2#1 46comment: 47 acosh 48version: 9 49end: 50 51start: 52w: 1, 2, 3, 4 53t: f32 54name: acospi 55ret: #2#1 56arg: #2#1 57comment: 58 acospi 59version: 9 60end: 61 62start: 63w: 1, 2, 3, 4 64t: f32 65name: asin 66ret: #2#1 67arg: #2#1 68comment: 69 asin 70version: 9 71end: 72 73start: 74w: 1, 2, 3, 4 75t: f32 76name: asinh 77ret: #2#1 78arg: #2#1 79comment: 80 asinh 81version: 9 82end: 83 84start: 85w: 1, 2, 3, 4 86t: f32 87name: asinpi 88ret: #2#1 89arg: #2#1 90comment: 91 Return the inverse sine divided by PI. 92version: 9 93end: 94 95start: 96w: 1, 2, 3, 4 97t: f32 98name: atan 99ret: #2#1 100arg: #2#1 101comment: 102 Return the inverse tangent. 103version: 9 104end: 105 106start: 107w: 1, 2, 3, 4 108t: f32 109name: atan2 110ret: #2#1 111arg: #2#1 y 112arg: #2#1 x 113comment: 114 Return the inverse tangent of y / x. 115version: 9 116end: 117 118start: 119w: 1, 2, 3, 4 120t: f32 121name: atanh 122ret: #2#1 123arg: #2#1 124comment: 125 Return the inverse hyperbolic tangent. 126version: 9 127end: 128 129start: 130w: 1, 2, 3, 4 131t: f32 132name: atanpi 133ret: #2#1 134arg: #2#1 135comment: 136 Return the inverse tangent divided by PI. 137version: 9 138end: 139 140start: 141w: 1, 2, 3, 4 142t: f32 143name: atan2pi 144ret: #2#1 145arg: #2#1 y 146arg: #2#1 x 147comment: 148 Return the inverse tangent of y / x, divided by PI. 149version: 9 150end: 151 152start: 153w: 1, 2, 3, 4 154t: f32 155name: cbrt 156ret: #2#1 157arg: #2#1 158comment: 159 Return the cube root. 160version: 9 161end: 162 163start: 164w: 1, 2, 3, 4 165t: f32 166name: ceil 167ret: #2#1 168arg: #2#1 169comment: 170 Return the smallest integer not less than a value. 171version: 9 172end: 173 174start: 175w: 1, 2, 3, 4 176t: f32 177name: copysign 178ret: #2#1 179arg: #2#1 x 180arg: #2#1 y 181comment: 182 Copy the sign bit from y to x. 183version: 9 184end: 185 186start: 187w: 1, 2, 3, 4 188t: f32 189name: cos 190ret: #2#1 191arg: #2#1 192comment: 193 Return the cosine. 194version: 9 195end: 196 197start: 198w: 1, 2, 3, 4 199t: f32 200name: cosh 201ret: #2#1 202arg: #2#1 203comment: 204 Return the hypebolic cosine. 205version: 9 206end: 207 208start: 209w: 1, 2, 3, 4 210t: f32 211name: cospi 212ret: #2#1 213arg: #2#1 214comment: 215 Return the cosine of the value * PI. 216version: 9 217end: 218 219start: 220w: 1, 2, 3, 4 221t: f32 222name: erfc 223ret: #2#1 224arg: #2#1 225comment: 226 Return the complementary error function. 227version: 9 228end: 229 230start: 231w: 1, 2, 3, 4 232t: f32 233name: erf 234ret: #2#1 235arg: #2#1 236comment: 237 Return the error function. 238version: 9 239end: 240 241start: 242w: 1, 2, 3, 4 243t: f32 244name: exp 245ret: #2#1 246arg: #2#1 247comment: 248 Return e ^ value. 249version: 9 250end: 251 252start: 253w: 1, 2, 3, 4 254t: f32 255name: exp2 256ret: #2#1 257arg: #2#1 258comment: 259 Return 2 ^ value. 260version: 9 261end: 262 263start: 264w: 1, 2, 3, 4 265t: f32 266name: exp10 267ret: #2#1 268arg: #2#1 269comment: 270 Return 10 ^ value. 271version: 9 272end: 273 274start: 275w: 1, 2, 3, 4 276t: f32 277name: expm1 278ret: #2#1 279arg: #2#1 280comment: 281 Return (e ^ value) - 1. 282version: 9 283end: 284 285start: 286w: 1, 2, 3, 4 287t: f32 288name: fabs 289ret: #2#1 290arg: #2#1 291comment: 292 Return the absolute value of a value. 293version: 9 294end: 295 296start: 297w: 1, 2, 3, 4 298t: f32 299name: fdim 300ret: #2#1 301arg: #2#1 302arg: #2#1 303comment: 304 Return the positive difference between two values. 305version: 9 306end: 307 308start: 309w: 1, 2, 3, 4 310t: f32 311name: floor 312ret: #2#1 313arg: #2#1 314comment: 315 Return the smallest integer not greater than a value. 316version: 9 317end: 318 319start: 320w: 1, 2, 3, 4 321t: f32 322name: fma 323ret: #2#1 324arg: #2#1 a 325arg: #2#1 b 326arg: #2#1 c 327comment: 328 Return (a * b) + c. 329version: 9 330end: 331 332start: 333w: 1, 2, 3, 4 334t: f32 335name: fmax 336ret: #2#1 337arg: #2#1 x 338arg: #2#1 y 339comment: 340 Return (x < y ? y : x) 341version: 9 342end: 343 344start: 345w: 1, 2, 3, 4 346t: f32 347name: fmax 348ret: #2#1 349arg: #2#1 x 350arg: #2 y 351comment: 352 Return (x < y ? y : x) 353version: 9 354end: 355 356start: 357w: 1, 2, 3, 4 358t: f32 359name: fmin 360ret: #2#1 361arg: #2#1 x 362arg: #2#1 y 363comment: 364 Return (x > y ? y : x) 365version: 9 366end: 367 368start: 369w: 1, 2, 3, 4 370t: f32 371name: fmin 372ret: #2#1 373arg: #2#1 x 374arg: #2 y 375comment: 376 Return (x > y ? y : x) 377version: 9 378end: 379 380start: 381w: 1, 2, 3, 4 382t: f32 383name: fmod 384ret: #2#1 385arg: #2#1 x 386arg: #2#1 y 387comment: 388 Return the remainder from x / y 389version: 9 390end: 391 392start: 393w: 1, 2, 3, 4 394t: f32 395name: fract 396ret: #2#1 397arg: #2#1 v 398arg: #2#1 *iptr 399comment: 400 Return fractional part of v 401 402 @param iptr iptr[0] will be set to the floor of the input value. 403version: 9 404end: 405 406start: 407w: 1, 2, 3, 4 408t: f32 409name: fract 410ret: #2#1 411arg: #2#1 v 412comment: 413 Return fractional part of v 414inline: 415 #2#1 unused; 416 return fract(v, &unused); 417version: 9 418end: 419 420start: 421w: 1, 2, 3, 4 422t: f32 423name: frexp 424ret: #2#1 425arg: #2#1 v 426arg: int#1 *iptr 427comment: 428 Return the mantissa and place the exponent into iptr[0] 429 430 @param v Supports float, float2, float3, float4. 431version: 9 432end: 433 434start: 435w: 1, 2, 3, 4 436t: f32 437name: hypot 438ret: #2#1 439arg: #2#1 x 440arg: #2#1 y 441comment: 442 Return sqrt(x*x + y*y) 443version: 9 444end: 445 446start: 447w: 1, 2, 3, 4 448t: f32 449name: ilogb 450ret: int#1 451arg: float#1 452comment: 453 Return the integer exponent of a value 454version: 9 455end: 456 457start: 458w: 1, 2, 3, 4 459t: f32 460name: ilogb 461ret: #2#1 462arg: #2#1 463arg: int#1 464comment: 465 Return (x * 2^y) 466version: 9 467end: 468 469start: 470w: 1, 2, 3, 4 471t: f32 472name: ilogb 473ret: #2#1 474arg: #2#1 475arg: int 476comment: 477 Return (x * 2^y) 478version: 9 479end: 480 481start: 482w: 1, 2, 3, 4 483name: ldexp 484ret: float#1 485arg: float#1 x 486arg: int#1 y 487comment: 488 Return (x * 2^y) 489 490 @param x Supports 1,2,3,4 components 491 @param y Supports single component or matching vector. 492version: 9 493end: 494 495start: 496w: 2, 3, 4 497name: ldexp 498ret: float#1 499arg: float#1 x 500arg: int y 501comment: 502 Return (x * 2^y) 503 504 @param x Supports 1,2,3,4 components 505 @param y Supports single component or matching vector. 506version: 9 507end: 508 509start: 510w: 1, 2, 3, 4 511t: f32 512name: lgamma 513ret: #2#1 514arg: #2#1 x 515comment: 516 Return the log gamma and sign 517version: 9 518end: 519 520start: 521w: 1, 2, 3, 4 522t: f32 523name: lgamma 524ret: #2#1 525arg: #2#1 x 526arg: int#1 *y 527comment: 528 Return the log gamma and sign 529version: 9 530end: 531 532start: 533w: 1, 2, 3, 4 534t: f32 535name: log 536ret: #2#1 537arg: #2#1 x 538comment: 539 Return the natural logarithm. 540version: 9 541end: 542 543start: 544w: 1, 2, 3, 4 545t: f32 546name: log2 547ret: #2#1 548arg: #2#1 x 549comment: 550 Return the base 2 logarithm. 551version: 9 552end: 553 554start: 555w: 1, 2, 3, 4 556t: f32 557name: log10 558ret: #2#1 559arg: #2#1 x 560comment: 561 Return the base 10 logarithm. 562version: 9 563end: 564 565start: 566w: 1, 2, 3, 4 567t: f32 568name: log1p 569ret: #2#1 570arg: #2#1 x 571comment: 572 Return the natural logarithm of (v + 1.0f) 573version: 9 574end: 575 576start: 577w: 1, 2, 3, 4 578t: f32 579name: logb 580ret: #2#1 581arg: #2#1 x 582comment: 583 Compute the exponent of the value. 584version: 9 585end: 586 587start: 588w: 1, 2, 3, 4 589t: f32 590name: mad 591ret: #2#1 592arg: #2#1 a 593arg: #2#1 b 594arg: #2#1 c 595comment: 596 Compute (a * b) + c 597version: 9 598end: 599 600start: 601w: 1, 2, 3, 4 602t: f32 603name: modf 604ret: #2#1 605arg: #2#1 x 606arg: #2#1 *iret 607comment: 608 Return the integral and fractional components of a number. 609 610 @param x Source value 611 @param iret iret[0] will be set to the integral portion of the number. 612 @return The floating point portion of the value. 613version: 9 614end: 615 616start: 617w: 1 618t: f32 619name: nan 620ret: #2#1 621arg: uint#1 622comment: 623 generate a nan 624version: 9 625end: 626 627start: 628w: 1, 2, 3, 4 629t: f32 630name: nextafter 631ret: #2#1 632arg: #2#1 x 633arg: #2#1 y 634comment: 635 Return the next floating point number from x towards y. 636version: 9 637end: 638 639start: 640w: 1, 2, 3, 4 641t: f32 642name: pow 643ret: #2#1 644arg: #2#1 x 645arg: #2#1 y 646comment: 647 Return x ^ y. 648version: 9 649end: 650 651start: 652w: 1, 2, 3, 4 653t: f32 654name: pown 655ret: #2#1 656arg: #2#1 x 657arg: int#1 y 658comment: 659 Return x ^ y. 660version: 9 661end: 662 663start: 664w: 1, 2, 3, 4 665t: f32 666name: powr 667ret: #2#1 668arg: #2#1 x 669arg: #2#1 y 670comment: 671 Return x ^ y. 672 y must be > 0 673version: 9 674end: 675 676start: 677w: 1, 2, 3, 4 678t: f32 679name: remainder 680ret: #2#1 681arg: #2#1 x 682arg: #2#1 y 683comment: 684 Return round x/y to the nearest integer then compute the remander. 685version: 9 686end: 687 688start: 689w: 1, 2, 3, 4 690t: f32 691name: remquo 692ret: #2#1 693arg: #2#1 694arg: #2#1 695arg: int#1 * 696comment: 697 todo 698version: 9 699end: 700 701start: 702w: 1, 2, 3, 4 703t: f32 704name: rint 705ret: #2#1 706arg: #2#1 707comment: 708 Round to the nearest integral value. 709version: 9 710end: 711 712start: 713w: 1, 2, 3, 4 714t: f32 715name: rootn 716ret: #2#1 717arg: #2#1 v 718arg: int#1 n 719comment: 720 Compute the Nth root of a value. 721version: 9 722end: 723 724start: 725w: 1, 2, 3, 4 726t: f32 727name: round 728ret: #2#1 729arg: #2#1 730comment: 731 Round to the nearest integral value. Half values are rounded away from zero. 732version: 9 733end: 734 735start: 736w: 1, 2, 3, 4 737t: f32 738name: rsqrt 739ret: #2#1 740arg: #2#1 741comment: 742 Return (1 / sqrt(value)). 743version: 9 744end: 745 746start: 747w: 1, 2, 3, 4 748t: f32 749name: sqrt 750ret: #2#1 751arg: #2#1 752comment: 753 Return the square root of a value. 754version: 9 755end: 756 757start: 758w: 1, 2, 3, 4 759t: f32 760name: sin 761ret: #2#1 762arg: #2#1 763comment: 764 Return the sine of a value specified in radians. 765version: 9 766end: 767 768start: 769w: 1, 2, 3, 4 770t: f32 771name: sincos 772ret: #2#1 773arg: #2#1 v 774arg: #2#1 *cosptr 775comment: 776 Return the sine and cosine of a value. 777 778 @return sine 779 @param v The incoming value in radians 780 @param *cosptr cosptr[0] will be set to the cosine value. 781version: 9 782end: 783 784start: 785w: 1, 2, 3, 4 786t: f32 787name: sinh 788ret: #2#1 789arg: #2#1 790comment: 791 Return the hyperbolic sine of a value specified in radians. 792version: 9 793end: 794 795start: 796w: 1, 2, 3, 4 797t: f32 798name: sinpi 799ret: #2#1 800arg: #2#1 801comment: 802 Return the sin(v * PI). 803version: 9 804end: 805 806start: 807w: 1, 2, 3, 4 808t: f32 809name: tan 810ret: #2#1 811arg: #2#1 812comment: 813 Return the tangent of a value. 814version: 9 815end: 816 817start: 818w: 1, 2, 3, 4 819t: f32 820name: tanh 821ret: #2#1 822arg: #2#1 823comment: 824 Return the hyperbolic tangent of a value. 825version: 9 826end: 827 828start: 829w: 1, 2, 3, 4 830t: f32 831name: tanpi 832ret: #2#1 833arg: #2#1 834comment: 835 Return tan(v * PI) 836version: 9 837end: 838 839start: 840w: 1, 2, 3, 4 841t: f32 842name: tgamma 843ret: #2#1 844arg: #2#1 845comment: 846 Compute the gamma function of a value. 847version: 9 848end: 849 850start: 851w: 1, 2, 3, 4 852t: f32 853name: trunc 854ret: #2#1 855arg: #2#1 856comment: 857 ound to integral using truncation. 858version: 9 859end: 860 861# int functions 862 863start: 864w: 1, 2, 3, 4 865t: i8, i16, i32 866name: abs 867ret: u#2#1 868arg: #2#1 value 869comment: 870 Return the absolute value of a value. 871version: 9 872end: 873 874start: 875w: 1, 2, 3, 4 876t: u8, u16, u32, i8, i16, i32 877name: clz 878ret: #2#1 879arg: #2#1 value 880comment: 881 Return the number of leading 0-bits in a value. 882version: 9 883end: 884 885start: 886w: 1, 2, 3, 4 887t: f32 888name: min 889ret: #2#1 890arg: #2#1 891arg: #2#1 892comment: 893 Return the minimum value from two arguments 894version: 9 895end: 896 897start: 898w: 1 899t: i8 i16 i32 u8 u16 u32 900name: min 901ret: #2#1 902arg: #2#1 v1 903arg: #2#1 v2 904comment: 905 Return the minimum value from two arguments 906inline: 907 return (v1 < v2 ? v1 : v2); 908version: 9 19 909end: 910 911start: 912w: 2 913t: i8 i16 i32 u8 u16 u32 914name: min 915ret: #2#1 916arg: #2#1 v1 917arg: #2#1 v2 918comment: 919 Return the minimum value from two arguments 920inline: 921 #2#1 tmp; 922 tmp.x = (v1.x < v2.x ? v1.x : v2.x); 923 tmp.y = (v1.y < v2.y ? v1.y : v2.y); 924 return tmp; 925version: 9 19 926end: 927 928start: 929w: 3 930t: i8 i16 i32 u8 u16 u32 931name: min 932ret: #2#1 933arg: #2#1 v1 934arg: #2#1 v2 935comment: 936 Return the minimum value from two arguments 937inline: 938 #2#1 tmp; 939 tmp.x = (v1.x < v2.x ? v1.x : v2.x); 940 tmp.y = (v1.y < v2.y ? v1.y : v2.y); 941 tmp.z = (v1.z < v2.z ? v1.z : v2.z); 942 return tmp; 943version: 9 19 944end: 945 946start: 947w: 4 948t: i8 i16 i32 u8 u16 u32 949name: min 950ret: #2#1 951arg: #2#1 v1 952arg: #2#1 v2 953comment: 954 Return the minimum value from two arguments 955inline: 956 #2#1 tmp; 957 tmp.x = (v1.x < v2.x ? v1.x : v2.x); 958 tmp.y = (v1.y < v2.y ? v1.y : v2.y); 959 tmp.z = (v1.z < v2.z ? v1.z : v2.z); 960 tmp.w = (v1.w < v2.w ? v1.w : v2.w); 961 return tmp; 962version: 9 19 963end: 964 965start: 966w: 1, 2, 3, 4 967t: i8 i16 i32 i64 u8 u16 u32 u64 968name: min 969ret: #2#1 970arg: #2#1 v1 971arg: #2#1 v2 972comment: 973 Return the minimum value from two arguments 974version: 20 975end: 976 977start: 978w: 1, 2, 3, 4 979t: f32 980name: max 981ret: #2#1 982arg: #2#1 983arg: #2#1 984comment: 985 Return the maximum value from two arguments 986version: 9 987end: 988 989start: 990w: 1 991t: i8 i16 i32 u8 u16 u32 992name: max 993ret: #2#1 994arg: #2#1 v1 995arg: #2#1 v2 996comment: 997 Return the maximum value from two arguments 998inline: 999 return (v1 > v2 ? v1 : v2); 1000version: 9 19 1001end: 1002 1003start: 1004w: 2 1005t: i8 i16 i32 u8 u16 u32 1006name: max 1007ret: #2#1 1008arg: #2#1 v1 1009arg: #2#1 v2 1010comment: 1011 Return the maximum value from two arguments 1012inline: 1013 #2#1 tmp; 1014 tmp.x = (v1.x > v2.x ? v1.x : v2.x); 1015 tmp.y = (v1.y > v2.y ? v1.y : v2.y); 1016 return tmp; 1017version: 9 19 1018end: 1019 1020start: 1021w: 3 1022t: i8 i16 i32 u8 u16 u32 1023name: max 1024ret: #2#1 1025arg: #2#1 v1 1026arg: #2#1 v2 1027comment: 1028 Return the maximum value from two arguments 1029inline: 1030 #2#1 tmp; 1031 tmp.x = (v1.x > v2.x ? v1.x : v2.x); 1032 tmp.y = (v1.y > v2.y ? v1.y : v2.y); 1033 tmp.z = (v1.z > v2.z ? v1.z : v2.z); 1034 return tmp; 1035version: 9 19 1036end: 1037 1038start: 1039w: 4 1040t: i8 i16 i32 u8 u16 u32 1041name: max 1042ret: #2#1 1043arg: #2#1 v1 1044arg: #2#1 v2 1045comment: 1046 Return the maximum value from two arguments 1047inline: 1048 #2#1 tmp; 1049 tmp.x = (v1.x > v2.x ? v1.x : v2.x); 1050 tmp.y = (v1.y > v2.y ? v1.y : v2.y); 1051 tmp.z = (v1.z > v2.z ? v1.z : v2.z); 1052 tmp.w = (v1.w > v2.w ? v1.w : v2.w); 1053 return tmp; 1054version: 9 19 1055end: 1056 1057start: 1058w: 1, 2, 3, 4 1059t: i8 i16 i32 i64 u8 u16 u32 u64 1060name: max 1061ret: #2#1 1062arg: #2#1 v1 1063arg: #2#1 v2 1064comment: 1065 Return the maximum value from two arguments 1066version: 20 1067end: 1068 1069start: 1070w: 1, 2, 3, 4 1071t: f32 1072name: clamp 1073ret: #2#1 1074arg: #2#1 value 1075arg: #2#1 min_value 1076arg: #2#1 max_value 1077comment: 1078 Clamp a value to a specified high and low bound. 1079 1080 @param amount value to be clamped. Supports 1,2,3,4 components 1081 @param min_value Lower bound, must be scalar or matching vector. 1082 @param max_value High bound, must match type of low 1083version: 9 1084end: 1085 1086start: 1087w: 1, 2, 3, 4 1088t: f32 1089name: clamp 1090ret: #2#1 1091arg: #2#1 value 1092arg: #2 min_value 1093arg: #2 max_value 1094comment: 1095 Clamp a value to a specified high and low bound. 1096 1097 @param amount value to be clamped. Supports 1,2,3,4 components 1098 @param min_value Lower bound, must be scalar or matching vector. 1099 @param max_value High bound, must match type of low 1100version: 9 1101end: 1102 1103start: 1104w: 1, 2, 3, 4 1105t: u8, u16, u32, u64, i8, i16, i32, i64 1106name: clamp 1107ret: #2#1 1108arg: #2#1 value 1109arg: #2#1 min_value 1110arg: #2#1 max_value 1111comment: 1112 Clamp a value to a specified high and low bound. 1113 1114 @param amount value to be clamped. Supports 1,2,3,4 components 1115 @param min_value Lower bound, must be scalar or matching vector. 1116 @param max_value High bound, must match type of low 1117version: 19 1118end: 1119 1120start: 1121w: 1, 2, 3, 4 1122t: u8, u16, u32, u64, i8, i16, i32, i64 1123name: clamp 1124ret: #2#1 1125arg: #2#1 value 1126arg: #2 min_value 1127arg: #2 max_value 1128comment: 1129 Clamp a value to a specified high and low bound. 1130 1131 @param amount value to be clamped. Supports 1,2,3,4 components 1132 @param min_value Lower bound, must be scalar or matching vector. 1133 @param max_value High bound, must match type of low 1134version: 19 1135end: 1136 1137start: 1138w: 1, 2, 3, 4 1139t: f32 1140name: degrees 1141ret: #2#1 1142arg: #2#1 value 1143comment: 1144 Convert from radians to degrees. 1145version: 9 1146end: 1147 1148start: 1149w: 1, 2, 3, 4 1150t: f32 1151name: mix 1152ret: #2#1 1153arg: #2#1 start 1154arg: #2#1 stop 1155arg: #2#1 amount 1156comment: 1157 return start + ((stop - start) * amount) 1158version: 9 1159end: 1160 1161start: 1162w: 1, 2, 3, 4 1163t: f32 1164name: mix 1165ret: #2#1 1166arg: #2#1 start 1167arg: #2#1 stop 1168arg: #2 amount 1169comment: 1170 return start + ((stop - start) * amount) 1171version: 9 1172end: 1173 1174start: 1175w: 1, 2, 3, 4 1176t: f32 1177name: radians 1178ret: #2#1 1179arg: #2#1 value 1180comment: 1181 Convert from degrees to radians. 1182version: 9 1183end: 1184 1185start: 1186w: 1, 2, 3, 4 1187t: f32 1188name: step 1189ret: #2#1 1190arg: #2#1 edge 1191arg: #2#1 v 1192comment: 1193 if (v < edge) 1194 return 0.f; 1195 else 1196 return 1.f; 1197version: 9 1198end: 1199 1200start: 1201w: 2, 3, 4 1202t: f32 1203name: step 1204ret: #2#1 1205arg: #2#1 edge 1206arg: #2 v 1207comment: 1208 if (v < edge) 1209 return 0.f; 1210 else 1211 return 1.f; 1212version: 9 1213end: 1214 1215start: 1216w: 2, 3, 4 1217t: f32 1218name: step 1219ret: #2#1 1220arg: #2 edge 1221arg: #2#1 v 1222comment: 1223 if (v < edge) 1224 return 0.f; 1225 else 1226 return 1.f; 1227version: 20 1228end: 1229 1230start: 1231w: 1, 2, 3, 4 1232t: f32 1233name: sign 1234ret: #2#1 1235arg: #2#1 v 1236comment: 1237 Return the sign of a value. 1238 1239 if (v < 0) return -1.f; 1240 else if (v > 0) return 1.f; 1241 else return 0.f; 1242version: 9 1243end: 1244 1245start: 1246w: 3, 4 1247t: f32 1248name: cross 1249ret: #2#1 1250arg: #2#1 lhs 1251arg: #2#1 rhs 1252comment: 1253 Compute the cross product of two vectors. 1254version: 9 1255end: 1256 1257start: 1258w: 1, 2, 3, 4 1259t: f32 1260name: dot 1261ret: #2 1262arg: #2#1 lhs 1263arg: #2#1 rhs 1264comment: 1265 Compute the dot product of two vectors. 1266version: 9 1267end: 1268 1269start: 1270w: 1, 2, 3, 4 1271t: f32 1272name: length 1273ret: #2 1274arg: #2#1 v 1275comment: 1276 Compute the length of a vector. 1277version: 9 1278end: 1279 1280start: 1281w: 1, 2, 3, 4 1282t: f32 1283name: distance 1284ret: #2 1285arg: #2#1 lhs 1286arg: #2#1 rhs 1287comment: 1288 Compute the distance between two points. 1289version: 9 1290end: 1291 1292start: 1293w: 1, 2, 3, 4 1294t: f32 1295name: normalize 1296ret: #2#1 1297arg: #2#1 v 1298comment: 1299 Normalize a vector. 1300version: 9 1301end: 1302 1303start: 1304w: 1, 2, 3, 4 1305t: f32 1306name: half_recip 1307ret: #2#1 1308arg: #2#1 v 1309comment: 1310 Return the approximate reciprocal of a value. 1311version: 17 1312end: 1313 1314start: 1315w: 1, 2, 3, 4 1316t: f32 1317name: half_sqrt 1318ret: #2#1 1319arg: #2#1 v 1320comment: 1321 Return the approximate square root of a value. 1322version: 17 1323end: 1324 1325start: 1326w: 1, 2, 3, 4 1327t: f32 1328name: half_rsqrt 1329ret: #2#1 1330arg: #2#1 v 1331comment: 1332 Return the approximate value of (1.f / sqrt(value)). 1333version: 17 1334end: 1335 1336start: 1337w: 1, 2, 3, 4 1338t: f32 1339name: fast_length 1340ret: #2 1341arg: #2#1 v 1342comment: 1343 Compute the approximate length of a vector. 1344version: 17 1345end: 1346 1347start: 1348w: 1, 2, 3, 4 1349t: f32 1350name: fast_distance 1351ret: #2 1352arg: #2#1 lhs 1353arg: #2#1 rhs 1354comment: 1355 Compute the approximate distance between two points. 1356version: 17 1357end: 1358 1359start: 1360w: 1, 2, 3, 4 1361t: f32 1362name: fast_normalize 1363ret: #2#1 1364arg: #2#1 v 1365comment: 1366 Approximately normalize a vector. 1367version: 17 1368end: 1369 1370start: 1371w: 1, 2, 3, 4 1372t: f32 1373name: native_exp 1374ret: #2#1 1375arg: #2#1 v 1376comment: 1377 Fast approximate exp 1378 valid for inputs -86.f to 86.f 1379 Max 8192 ulps of error 1380version: 18 1381end: 1382 1383start: 1384w: 1, 2, 3, 4 1385t: f32 1386name: native_exp2 1387ret: #2#1 1388arg: #2#1 v 1389comment: 1390 Fast approximate exp2 1391 valid for inputs -125.f to 125.f 1392 Max 8192 ulps of error 1393version: 18 1394end: 1395 1396start: 1397w: 1, 2, 3, 4 1398t: f32 1399name: native_exp10 1400ret: #2#1 1401arg: #2#1 v 1402comment: 1403 Fast approximate exp10 1404 valid for inputs -37.f to 37.f 1405 Max 8192 ulps of error 1406version: 18 1407end: 1408 1409start: 1410w: 1, 2, 3, 4 1411t: f32 1412name: native_log 1413ret: #2#1 1414arg: #2#1 v 1415comment: 1416 Fast approximate log 1417version: 18 1418end: 1419 1420start: 1421w: 1, 2, 3, 4 1422t: f32 1423name: native_log2 1424ret: #2#1 1425arg: #2#1 v 1426comment: 1427 Fast approximate log2 1428version: 18 1429end: 1430 1431start: 1432w: 1, 2, 3, 4 1433t: f32 1434name: native_log10 1435ret: #2#1 1436arg: #2#1 v 1437comment: 1438 Fast approximate log10 1439version: 18 1440end: 1441 1442start: 1443w: 1, 2, 3, 4 1444t: f32 1445name: native_powr 1446ret: #2#1 1447arg: #2#1 v 1448arg: #2#1 y 1449comment: 1450 Fast approximate v ^ y 1451version: 18 1452end: 1453 1454 1455