1# 2# Copyright (C) 2014 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, i8, i16, i32, f32 20t: u8, u16, u32, i8, i16, i32, f32 21name: convert_#3#1 22arg: #2#1 v compatible(#3) 23ret: #3#1 24comment: 25 Component wise conversion from #2#1 to #3#1 26version: 9 27end: 28 29start: 30w: 2, 3, 4 31t: u64, i64, f64 32t: u64, i64, f64 33name: convert_#3#1 34arg: #2#1 v compatible(#3) 35ret: #3#1 36comment: 37 Component wise conversion from #2#1 to #3#1 38version: 21 39end: 40 41start: 42w: 2, 3, 4 43t: u64, i64, f64 44t: u8, u16, u32, i8, i16, i32, f32 45name: convert_#3#1 46arg: #2#1 v compatible(#3) 47ret: #3#1 48comment: 49 Component wise conversion from #2#1 to #3#1 50version: 21 51end: 52 53start: 54w: 2, 3, 4 55t: u8, u16, u32, i8, i16, i32, f32 56t: u64, i64, f64 57name: convert_#3#1 58arg: #2#1 v compatible(#3) 59ret: #3#1 60comment: 61 Component wise conversion from #2#1 to #3#1 62version: 21 63end: 64 65start: 66w: 1, 2, 3, 4 67t: f32 68name: acos 69ret: #2#1 70arg: #2#1 v range(-1,1) 71comment: 72 acos 73version: 9 74end: 75 76start: 77w: 1, 2, 3, 4 78t: f32 79name: acosh 80ret: #2#1 81arg: #2#1 82comment: 83 acosh 84version: 9 85end: 86 87start: 88w: 1, 2, 3, 4 89t: f32 90name: acospi 91ret: #2#1 92arg: #2#1 v range(-1,1) 93comment: 94 acospi 95version: 9 96end: 97 98start: 99w: 1, 2, 3, 4 100t: f32 101name: asin 102ret: #2#1 103arg: #2#1 v range(-1,1) 104comment: 105 asin 106version: 9 107end: 108 109start: 110w: 1, 2, 3, 4 111t: f32 112name: asinh 113ret: #2#1 114arg: #2#1 115comment: 116 asinh 117version: 9 118end: 119 120start: 121w: 1, 2, 3, 4 122t: f32 123name: asinpi 124ret: #2#1 125arg: #2#1 v range(-1,1) 126comment: 127 Return the inverse sine divided by PI. 128version: 9 129end: 130 131start: 132w: 1, 2, 3, 4 133t: f32 134name: atan 135ret: #2#1 136arg: #2#1 v range(-1,1) 137comment: 138 Return the inverse tangent. 139version: 9 140end: 141 142start: 143w: 1, 2, 3, 4 144t: f32 145name: atan2 146ret: #2#1 147arg: #2#1 y 148arg: #2#1 x 149comment: 150 Return the inverse tangent of y / x. 151version: 9 152end: 153 154start: 155w: 1, 2, 3, 4 156t: f32 157name: atanh 158ret: #2#1 159arg: #2#1 v range(-1,1) 160comment: 161 Return the inverse hyperbolic tangent. 162version: 9 163end: 164 165start: 166w: 1, 2, 3, 4 167t: f32 168name: atanpi 169ret: #2#1 170arg: #2#1 v range(-1,1) 171comment: 172 Return the inverse tangent divided by PI. 173version: 9 174end: 175 176start: 177w: 1, 2, 3, 4 178t: f32 179name: atan2pi 180ret: #2#1 181arg: #2#1 y 182arg: #2#1 x 183comment: 184 Return the inverse tangent of y / x, divided by PI. 185version: 9 186end: 187 188start: 189w: 1, 2, 3, 4 190t: f32 191name: cbrt 192ret: #2#1 193arg: #2#1 194comment: 195 Return the cube root. 196version: 9 197end: 198 199start: 200w: 1, 2, 3, 4 201t: f32 202name: ceil 203ret: #2#1 204arg: #2#1 205comment: 206 Return the smallest integer not less than a value. 207version: 9 208end: 209 210start: 211w: 1, 2, 3, 4 212t: f32 213name: copysign 214ret: #2#1 215arg: #2#1 x 216arg: #2#1 y 217comment: 218 Copy the sign bit from y to x. 219version: 9 220end: 221 222start: 223w: 1, 2, 3, 4 224t: f32 225name: cos 226ret: #2#1 227arg: #2#1 228comment: 229 Return the cosine. 230version: 9 231end: 232 233start: 234w: 1, 2, 3, 4 235t: f32 236name: cosh 237ret: #2#1 238arg: #2#1 239comment: 240 Return the hypebolic cosine. 241version: 9 242end: 243 244start: 245w: 1, 2, 3, 4 246t: f32 247name: cospi 248ret: #2#1 249arg: #2#1 250comment: 251 Return the cosine of the value * PI. 252version: 9 253end: 254 255start: 256w: 1, 2, 3, 4 257t: f32 258name: erfc 259ret: #2#1 260arg: #2#1 261comment: 262 Return the complementary error function. 263version: 9 264end: 265 266start: 267w: 1, 2, 3, 4 268t: f32 269name: erf 270ret: #2#1 271arg: #2#1 272comment: 273 Return the error function. 274version: 9 275end: 276 277start: 278w: 1, 2, 3, 4 279t: f32 280name: exp 281ret: #2#1 282arg: #2#1 283comment: 284 Return e ^ value. 285version: 9 286end: 287 288start: 289w: 1, 2, 3, 4 290t: f32 291name: exp2 292ret: #2#1 293arg: #2#1 294comment: 295 Return 2 ^ value. 296version: 9 297end: 298 299start: 300w: 1, 2, 3, 4 301t: f32 302name: exp10 303ret: #2#1 304arg: #2#1 305comment: 306 Return 10 ^ value. 307version: 9 308end: 309 310start: 311w: 1, 2, 3, 4 312t: f32 313name: expm1 314ret: #2#1 315arg: #2#1 316comment: 317 Return (e ^ value) - 1. 318version: 9 319end: 320 321start: 322w: 1, 2, 3, 4 323t: f32 324name: fabs 325ret: #2#1 326arg: #2#1 327comment: 328 Return the absolute value of a value. 329version: 9 330end: 331 332start: 333w: 1, 2, 3, 4 334t: f32 335name: fdim 336ret: #2#1 337arg: #2#1 a 338arg: #2#1 b 339comment: 340 Return the positive difference between two values. 341version: 9 342end: 343 344start: 345w: 1, 2, 3, 4 346t: f32 347name: floor 348ret: #2#1 349arg: #2#1 350comment: 351 Return the smallest integer not greater than a value. 352version: 9 353end: 354 355start: 356w: 1, 2, 3, 4 357t: f32 358name: fma 359ret: #2#1 360arg: #2#1 a 361arg: #2#1 b 362arg: #2#1 c 363comment: 364 Return (a * b) + c. 365version: 9 366end: 367 368start: 369w: 1, 2, 3, 4 370t: f32 371# TODO What is the difference between this and max? Same for min. 372name: fmax 373ret: #2#1 374arg: #2#1 x 375arg: #2#1 y 376comment: 377 Return (x < y ? y : x) 378version: 9 379end: 380 381start: 382w: 2, 3, 4 383t: f32 384name: fmax 385ret: #2#1 386arg: #2#1 x 387arg: #2 y 388comment: 389 Return (x < y ? y : x) 390version: 9 391end: 392 393start: 394w: 1, 2, 3, 4 395t: f32 396name: fmin 397ret: #2#1 398arg: #2#1 x 399arg: #2#1 y 400comment: 401 Return (x > y ? y : x) 402version: 9 403end: 404 405start: 406w: 2, 3, 4 407t: f32 408name: fmin 409ret: #2#1 410arg: #2#1 x 411arg: #2 y 412comment: 413 Return (x > y ? y : x) 414version: 9 415end: 416 417start: 418w: 1, 2, 3, 4 419t: f32 420name: fmod 421ret: #2#1 422arg: #2#1 x 423arg: #2#1 y 424comment: 425 Return the remainder from x / y 426version: 9 427end: 428 429start: 430w: 1, 2, 3, 4 431t: f32 432name: fract 433ret: #2#1 434arg: #2#1 v 435arg: #2#1 *floor 436comment: 437 Return fractional part of v 438 439 @param floor floor[0] will be set to the floor of the input value. 440version: 9 441end: 442 443start: 444w: 1, 2, 3, 4 445t: f32 446name: fract 447ret: #2#1 448arg: #2#1 v 449comment: 450 Return fractional part of v 451inline: 452 #2#1 unused; 453 return fract(v, &unused); 454version: 9 455end: 456 457start: 458w: 1, 2, 3, 4 459t: f32 460name: frexp 461ret: #2#1 462arg: #2#1 v 463arg: int#1 *iptr 464comment: 465 Return the mantissa and place the exponent into iptr[0] 466 467 @param v Supports float, float2, float3, float4. 468version: 9 469end: 470 471start: 472w: 1, 2, 3, 4 473t: f32 474name: hypot 475ret: #2#1 476arg: #2#1 x 477arg: #2#1 y 478comment: 479 Return sqrt(x*x + y*y) 480version: 9 481end: 482 483start: 484w: 1, 2, 3, 4 485t: f32 486name: ilogb 487ret: int#1 488arg: float#1 489comment: 490 Return the integer exponent of a value 491version: 9 492test: custom 493end: 494 495start: 496w: 1, 2, 3, 4 497name: ldexp 498ret: float#1 499arg: float#1 x 500arg: int#1 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: 2, 3, 4 511name: ldexp 512ret: float#1 513arg: float#1 x 514arg: int y 515comment: 516 Return (x * 2^y) 517 518 @param x Supports 1,2,3,4 components 519 @param y Supports single component or matching vector. 520version: 9 521end: 522 523start: 524w: 1, 2, 3, 4 525t: f32 526name: lgamma 527ret: #2#1 528arg: #2#1 529comment: 530 Return the log gamma 531version: 9 532end: 533 534start: 535w: 1, 2, 3, 4 536t: f32 537name: lgamma 538ret: #2#1 539arg: #2#1 x 540arg: int#1 *y 541comment: 542 Return the log gamma and sign 543version: 9 544#TODO Temporary until bionic & associated drivers are fixed 545test: custom 546end: 547 548start: 549w: 1, 2, 3, 4 550t: f32 551name: log 552ret: #2#1 553arg: #2#1 554comment: 555 Return the natural logarithm. 556version: 9 557end: 558 559start: 560w: 1, 2, 3, 4 561t: f32 562name: log2 563ret: #2#1 564arg: #2#1 565comment: 566 Return the base 2 logarithm. 567version: 9 568end: 569 570start: 571w: 1, 2, 3, 4 572t: f32 573name: log10 574ret: #2#1 575arg: #2#1 576comment: 577 Return the base 10 logarithm. 578version: 9 579end: 580 581start: 582w: 1, 2, 3, 4 583t: f32 584name: log1p 585ret: #2#1 586arg: #2#1 587comment: 588 Return the natural logarithm of (v + 1.0f) 589version: 9 590end: 591 592start: 593w: 1, 2, 3, 4 594t: f32 595name: logb 596ret: #2#1 597arg: #2#1 598comment: 599 Compute the exponent of the value. 600version: 9 601end: 602 603start: 604w: 1, 2, 3, 4 605t: f32 606name: mad 607ret: #2#1 608arg: #2#1 a 609arg: #2#1 b 610arg: #2#1 c 611comment: 612 Compute (a * b) + c 613version: 9 614end: 615 616start: 617w: 1, 2, 3, 4 618t: f32 619name: modf 620ret: #2#1 621arg: #2#1 x 622arg: #2#1 *iret 623comment: 624 Return the integral and fractional components of a number. 625 626 @param x Source value 627 @param iret iret[0] will be set to the integral portion of the number. 628 @return The floating point portion of the value. 629version: 9 630end: 631 632start: 633w: 1 634t: f32 635name: nan 636ret: #2#1 637arg: uint#1 638comment: 639 generate a nan 640version: 9 641end: 642 643start: 644w: 1, 2, 3, 4 645t: f32 646name: nextafter 647ret: #2#1 648arg: #2#1 x 649arg: #2#1 y 650comment: 651 Return the next floating point number from x towards y. 652version: 9 653end: 654 655start: 656w: 1, 2, 3, 4 657t: f32 658name: pow 659ret: #2#1 660arg: #2#1 x 661arg: #2#1 y 662comment: 663 Return x ^ y. 664version: 9 665end: 666 667start: 668w: 1, 2, 3, 4 669t: f32 670name: pown 671ret: #2#1 672arg: #2#1 x 673arg: int#1 y 674comment: 675 Return x ^ y. 676version: 9 677end: 678 679start: 680w: 1, 2, 3, 4 681t: f32 682name: powr 683ret: #2#1 684arg: #2#1 x range(0,3000) 685arg: #2#1 y 686comment: 687 Return x ^ y. 688 x must be >= 0 689version: 9 690end: 691 692start: 693w: 1, 2, 3, 4 694t: f32 695name: remainder 696ret: #2#1 697arg: #2#1 x 698arg: #2#1 y 699comment: 700 Return round x/y to the nearest integer then compute the remainder. 701version: 9 702end: 703 704start: 705w: 1, 2, 3, 4 706t: f32 707name: remquo 708ret: #2#1 709arg: #2#1 b 710arg: #2#1 c 711arg: int#1 *d 712comment: 713 Return the quotient and the remainder of b/c. Only the sign and lowest three bits of the quotient are guaranteed to be accurate. 714version: 9 715test: custom 716end: 717 718start: 719w: 1, 2, 3, 4 720t: f32 721name: rint 722ret: #2#1 723arg: #2#1 724comment: 725 Round to the nearest integral value. 726version: 9 727end: 728 729start: 730w: 1, 2, 3, 4 731t: f32 732name: rootn 733ret: #2#1 734arg: #2#1 v 735arg: int#1 n 736comment: 737 Compute the Nth root of a value. 738version: 9 739end: 740 741start: 742w: 1, 2, 3, 4 743t: f32 744name: round 745ret: #2#1 746arg: #2#1 747comment: 748 Round to the nearest integral value. Half values are rounded away from zero. 749version: 9 750end: 751 752start: 753w: 1, 2, 3, 4 754t: f32 755name: rsqrt 756ret: #2#1 757arg: #2#1 758comment: 759 Return (1 / sqrt(value)). 760version: 9 761end: 762 763start: 764w: 1, 2, 3, 4 765t: f32 766name: sqrt 767ret: #2#1 768arg: #2#1 769comment: 770 Return the square root of a value. 771version: 9 772end: 773 774start: 775w: 1, 2, 3, 4 776t: f32 777name: sin 778ret: #2#1 779arg: #2#1 780comment: 781 Return the sine of a value specified in radians. 782version: 9 783end: 784 785start: 786w: 1, 2, 3, 4 787t: f32 788name: sincos 789ret: #2#1 790arg: #2#1 v 791arg: #2#1 *cosptr 792comment: 793 Return the sine and cosine of a value. 794 795 @return sine 796 @param v The incoming value in radians 797 @param *cosptr cosptr[0] will be set to the cosine value. 798version: 9 799end: 800 801start: 802w: 1, 2, 3, 4 803t: f32 804name: sinh 805ret: #2#1 806arg: #2#1 807comment: 808 Return the hyperbolic sine of a value specified in radians. 809version: 9 810end: 811 812start: 813w: 1, 2, 3, 4 814t: f32 815name: sinpi 816ret: #2#1 817arg: #2#1 818comment: 819 Return the sin(v * PI). 820version: 9 821end: 822 823start: 824w: 1, 2, 3, 4 825t: f32 826name: tan 827ret: #2#1 828arg: #2#1 829comment: 830 Return the tangent of a value. 831version: 9 832end: 833 834start: 835w: 1, 2, 3, 4 836t: f32 837name: tanh 838ret: #2#1 839arg: #2#1 840comment: 841 Return the hyperbolic tangent of a value. 842version: 9 843end: 844 845start: 846w: 1, 2, 3, 4 847t: f32 848name: tanpi 849ret: #2#1 850arg: #2#1 851comment: 852 Return tan(v * PI) 853version: 9 854end: 855 856start: 857w: 1, 2, 3, 4 858t: f32 859name: tgamma 860ret: #2#1 861arg: #2#1 862comment: 863 Compute the gamma function of a value. 864version: 9 865end: 866 867start: 868w: 1, 2, 3, 4 869t: f32 870name: trunc 871ret: #2#1 872arg: #2#1 873comment: 874 ound to integral using truncation. 875version: 9 876end: 877 878# int functions 879 880start: 881w: 1, 2, 3, 4 882t: i8, i16, i32 883name: abs 884ret: u#2#1 885arg: #2#1 value 886comment: 887 Return the absolute value of a value. 888version: 9 889end: 890 891start: 892w: 1, 2, 3, 4 893t: u8, u16, u32, i8, i16, i32 894name: clz 895ret: #2#1 896arg: #2#1 value 897comment: 898 Return the number of leading 0-bits in a value. 899version: 9 900end: 901 902start: 903w: 1, 2, 3, 4 904t: f32 905name: min 906ret: #2#1 907arg: #2#1 908arg: #2#1 909comment: 910 Return the minimum value from two arguments 911version: 9 912end: 913 914start: 915w: 1 916t: i8 i16 i32 u8 u16 u32 917name: min 918ret: #2#1 919arg: #2#1 v1 920arg: #2#1 v2 921comment: 922 Return the minimum value from two arguments 923inline: 924 return (v1 < v2 ? v1 : v2); 925version: 9 19 926end: 927 928start: 929w: 2 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 return tmp; 942version: 9 19 943end: 944 945start: 946w: 3 947t: i8 i16 i32 u8 u16 u32 948name: min 949ret: #2#1 950arg: #2#1 v1 951arg: #2#1 v2 952comment: 953 Return the minimum value from two arguments 954inline: 955 #2#1 tmp; 956 tmp.x = (v1.x < v2.x ? v1.x : v2.x); 957 tmp.y = (v1.y < v2.y ? v1.y : v2.y); 958 tmp.z = (v1.z < v2.z ? v1.z : v2.z); 959 return tmp; 960version: 9 19 961end: 962 963start: 964w: 4 965t: i8 i16 i32 u8 u16 u32 966name: min 967ret: #2#1 968arg: #2#1 v1 969arg: #2#1 v2 970comment: 971 Return the minimum value from two arguments 972inline: 973 #2#1 tmp; 974 tmp.x = (v1.x < v2.x ? v1.x : v2.x); 975 tmp.y = (v1.y < v2.y ? v1.y : v2.y); 976 tmp.z = (v1.z < v2.z ? v1.z : v2.z); 977 tmp.w = (v1.w < v2.w ? v1.w : v2.w); 978 return tmp; 979version: 9 19 980end: 981 982start: 983w: 1, 2, 3, 4 984t: i8 i16 i32 i64 u8 u16 u32 u64 985name: min 986ret: #2#1 987arg: #2#1 v1 988arg: #2#1 v2 989comment: 990 Return the minimum value from two arguments 991version: 21 992end: 993 994start: 995w: 1, 2, 3, 4 996t: f32 997name: max 998ret: #2#1 999arg: #2#1 1000arg: #2#1 1001comment: 1002 Return the maximum value from two arguments 1003version: 9 1004end: 1005 1006start: 1007w: 1 1008t: i8 i16 i32 u8 u16 u32 1009name: max 1010ret: #2#1 1011arg: #2#1 v1 1012arg: #2#1 v2 1013comment: 1014 Return the maximum value from two arguments 1015inline: 1016 return (v1 > v2 ? v1 : v2); 1017version: 9 19 1018end: 1019 1020start: 1021w: 2 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 return tmp; 1034version: 9 19 1035end: 1036 1037start: 1038w: 3 1039t: i8 i16 i32 u8 u16 u32 1040name: max 1041ret: #2#1 1042arg: #2#1 v1 1043arg: #2#1 v2 1044comment: 1045 Return the maximum value from two arguments 1046inline: 1047 #2#1 tmp; 1048 tmp.x = (v1.x > v2.x ? v1.x : v2.x); 1049 tmp.y = (v1.y > v2.y ? v1.y : v2.y); 1050 tmp.z = (v1.z > v2.z ? v1.z : v2.z); 1051 return tmp; 1052version: 9 19 1053end: 1054 1055start: 1056w: 4 1057t: i8 i16 i32 u8 u16 u32 1058name: max 1059ret: #2#1 1060arg: #2#1 v1 1061arg: #2#1 v2 1062comment: 1063 Return the maximum value from two arguments 1064inline: 1065 #2#1 tmp; 1066 tmp.x = (v1.x > v2.x ? v1.x : v2.x); 1067 tmp.y = (v1.y > v2.y ? v1.y : v2.y); 1068 tmp.z = (v1.z > v2.z ? v1.z : v2.z); 1069 tmp.w = (v1.w > v2.w ? v1.w : v2.w); 1070 return tmp; 1071version: 9 19 1072end: 1073 1074start: 1075w: 1, 2, 3, 4 1076t: i8 i16 i32 i64 u8 u16 u32 u64 1077name: max 1078ret: #2#1 1079arg: #2#1 v1 1080arg: #2#1 v2 1081comment: 1082 Return the maximum value from two arguments 1083version: 21 1084end: 1085 1086start: 1087w: 1, 2, 3, 4 1088t: f32 1089name: clamp 1090ret: #2#1 1091arg: #2#1 value 1092arg: #2#1 min_value 1093arg: #2#1 max_value above(min_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: 2, 3, 4 1105t: f32 1106name: clamp 1107ret: #2#1 1108arg: #2#1 value 1109arg: #2 min_value 1110arg: #2 max_value above(min_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: 9 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#1 min_value 1127arg: #2#1 max_value above(min_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: 2, 3, 4 1139t: u8, u16, u32, u64, i8, i16, i32, i64 1140name: clamp 1141ret: #2#1 1142arg: #2#1 value 1143arg: #2 min_value 1144arg: #2 max_value above(min_value) 1145comment: 1146 Clamp a value to a specified high and low bound. 1147 1148 @param amount value to be clamped. Supports 1,2,3,4 components 1149 @param min_value Lower bound, must be scalar or matching vector. 1150 @param max_value High bound, must match type of low 1151version: 19 1152end: 1153 1154start: 1155w: 1, 2, 3, 4 1156t: f32 1157name: degrees 1158ret: #2#1 1159arg: #2#1 value 1160comment: 1161 Convert from radians to degrees. 1162version: 9 1163end: 1164 1165start: 1166w: 1, 2, 3, 4 1167t: f32 1168name: mix 1169ret: #2#1 1170arg: #2#1 start 1171arg: #2#1 stop 1172arg: #2#1 amount 1173comment: 1174 return start + ((stop - start) * amount) 1175version: 9 1176end: 1177 1178start: 1179w: 2, 3, 4 1180t: f32 1181name: mix 1182ret: #2#1 1183arg: #2#1 start 1184arg: #2#1 stop 1185arg: #2 amount 1186comment: 1187 return start + ((stop - start) * amount) 1188version: 9 1189end: 1190 1191start: 1192w: 1, 2, 3, 4 1193t: f32 1194name: radians 1195ret: #2#1 1196arg: #2#1 value 1197comment: 1198 Convert from degrees to radians. 1199version: 9 1200end: 1201 1202start: 1203w: 1, 2, 3, 4 1204t: f32 1205name: step 1206ret: #2#1 1207arg: #2#1 edge 1208arg: #2#1 v 1209comment: 1210 if (v < edge) 1211 return 0.f; 1212 else 1213 return 1.f; 1214version: 9 1215end: 1216 1217start: 1218w: 2, 3, 4 1219t: f32 1220name: step 1221ret: #2#1 1222arg: #2#1 edge 1223arg: #2 v 1224comment: 1225 if (v < edge) 1226 return 0.f; 1227 else 1228 return 1.f; 1229version: 9 1230end: 1231 1232start: 1233w: 2, 3, 4 1234t: f32 1235name: step 1236ret: #2#1 1237arg: #2 edge 1238arg: #2#1 v 1239comment: 1240 if (v < edge) 1241 return 0.f; 1242 else 1243 return 1.f; 1244version: 21 1245end: 1246 1247start: 1248w: 1, 2, 3, 4 1249t: f32 1250name: sign 1251ret: #2#1 1252arg: #2#1 v 1253comment: 1254 Return the sign of a value. 1255 1256 if (v < 0) return -1.f; 1257 else if (v > 0) return 1.f; 1258 else return 0.f; 1259version: 9 1260end: 1261 1262start: 1263w: 3, 4 1264t: f32 1265name: cross 1266ret: #2#1 1267arg: #2#1 lhs 1268arg: #2#1 rhs 1269comment: 1270 Compute the cross product of two vectors. 1271version: 9 1272test: vector 1273end: 1274 1275start: 1276w: 1, 2, 3, 4 1277t: f32 1278name: dot 1279ret: #2 1280arg: #2#1 lhs 1281arg: #2#1 rhs 1282comment: 1283 Compute the dot product of two vectors. 1284version: 9 1285test: vector 1286end: 1287 1288start: 1289w: 1, 2, 3, 4 1290t: f32 1291name: length 1292ret: #2 1293arg: #2#1 v 1294comment: 1295 Compute the length of a vector. 1296version: 9 1297test: vector 1298end: 1299 1300start: 1301w: 1, 2, 3, 4 1302t: f32 1303name: distance 1304ret: #2 1305arg: #2#1 lhs 1306arg: #2#1 rhs 1307comment: 1308 Compute the distance between two points. 1309version: 9 1310test: vector 1311end: 1312 1313start: 1314w: 1, 2, 3, 4 1315t: f32 1316name: normalize 1317ret: #2#1 1318arg: #2#1 v 1319comment: 1320 Normalize a vector. 1321version: 9 1322test: vector 1323end: 1324 1325start: 1326w: 1, 2, 3, 4 1327t: f32 1328name: half_recip 1329ret: #2#1 1330arg: #2#1 v 1331comment: 1332 Return the approximate reciprocal of a value. 1333version: 17 1334end: 1335 1336start: 1337w: 1, 2, 3, 4 1338t: f32 1339name: half_sqrt 1340ret: #2#1 1341arg: #2#1 v 1342comment: 1343 Return the approximate square root of a value. 1344version: 17 1345end: 1346 1347start: 1348w: 1, 2, 3, 4 1349t: f32 1350name: half_rsqrt 1351ret: #2#1 1352arg: #2#1 v 1353comment: 1354 Return the approximate value of (1.f / sqrt(value)). 1355version: 17 1356end: 1357 1358start: 1359w: 1, 2, 3, 4 1360t: f32 1361name: fast_length 1362ret: #2 1363arg: #2#1 v 1364comment: 1365 Compute the approximate length of a vector. 1366version: 17 1367test: vector 1368end: 1369 1370start: 1371w: 1, 2, 3, 4 1372t: f32 1373name: fast_distance 1374ret: #2 1375arg: #2#1 lhs 1376arg: #2#1 rhs 1377comment: 1378 Compute the approximate distance between two points. 1379version: 17 1380test: vector 1381end: 1382 1383start: 1384w: 1, 2, 3, 4 1385t: f32 1386name: fast_normalize 1387ret: #2#1 1388arg: #2#1 v 1389comment: 1390 Approximately normalize a vector. 1391version: 17 1392test: vector 1393end: 1394 1395start: 1396w: 1, 2, 3, 4 1397t: f32 1398name: native_exp 1399ret: #2#1 1400arg: #2#1 v range(-86,86) 1401comment: 1402 Fast approximate exp 1403 valid for inputs -86.f to 86.f 1404 Max 8192 ulps of error 1405version: 18 1406test: limited 1407end: 1408 1409start: 1410w: 1, 2, 3, 4 1411t: f32 1412name: native_exp2 1413ret: #2#1 1414arg: #2#1 v range(-125,125) 1415comment: 1416 Fast approximate exp2 1417 valid for inputs -125.f to 125.f 1418 Max 8192 ulps of error 1419version: 18 1420test: limited 1421end: 1422 1423start: 1424w: 1, 2, 3, 4 1425t: f32 1426name: native_exp10 1427ret: #2#1 1428arg: #2#1 v range(-37,37) 1429comment: 1430 Fast approximate exp10 1431 valid for inputs -37.f to 37.f 1432 Max 8192 ulps of error 1433version: 18 1434test: limited 1435end: 1436 1437start: 1438w: 1, 2, 3, 4 1439t: f32 1440name: native_log 1441ret: #2#1 1442arg: #2#1 v range(10e-10,10e10) 1443comment: 1444 Fast approximate log 1445 It is not accurate for values very close to zero. 1446version: 18 1447test: limited 1448end: 1449 1450start: 1451w: 1, 2, 3, 4 1452t: f32 1453name: native_log2 1454ret: #2#1 1455arg: #2#1 v range(10e-10,10e10) 1456comment: 1457 Fast approximate log2 1458 It is not accurate for values very close to zero. 1459version: 18 1460test: limited 1461end: 1462 1463start: 1464w: 1, 2, 3, 4 1465t: f32 1466name: native_log10 1467ret: #2#1 1468arg: #2#1 v range(10e-10,10e10) 1469comment: 1470 Fast approximate log10 1471 It is not accurate for values very close to zero. 1472version: 18 1473test: limited 1474end: 1475 1476start: 1477w: 1, 2, 3, 4 1478t: f32 1479name: native_powr 1480ret: #2#1 1481arg: #2#1 v range(0,256) 1482arg: #2#1 y range(-15,15) 1483comment: 1484 Fast approximate v ^ y 1485 v must be between 0.f and 256.f 1486 y must be between -15.f and 15.f 1487 It is not accurate for values of v very close to zero. 1488version: 18 1489test: limited 1490end: 1491 1492 1493start: 1494w: 1, 2, 3, 4 1495t: f32 1496name: native_acos 1497ret: #2#1 1498arg: #2#1 v range(-1,1) 1499comment: 1500 acos 1501version: 21 1502# TODO Temporary 1503test: limited(0.0005) 1504end: 1505 1506start: 1507w: 1, 2, 3, 4 1508t: f32 1509name: native_acosh 1510ret: #2#1 1511arg: #2#1 1512comment: 1513 acosh 1514version: 21 1515# TODO Temporary 1516test: limited(0.0005) 1517end: 1518 1519start: 1520w: 1, 2, 3, 4 1521t: f32 1522name: native_acospi 1523ret: #2#1 1524arg: #2#1 v range(-1,1) 1525comment: 1526 acospi 1527version: 21 1528# TODO Temporary 1529test: limited(0.0005) 1530end: 1531 1532start: 1533w: 1, 2, 3, 4 1534t: f32 1535name: native_asin 1536ret: #2#1 1537arg: #2#1 v range(-1,1) 1538comment: 1539 asin 1540version: 21 1541# TODO Temporary 1542test: limited(0.0005) 1543end: 1544 1545start: 1546w: 1, 2, 3, 4 1547t: f32 1548name: native_asinh 1549ret: #2#1 1550arg: #2#1 1551comment: 1552 asinh 1553version: 21 1554# TODO Temporary 1555test: limited(0.0005) 1556end: 1557 1558start: 1559w: 1, 2, 3, 4 1560t: f32 1561name: native_asinpi 1562ret: #2#1 1563arg: #2#1 v range(-1,1) 1564comment: 1565 Return the inverse sine divided by PI. 1566version: 21 1567# TODO Temporary 1568test: limited(0.0005) 1569end: 1570 1571start: 1572w: 1, 2, 3, 4 1573t: f32 1574name: native_atan 1575ret: #2#1 1576arg: #2#1 v range(-1,1) 1577comment: 1578 Return the inverse tangent. 1579version: 21 1580# TODO Temporary 1581test: limited(0.0005) 1582end: 1583 1584start: 1585w: 1, 2, 3, 4 1586t: f32 1587name: native_atan2 1588ret: #2#1 1589arg: #2#1 y 1590arg: #2#1 x 1591comment: 1592 Return the inverse tangent of y / x. 1593version: 21 1594# TODO Temporary 1595test: limited(0.0005) 1596end: 1597 1598start: 1599w: 1, 2, 3, 4 1600t: f32 1601name: native_atanh 1602ret: #2#1 1603arg: #2#1 in range(-1,1) 1604comment: 1605 Return the inverse hyperbolic tangent. 1606version: 21 1607# TODO Temporary 1608test: limited(0.0005) 1609end: 1610 1611start: 1612w: 1, 2, 3, 4 1613t: f32 1614name: native_atanpi 1615ret: #2#1 1616arg: #2#1 v range(-1,1) 1617comment: 1618 Return the inverse tangent divided by PI. 1619version: 21 1620# TODO Temporary 1621test: limited(0.0005) 1622end: 1623 1624start: 1625w: 1, 2, 3, 4 1626t: f32 1627name: native_atan2pi 1628ret: #2#1 1629arg: #2#1 y 1630arg: #2#1 x 1631comment: 1632 Return the inverse tangent of y / x, divided by PI. 1633version: 21 1634# TODO Temporary 1635test: limited(0.0005) 1636end: 1637 1638start: 1639w: 1, 2, 3, 4 1640t: f32 1641name: native_cbrt 1642ret: #2#1 1643arg: #2#1 1644comment: 1645 Return the cube root. 1646version: 21 1647end: 1648 1649start: 1650w: 1, 2, 3, 4 1651t: f32 1652name: native_cos 1653ret: #2#1 1654arg: #2#1 1655comment: 1656 Return the cosine. 1657version: 21 1658end: 1659 1660start: 1661w: 1, 2, 3, 4 1662t: f32 1663name: native_cosh 1664ret: #2#1 1665arg: #2#1 1666comment: 1667 Return the hypebolic cosine. 1668version: 21 1669end: 1670 1671start: 1672w: 1, 2, 3, 4 1673t: f32 1674name: native_cospi 1675ret: #2#1 1676arg: #2#1 1677comment: 1678 Return the cosine of the value * PI. 1679version: 21 1680end: 1681 1682start: 1683w: 1, 2, 3, 4 1684t: f32 1685name: native_expm1 1686ret: #2#1 1687arg: #2#1 1688comment: 1689 Return (e ^ value) - 1. 1690version: 21 1691end: 1692 1693start: 1694w: 1, 2, 3, 4 1695t: f32 1696name: native_distance 1697ret: #2 1698arg: #2#1 lhs 1699arg: #2#1 rhs 1700comment: 1701 Compute the approximate distance between two points. 1702version: 21 1703test: vector 1704end: 1705 1706start: 1707w: 1, 2, 3, 4 1708t: f32 1709name: native_divide 1710ret: #2#1 1711arg: #2#1 lhs 1712arg: #2#1 rhs 1713comment: 1714 Compute the approximate division result of two values. 1715version: 21 1716end: 1717 1718start: 1719w: 1, 2, 3, 4 1720t: f32 1721name: native_hypot 1722ret: #2#1 1723arg: #2#1 x 1724arg: #2#1 y 1725comment: 1726 Return native_sqrt(x*x + y*y) 1727version: 21 1728end: 1729 1730start: 1731w: 1, 2, 3, 4 1732t: f32 1733name: native_normalize 1734ret: #2#1 1735arg: #2#1 v 1736comment: 1737 Normalize a vector. 1738version: 21 1739test: vector 1740end: 1741 1742start: 1743w: 1, 2, 3, 4 1744t: f32 1745name: native_length 1746ret: #2 1747arg: #2#1 v 1748comment: 1749 Compute the approximate length of a vector. 1750version: 21 1751test: vector 1752end: 1753 1754start: 1755w: 1, 2, 3, 4 1756t: f32 1757name: native_log1p 1758ret: #2#1 1759arg: #2#1 1760comment: 1761 Return the natural logarithm of (v + 1.0f) 1762version: 21 1763end: 1764 1765start: 1766w: 1, 2, 3, 4 1767t: f32 1768name: native_recip 1769ret: #2#1 1770arg: #2#1 v 1771comment: 1772 Return the approximate reciprocal of a value. 1773version: 21 1774end: 1775 1776start: 1777w: 1, 2, 3, 4 1778t: f32 1779name: native_rootn 1780ret: #2#1 1781arg: #2#1 v 1782arg: int#1 n 1783comment: 1784 Compute the Nth root of a value. 1785version: 21 1786end: 1787 1788start: 1789w: 1, 2, 3, 4 1790t: f32 1791name: native_rsqrt 1792ret: #2#1 1793arg: #2#1 1794comment: 1795 Return (1 / sqrt(value)). 1796version: 21 1797end: 1798 1799start: 1800w: 1, 2, 3, 4 1801t: f32 1802name: native_sin 1803ret: #2#1 1804arg: #2#1 1805comment: 1806 Return the sine of a value specified in radians. 1807version: 21 1808end: 1809 1810start: 1811w: 1, 2, 3, 4 1812t: f32 1813name: native_sincos 1814ret: #2#1 1815arg: #2#1 v 1816arg: #2#1 *cosptr 1817comment: 1818 Return the sine and cosine of a value. 1819 1820 @return sine 1821 @param v The incoming value in radians 1822 @param *cosptr cosptr[0] will be set to the cosine value. 1823version: 21 1824# TODO Temporary 1825test: limited(0.0005) 1826end: 1827 1828start: 1829w: 1, 2, 3, 4 1830t: f32 1831name: native_sinh 1832ret: #2#1 1833arg: #2#1 1834comment: 1835 Return the hyperbolic sine of a value specified in radians. 1836version: 21 1837end: 1838 1839start: 1840w: 1, 2, 3, 4 1841t: f32 1842name: native_sinpi 1843ret: #2#1 1844arg: #2#1 1845comment: 1846 Return the sin(v * PI). 1847version: 21 1848end: 1849 1850start: 1851w: 1, 2, 3, 4 1852t: f32 1853name: native_sqrt 1854ret: #2#1 1855arg: #2#1 1856comment: 1857 Return the aproximate sqrt(v). 1858version: 21 1859end: 1860 1861start: 1862w: 1, 2, 3, 4 1863t: f32 1864name: native_tan 1865ret: #2#1 1866arg: #2#1 1867comment: 1868 Return the tangent of a value. 1869version: 21 1870end: 1871 1872start: 1873w: 1, 2, 3, 4 1874t: f32 1875name: native_tanh 1876ret: #2#1 1877arg: #2#1 1878comment: 1879 Return the hyperbolic tangent of a value. 1880version: 21 1881end: 1882 1883start: 1884w: 1, 2, 3, 4 1885t: f32 1886name: native_tanpi 1887ret: #2#1 1888arg: #2#1 1889comment: 1890 Return tan(v * PI) 1891version: 21 1892end: 1893 1894 1895