blob: 279d67fcada7a247e44bc74f4f8be0cd85c5fa5a [file] [log] [blame]
Jason Sams135c4b72013-12-11 18:24:45 -08001#
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
Jason Samsea877ed2014-01-09 15:48:32 -080021name: convert_#3#1
Jason Sams135c4b72013-12-11 18:24:45 -080022arg: #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
Jason Samsea877ed2014-01-09 15:48:32 -0800302arg: #2#1
Jason Sams135c4b72013-12-11 18:24:45 -0800303comment:
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
Jason Samsea877ed2014-01-09 15:48:32 -0800450ret: int#1
451arg: float#1
Jason Sams135c4b72013-12-11 18:24:45 -0800452comment:
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
Jason Samsea877ed2014-01-09 15:48:32 -0800483name: 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
Jason Sams135c4b72013-12-11 18:24:45 -0800511t: 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
Jason Samsea877ed2014-01-09 15:48:32 -0800867ret: u#2#1
Jason Sams135c4b72013-12-11 18:24:45 -0800868arg: #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:
Jason Samsea877ed2014-01-09 15:48:32 -0800898w: 1
Jason Sams135c4b72013-12-11 18:24:45 -0800899t: 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:
Jason Samsea877ed2014-01-09 15:48:32 -0800912w: 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:
Jason Sams135c4b72013-12-11 18:24:45 -0800966w: 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
Jason Samsea877ed2014-01-09 15:48:32 -0800974version: 20
Jason Sams135c4b72013-12-11 18:24:45 -0800975end:
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:
Jason Samsea877ed2014-01-09 15:48:32 -0800990w: 1
Jason Sams135c4b72013-12-11 18:24:45 -0800991t: 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:
Jason Samsea877ed2014-01-09 15:48:32 -0800999 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;
Jason Sams135c4b72013-12-11 18:24:45 -08001054version: 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
Jason Samsea877ed2014-01-09 15:48:32 -08001066version: 20
Jason Sams135c4b72013-12-11 18:24:45 -08001067end:
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
Jason Samsea877ed2014-01-09 15:48:32 -08001190arg: #2#1 edge
1191arg: #2#1 v
Jason Sams135c4b72013-12-11 18:24:45 -08001192comment:
1193 if (v < edge)
1194 return 0.f;
1195 else
1196 return 1.f;
1197version: 9
1198end:
1199
1200start:
Jason Samsea877ed2014-01-09 15:48:32 -08001201w: 2, 3, 4
Jason Sams135c4b72013-12-11 18:24:45 -08001202t: f32
1203name: step
1204ret: #2#1
Jason Samsea877ed2014-01-09 15:48:32 -08001205arg: #2#1 edge
Jason Sams135c4b72013-12-11 18:24:45 -08001206arg: #2 v
1207comment:
1208 if (v < edge)
1209 return 0.f;
1210 else
1211 return 1.f;
1212version: 9
1213end:
1214
1215start:
1216w: 1, 2, 3, 4
1217t: f32
1218name: sign
1219ret: #2#1
Jason Samsea877ed2014-01-09 15:48:32 -08001220arg: #2#1 v
Jason Sams135c4b72013-12-11 18:24:45 -08001221comment:
1222 Return the sign of a value.
1223
1224 if (v < 0) return -1.f;
1225 else if (v > 0) return 1.f;
1226 else return 0.f;
1227version: 9
1228end:
1229
1230start:
1231w: 3, 4
1232t: f32
1233name: cross
1234ret: #2#1
1235arg: #2#1 lhs
1236arg: #2#1 rhs
1237comment:
1238 Compute the cross product of two vectors.
1239version: 9
1240end:
1241
1242start:
1243w: 1, 2, 3, 4
1244t: f32
1245name: dot
1246ret: #2
1247arg: #2#1 lhs
1248arg: #2#1 rhs
1249comment:
1250 Compute the dot product of two vectors.
1251version: 9
1252end:
1253
1254start:
1255w: 1, 2, 3, 4
1256t: f32
1257name: length
1258ret: #2
1259arg: #2#1 v
1260comment:
1261 Compute the length of a vector.
1262version: 9
1263end:
1264
1265start:
1266w: 1, 2, 3, 4
1267t: f32
1268name: distance
1269ret: #2
1270arg: #2#1 lhs
1271arg: #2#1 rhs
1272comment:
1273 Compute the distance between two points.
1274version: 9
1275end:
1276
1277start:
1278w: 1, 2, 3, 4
1279t: f32
1280name: normalize
1281ret: #2#1
1282arg: #2#1 v
1283comment:
1284 Normalize a vector.
1285version: 9
1286end:
1287
1288start:
1289w: 1, 2, 3, 4
1290t: f32
1291name: half_recip
1292ret: #2#1
1293arg: #2#1 v
1294comment:
1295 Return the approximate reciprocal of a value.
1296version: 17
1297end:
1298
1299start:
1300w: 1, 2, 3, 4
1301t: f32
1302name: half_sqrt
1303ret: #2#1
1304arg: #2#1 v
1305comment:
1306 Return the approximate square root of a value.
1307version: 17
1308end:
1309
1310start:
1311w: 1, 2, 3, 4
1312t: f32
1313name: half_rsqrt
1314ret: #2#1
1315arg: #2#1 v
1316comment:
1317 Return the approximate value of (1.f / sqrt(value)).
1318version: 17
1319end:
1320
1321start:
1322w: 1, 2, 3, 4
1323t: f32
1324name: fast_length
1325ret: #2
1326arg: #2#1 v
1327comment:
1328 Compute the approximate length of a vector.
1329version: 17
1330end:
1331
1332start:
1333w: 1, 2, 3, 4
1334t: f32
1335name: fast_distance
1336ret: #2
1337arg: #2#1 lhs
1338arg: #2#1 rhs
1339comment:
1340 Compute the approximate distance between two points.
1341version: 17
1342end:
1343
1344start:
1345w: 1, 2, 3, 4
1346t: f32
1347name: fast_normalize
1348ret: #2#1
1349arg: #2#1 v
1350comment:
1351 Approximately normalize a vector.
1352version: 17
1353end:
1354
1355start:
1356w: 1, 2, 3, 4
1357t: f32
1358name: native_exp
1359ret: #2#1
1360arg: #2#1 v
1361comment:
1362 Fast approximate exp
1363 valid for inputs -86.f to 86.f
1364 Max 8192 ulps of error
1365version: 18
1366end:
1367
1368start:
1369w: 1, 2, 3, 4
1370t: f32
1371name: native_exp2
1372ret: #2#1
1373arg: #2#1 v
1374comment:
1375 Fast approximate exp2
1376 valid for inputs -125.f to 125.f
1377 Max 8192 ulps of error
1378version: 18
1379end:
1380
1381start:
1382w: 1, 2, 3, 4
1383t: f32
1384name: native_exp10
1385ret: #2#1
1386arg: #2#1 v
1387comment:
1388 Fast approximate exp10
1389 valid for inputs -37.f to 37.f
1390 Max 8192 ulps of error
1391version: 18
1392end:
1393
1394start:
1395w: 1, 2, 3, 4
1396t: f32
1397name: native_log
1398ret: #2#1
1399arg: #2#1 v
1400comment:
1401 Fast approximate log
1402version: 18
1403end:
1404
1405start:
1406w: 1, 2, 3, 4
1407t: f32
1408name: native_log2
1409ret: #2#1
1410arg: #2#1 v
1411comment:
1412 Fast approximate log2
1413version: 18
1414end:
1415
1416start:
1417w: 1, 2, 3, 4
1418t: f32
1419name: native_log10
1420ret: #2#1
1421arg: #2#1 v
1422comment:
1423 Fast approximate log10
1424version: 18
1425end:
1426
1427start:
1428w: 1, 2, 3, 4
1429t: f32
1430name: native_powr
1431ret: #2#1
1432arg: #2#1 v
1433arg: #2#1 y
1434comment:
1435 Fast approximate v ^ y
1436version: 18
1437end:
1438
1439