blob: c7cc3316825544318c84d14a7d83343ba068e0c4 [file] [log] [blame]
Jason Sams29087fa2014-01-09 17:06:17 -08001/*
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
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080017// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
18
Jason Sams29087fa2014-01-09 17:06:17 -080019#ifndef __rs_core_math_rsh__
20#define __rs_core_math_rsh__
21#if (defined(RS_VERSION) && (RS_VERSION >= 9))
22/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080023 * Return the absolute value of a value.
24 *
25 * Supported by API versions 9 and newer.
26 */
27extern uchar __attribute__((const, overloadable))abs(char value);
28#endif
29
30#if (defined(RS_VERSION) && (RS_VERSION >= 9))
31/*
32 * Return the absolute value of a value.
33 *
34 * Supported by API versions 9 and newer.
35 */
36extern uchar2 __attribute__((const, overloadable))abs(char2 value);
37#endif
38
39#if (defined(RS_VERSION) && (RS_VERSION >= 9))
40/*
41 * Return the absolute value of a value.
42 *
43 * Supported by API versions 9 and newer.
44 */
45extern uchar3 __attribute__((const, overloadable))abs(char3 value);
46#endif
47
48#if (defined(RS_VERSION) && (RS_VERSION >= 9))
49/*
50 * Return the absolute value of a value.
51 *
52 * Supported by API versions 9 and newer.
53 */
54extern uchar4 __attribute__((const, overloadable))abs(char4 value);
55#endif
56
57#if (defined(RS_VERSION) && (RS_VERSION >= 9))
58/*
59 * Return the absolute value of a value.
60 *
61 * Supported by API versions 9 and newer.
62 */
63extern ushort __attribute__((const, overloadable))abs(short value);
64#endif
65
66#if (defined(RS_VERSION) && (RS_VERSION >= 9))
67/*
68 * Return the absolute value of a value.
69 *
70 * Supported by API versions 9 and newer.
71 */
72extern ushort2 __attribute__((const, overloadable))abs(short2 value);
73#endif
74
75#if (defined(RS_VERSION) && (RS_VERSION >= 9))
76/*
77 * Return the absolute value of a value.
78 *
79 * Supported by API versions 9 and newer.
80 */
81extern ushort3 __attribute__((const, overloadable))abs(short3 value);
82#endif
83
84#if (defined(RS_VERSION) && (RS_VERSION >= 9))
85/*
86 * Return the absolute value of a value.
87 *
88 * Supported by API versions 9 and newer.
89 */
90extern ushort4 __attribute__((const, overloadable))abs(short4 value);
91#endif
92
93#if (defined(RS_VERSION) && (RS_VERSION >= 9))
94/*
95 * Return the absolute value of a value.
96 *
97 * Supported by API versions 9 and newer.
98 */
99extern uint __attribute__((const, overloadable))abs(int value);
100#endif
101
102#if (defined(RS_VERSION) && (RS_VERSION >= 9))
103/*
104 * Return the absolute value of a value.
105 *
106 * Supported by API versions 9 and newer.
107 */
108extern uint2 __attribute__((const, overloadable))abs(int2 value);
109#endif
110
111#if (defined(RS_VERSION) && (RS_VERSION >= 9))
112/*
113 * Return the absolute value of a value.
114 *
115 * Supported by API versions 9 and newer.
116 */
117extern uint3 __attribute__((const, overloadable))abs(int3 value);
118#endif
119
120#if (defined(RS_VERSION) && (RS_VERSION >= 9))
121/*
122 * Return the absolute value of a value.
123 *
124 * Supported by API versions 9 and newer.
125 */
126extern uint4 __attribute__((const, overloadable))abs(int4 value);
127#endif
128
129#if (defined(RS_VERSION) && (RS_VERSION >= 9))
130/*
131 * acos
132 *
133 * Supported by API versions 9 and newer.
134 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800135extern float __attribute__((const, overloadable))acos(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800136#endif
137
138#if (defined(RS_VERSION) && (RS_VERSION >= 9))
139/*
140 * acos
141 *
142 * Supported by API versions 9 and newer.
143 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800144extern float2 __attribute__((const, overloadable))acos(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800145#endif
146
147#if (defined(RS_VERSION) && (RS_VERSION >= 9))
148/*
149 * acos
150 *
151 * Supported by API versions 9 and newer.
152 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800153extern float3 __attribute__((const, overloadable))acos(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800154#endif
155
156#if (defined(RS_VERSION) && (RS_VERSION >= 9))
157/*
158 * acos
159 *
160 * Supported by API versions 9 and newer.
161 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800162extern float4 __attribute__((const, overloadable))acos(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800163#endif
164
165#if (defined(RS_VERSION) && (RS_VERSION >= 9))
166/*
167 * acosh
168 *
169 * Supported by API versions 9 and newer.
170 */
171extern float __attribute__((const, overloadable))acosh(float);
172#endif
173
174#if (defined(RS_VERSION) && (RS_VERSION >= 9))
175/*
176 * acosh
177 *
178 * Supported by API versions 9 and newer.
179 */
180extern float2 __attribute__((const, overloadable))acosh(float2);
181#endif
182
183#if (defined(RS_VERSION) && (RS_VERSION >= 9))
184/*
185 * acosh
186 *
187 * Supported by API versions 9 and newer.
188 */
189extern float3 __attribute__((const, overloadable))acosh(float3);
190#endif
191
192#if (defined(RS_VERSION) && (RS_VERSION >= 9))
193/*
194 * acosh
195 *
196 * Supported by API versions 9 and newer.
197 */
198extern float4 __attribute__((const, overloadable))acosh(float4);
199#endif
200
201#if (defined(RS_VERSION) && (RS_VERSION >= 9))
202/*
203 * acospi
204 *
205 * Supported by API versions 9 and newer.
206 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800207extern float __attribute__((const, overloadable))acospi(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800208#endif
209
210#if (defined(RS_VERSION) && (RS_VERSION >= 9))
211/*
212 * acospi
213 *
214 * Supported by API versions 9 and newer.
215 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800216extern float2 __attribute__((const, overloadable))acospi(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800217#endif
218
219#if (defined(RS_VERSION) && (RS_VERSION >= 9))
220/*
221 * acospi
222 *
223 * Supported by API versions 9 and newer.
224 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800225extern float3 __attribute__((const, overloadable))acospi(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800226#endif
227
228#if (defined(RS_VERSION) && (RS_VERSION >= 9))
229/*
230 * acospi
231 *
232 * Supported by API versions 9 and newer.
233 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800234extern float4 __attribute__((const, overloadable))acospi(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800235#endif
236
237#if (defined(RS_VERSION) && (RS_VERSION >= 9))
238/*
239 * asin
240 *
241 * Supported by API versions 9 and newer.
242 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800243extern float __attribute__((const, overloadable))asin(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800244#endif
245
246#if (defined(RS_VERSION) && (RS_VERSION >= 9))
247/*
248 * asin
249 *
250 * Supported by API versions 9 and newer.
251 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800252extern float2 __attribute__((const, overloadable))asin(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800253#endif
254
255#if (defined(RS_VERSION) && (RS_VERSION >= 9))
256/*
257 * asin
258 *
259 * Supported by API versions 9 and newer.
260 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800261extern float3 __attribute__((const, overloadable))asin(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800262#endif
263
264#if (defined(RS_VERSION) && (RS_VERSION >= 9))
265/*
266 * asin
267 *
268 * Supported by API versions 9 and newer.
269 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800270extern float4 __attribute__((const, overloadable))asin(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800271#endif
272
273#if (defined(RS_VERSION) && (RS_VERSION >= 9))
274/*
275 * asinh
276 *
277 * Supported by API versions 9 and newer.
278 */
279extern float __attribute__((const, overloadable))asinh(float);
280#endif
281
282#if (defined(RS_VERSION) && (RS_VERSION >= 9))
283/*
284 * asinh
285 *
286 * Supported by API versions 9 and newer.
287 */
288extern float2 __attribute__((const, overloadable))asinh(float2);
289#endif
290
291#if (defined(RS_VERSION) && (RS_VERSION >= 9))
292/*
293 * asinh
294 *
295 * Supported by API versions 9 and newer.
296 */
297extern float3 __attribute__((const, overloadable))asinh(float3);
298#endif
299
300#if (defined(RS_VERSION) && (RS_VERSION >= 9))
301/*
302 * asinh
303 *
304 * Supported by API versions 9 and newer.
305 */
306extern float4 __attribute__((const, overloadable))asinh(float4);
307#endif
308
309#if (defined(RS_VERSION) && (RS_VERSION >= 9))
310/*
311 * Return the inverse sine divided by PI.
312 *
313 * Supported by API versions 9 and newer.
314 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800315extern float __attribute__((const, overloadable))asinpi(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800316#endif
317
318#if (defined(RS_VERSION) && (RS_VERSION >= 9))
319/*
320 * Return the inverse sine divided by PI.
321 *
322 * Supported by API versions 9 and newer.
323 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800324extern float2 __attribute__((const, overloadable))asinpi(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800325#endif
326
327#if (defined(RS_VERSION) && (RS_VERSION >= 9))
328/*
329 * Return the inverse sine divided by PI.
330 *
331 * Supported by API versions 9 and newer.
332 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800333extern float3 __attribute__((const, overloadable))asinpi(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800334#endif
335
336#if (defined(RS_VERSION) && (RS_VERSION >= 9))
337/*
338 * Return the inverse sine divided by PI.
339 *
340 * Supported by API versions 9 and newer.
341 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800342extern float4 __attribute__((const, overloadable))asinpi(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800343#endif
344
345#if (defined(RS_VERSION) && (RS_VERSION >= 9))
346/*
347 * Return the inverse tangent.
348 *
349 * Supported by API versions 9 and newer.
350 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800351extern float __attribute__((const, overloadable))atan(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800352#endif
353
354#if (defined(RS_VERSION) && (RS_VERSION >= 9))
355/*
356 * Return the inverse tangent.
357 *
358 * Supported by API versions 9 and newer.
359 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800360extern float2 __attribute__((const, overloadable))atan(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800361#endif
362
363#if (defined(RS_VERSION) && (RS_VERSION >= 9))
364/*
365 * Return the inverse tangent.
366 *
367 * Supported by API versions 9 and newer.
368 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800369extern float3 __attribute__((const, overloadable))atan(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800370#endif
371
372#if (defined(RS_VERSION) && (RS_VERSION >= 9))
373/*
374 * Return the inverse tangent.
375 *
376 * Supported by API versions 9 and newer.
377 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800378extern float4 __attribute__((const, overloadable))atan(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800379#endif
380
381#if (defined(RS_VERSION) && (RS_VERSION >= 9))
382/*
383 * Return the inverse tangent of y / x.
384 *
385 * Supported by API versions 9 and newer.
386 */
387extern float __attribute__((const, overloadable))atan2(float y, float x);
388#endif
389
390#if (defined(RS_VERSION) && (RS_VERSION >= 9))
391/*
392 * Return the inverse tangent of y / x.
393 *
394 * Supported by API versions 9 and newer.
395 */
396extern float2 __attribute__((const, overloadable))atan2(float2 y, float2 x);
397#endif
398
399#if (defined(RS_VERSION) && (RS_VERSION >= 9))
400/*
401 * Return the inverse tangent of y / x.
402 *
403 * Supported by API versions 9 and newer.
404 */
405extern float3 __attribute__((const, overloadable))atan2(float3 y, float3 x);
406#endif
407
408#if (defined(RS_VERSION) && (RS_VERSION >= 9))
409/*
410 * Return the inverse tangent of y / x.
411 *
412 * Supported by API versions 9 and newer.
413 */
414extern float4 __attribute__((const, overloadable))atan2(float4 y, float4 x);
415#endif
416
417#if (defined(RS_VERSION) && (RS_VERSION >= 9))
418/*
419 * Return the inverse tangent of y / x, divided by PI.
420 *
421 * Supported by API versions 9 and newer.
422 */
423extern float __attribute__((const, overloadable))atan2pi(float y, float x);
424#endif
425
426#if (defined(RS_VERSION) && (RS_VERSION >= 9))
427/*
428 * Return the inverse tangent of y / x, divided by PI.
429 *
430 * Supported by API versions 9 and newer.
431 */
432extern float2 __attribute__((const, overloadable))atan2pi(float2 y, float2 x);
433#endif
434
435#if (defined(RS_VERSION) && (RS_VERSION >= 9))
436/*
437 * Return the inverse tangent of y / x, divided by PI.
438 *
439 * Supported by API versions 9 and newer.
440 */
441extern float3 __attribute__((const, overloadable))atan2pi(float3 y, float3 x);
442#endif
443
444#if (defined(RS_VERSION) && (RS_VERSION >= 9))
445/*
446 * Return the inverse tangent of y / x, divided by PI.
447 *
448 * Supported by API versions 9 and newer.
449 */
450extern float4 __attribute__((const, overloadable))atan2pi(float4 y, float4 x);
451#endif
452
453#if (defined(RS_VERSION) && (RS_VERSION >= 9))
454/*
455 * Return the inverse hyperbolic tangent.
456 *
457 * Supported by API versions 9 and newer.
458 */
459extern float __attribute__((const, overloadable))atanh(float);
460#endif
461
462#if (defined(RS_VERSION) && (RS_VERSION >= 9))
463/*
464 * Return the inverse hyperbolic tangent.
465 *
466 * Supported by API versions 9 and newer.
467 */
468extern float2 __attribute__((const, overloadable))atanh(float2);
469#endif
470
471#if (defined(RS_VERSION) && (RS_VERSION >= 9))
472/*
473 * Return the inverse hyperbolic tangent.
474 *
475 * Supported by API versions 9 and newer.
476 */
477extern float3 __attribute__((const, overloadable))atanh(float3);
478#endif
479
480#if (defined(RS_VERSION) && (RS_VERSION >= 9))
481/*
482 * Return the inverse hyperbolic tangent.
483 *
484 * Supported by API versions 9 and newer.
485 */
486extern float4 __attribute__((const, overloadable))atanh(float4);
487#endif
488
489#if (defined(RS_VERSION) && (RS_VERSION >= 9))
490/*
491 * Return the inverse tangent divided by PI.
492 *
493 * Supported by API versions 9 and newer.
494 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800495extern float __attribute__((const, overloadable))atanpi(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800496#endif
497
498#if (defined(RS_VERSION) && (RS_VERSION >= 9))
499/*
500 * Return the inverse tangent divided by PI.
501 *
502 * Supported by API versions 9 and newer.
503 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800504extern float2 __attribute__((const, overloadable))atanpi(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800505#endif
506
507#if (defined(RS_VERSION) && (RS_VERSION >= 9))
508/*
509 * Return the inverse tangent divided by PI.
510 *
511 * Supported by API versions 9 and newer.
512 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800513extern float3 __attribute__((const, overloadable))atanpi(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800514#endif
515
516#if (defined(RS_VERSION) && (RS_VERSION >= 9))
517/*
518 * Return the inverse tangent divided by PI.
519 *
520 * Supported by API versions 9 and newer.
521 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800522extern float4 __attribute__((const, overloadable))atanpi(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800523#endif
524
525#if (defined(RS_VERSION) && (RS_VERSION >= 9))
526/*
527 * Return the cube root.
528 *
529 * Supported by API versions 9 and newer.
530 */
531extern float __attribute__((const, overloadable))cbrt(float);
532#endif
533
534#if (defined(RS_VERSION) && (RS_VERSION >= 9))
535/*
536 * Return the cube root.
537 *
538 * Supported by API versions 9 and newer.
539 */
540extern float2 __attribute__((const, overloadable))cbrt(float2);
541#endif
542
543#if (defined(RS_VERSION) && (RS_VERSION >= 9))
544/*
545 * Return the cube root.
546 *
547 * Supported by API versions 9 and newer.
548 */
549extern float3 __attribute__((const, overloadable))cbrt(float3);
550#endif
551
552#if (defined(RS_VERSION) && (RS_VERSION >= 9))
553/*
554 * Return the cube root.
555 *
556 * Supported by API versions 9 and newer.
557 */
558extern float4 __attribute__((const, overloadable))cbrt(float4);
559#endif
560
561#if (defined(RS_VERSION) && (RS_VERSION >= 9))
562/*
563 * Return the smallest integer not less than a value.
564 *
565 * Supported by API versions 9 and newer.
566 */
567extern float __attribute__((const, overloadable))ceil(float);
568#endif
569
570#if (defined(RS_VERSION) && (RS_VERSION >= 9))
571/*
572 * Return the smallest integer not less than a value.
573 *
574 * Supported by API versions 9 and newer.
575 */
576extern float2 __attribute__((const, overloadable))ceil(float2);
577#endif
578
579#if (defined(RS_VERSION) && (RS_VERSION >= 9))
580/*
581 * Return the smallest integer not less than a value.
582 *
583 * Supported by API versions 9 and newer.
584 */
585extern float3 __attribute__((const, overloadable))ceil(float3);
586#endif
587
588#if (defined(RS_VERSION) && (RS_VERSION >= 9))
589/*
590 * Return the smallest integer not less than a value.
591 *
592 * Supported by API versions 9 and newer.
593 */
594extern float4 __attribute__((const, overloadable))ceil(float4);
595#endif
596
597#if (defined(RS_VERSION) && (RS_VERSION >= 9))
598/*
599 * Clamp a value to a specified high and low bound.
600 *
601 * @param amount value to be clamped. Supports 1,2,3,4 components
602 * @param min_value Lower bound, must be scalar or matching vector.
603 * @param max_value High bound, must match type of low
604 *
605 * Supported by API versions 9 and newer.
606 */
607extern float __attribute__((const, overloadable))clamp(float value, float min_value, float max_value);
608#endif
609
610#if (defined(RS_VERSION) && (RS_VERSION >= 9))
611/*
612 * Clamp a value to a specified high and low bound.
613 *
614 * @param amount value to be clamped. Supports 1,2,3,4 components
615 * @param min_value Lower bound, must be scalar or matching vector.
616 * @param max_value High bound, must match type of low
617 *
618 * Supported by API versions 9 and newer.
619 */
620extern float2 __attribute__((const, overloadable))clamp(float2 value, float2 min_value, float2 max_value);
621#endif
622
623#if (defined(RS_VERSION) && (RS_VERSION >= 9))
624/*
625 * Clamp a value to a specified high and low bound.
626 *
627 * @param amount value to be clamped. Supports 1,2,3,4 components
628 * @param min_value Lower bound, must be scalar or matching vector.
629 * @param max_value High bound, must match type of low
630 *
631 * Supported by API versions 9 and newer.
632 */
633extern float3 __attribute__((const, overloadable))clamp(float3 value, float3 min_value, float3 max_value);
634#endif
635
636#if (defined(RS_VERSION) && (RS_VERSION >= 9))
637/*
638 * Clamp a value to a specified high and low bound.
639 *
640 * @param amount value to be clamped. Supports 1,2,3,4 components
641 * @param min_value Lower bound, must be scalar or matching vector.
642 * @param max_value High bound, must match type of low
643 *
644 * Supported by API versions 9 and newer.
645 */
646extern float4 __attribute__((const, overloadable))clamp(float4 value, float4 min_value, float4 max_value);
647#endif
648
649#if (defined(RS_VERSION) && (RS_VERSION >= 9))
650/*
651 * Clamp a value to a specified high and low bound.
652 *
653 * @param amount value to be clamped. Supports 1,2,3,4 components
654 * @param min_value Lower bound, must be scalar or matching vector.
655 * @param max_value High bound, must match type of low
656 *
657 * Supported by API versions 9 and newer.
658 */
659extern float2 __attribute__((const, overloadable))clamp(float2 value, float min_value, float max_value);
660#endif
661
662#if (defined(RS_VERSION) && (RS_VERSION >= 9))
663/*
664 * Clamp a value to a specified high and low bound.
665 *
666 * @param amount value to be clamped. Supports 1,2,3,4 components
667 * @param min_value Lower bound, must be scalar or matching vector.
668 * @param max_value High bound, must match type of low
669 *
670 * Supported by API versions 9 and newer.
671 */
672extern float3 __attribute__((const, overloadable))clamp(float3 value, float min_value, float max_value);
673#endif
674
675#if (defined(RS_VERSION) && (RS_VERSION >= 9))
676/*
677 * Clamp a value to a specified high and low bound.
678 *
679 * @param amount value to be clamped. Supports 1,2,3,4 components
680 * @param min_value Lower bound, must be scalar or matching vector.
681 * @param max_value High bound, must match type of low
682 *
683 * Supported by API versions 9 and newer.
684 */
685extern float4 __attribute__((const, overloadable))clamp(float4 value, float min_value, float max_value);
686#endif
687
688#if (defined(RS_VERSION) && (RS_VERSION >= 19))
689/*
690 * Clamp a value to a specified high and low bound.
691 *
692 * @param amount value to be clamped. Supports 1,2,3,4 components
693 * @param min_value Lower bound, must be scalar or matching vector.
694 * @param max_value High bound, must match type of low
695 *
696 * Supported by API versions 19 and newer.
697 */
698extern char __attribute__((const, overloadable))clamp(char value, char min_value, char max_value);
699#endif
700
701#if (defined(RS_VERSION) && (RS_VERSION >= 19))
702/*
703 * Clamp a value to a specified high and low bound.
704 *
705 * @param amount value to be clamped. Supports 1,2,3,4 components
706 * @param min_value Lower bound, must be scalar or matching vector.
707 * @param max_value High bound, must match type of low
708 *
709 * Supported by API versions 19 and newer.
710 */
711extern char2 __attribute__((const, overloadable))clamp(char2 value, char2 min_value, char2 max_value);
712#endif
713
714#if (defined(RS_VERSION) && (RS_VERSION >= 19))
715/*
716 * Clamp a value to a specified high and low bound.
717 *
718 * @param amount value to be clamped. Supports 1,2,3,4 components
719 * @param min_value Lower bound, must be scalar or matching vector.
720 * @param max_value High bound, must match type of low
721 *
722 * Supported by API versions 19 and newer.
723 */
724extern char3 __attribute__((const, overloadable))clamp(char3 value, char3 min_value, char3 max_value);
725#endif
726
727#if (defined(RS_VERSION) && (RS_VERSION >= 19))
728/*
729 * Clamp a value to a specified high and low bound.
730 *
731 * @param amount value to be clamped. Supports 1,2,3,4 components
732 * @param min_value Lower bound, must be scalar or matching vector.
733 * @param max_value High bound, must match type of low
734 *
735 * Supported by API versions 19 and newer.
736 */
737extern char4 __attribute__((const, overloadable))clamp(char4 value, char4 min_value, char4 max_value);
738#endif
739
740#if (defined(RS_VERSION) && (RS_VERSION >= 19))
741/*
742 * Clamp a value to a specified high and low bound.
743 *
744 * @param amount value to be clamped. Supports 1,2,3,4 components
745 * @param min_value Lower bound, must be scalar or matching vector.
746 * @param max_value High bound, must match type of low
747 *
748 * Supported by API versions 19 and newer.
749 */
750extern uchar __attribute__((const, overloadable))clamp(uchar value, uchar min_value, uchar max_value);
751#endif
752
753#if (defined(RS_VERSION) && (RS_VERSION >= 19))
754/*
755 * Clamp a value to a specified high and low bound.
756 *
757 * @param amount value to be clamped. Supports 1,2,3,4 components
758 * @param min_value Lower bound, must be scalar or matching vector.
759 * @param max_value High bound, must match type of low
760 *
761 * Supported by API versions 19 and newer.
762 */
763extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
764#endif
765
766#if (defined(RS_VERSION) && (RS_VERSION >= 19))
767/*
768 * Clamp a value to a specified high and low bound.
769 *
770 * @param amount value to be clamped. Supports 1,2,3,4 components
771 * @param min_value Lower bound, must be scalar or matching vector.
772 * @param max_value High bound, must match type of low
773 *
774 * Supported by API versions 19 and newer.
775 */
776extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
777#endif
778
779#if (defined(RS_VERSION) && (RS_VERSION >= 19))
780/*
781 * Clamp a value to a specified high and low bound.
782 *
783 * @param amount value to be clamped. Supports 1,2,3,4 components
784 * @param min_value Lower bound, must be scalar or matching vector.
785 * @param max_value High bound, must match type of low
786 *
787 * Supported by API versions 19 and newer.
788 */
789extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
790#endif
791
792#if (defined(RS_VERSION) && (RS_VERSION >= 19))
793/*
794 * Clamp a value to a specified high and low bound.
795 *
796 * @param amount value to be clamped. Supports 1,2,3,4 components
797 * @param min_value Lower bound, must be scalar or matching vector.
798 * @param max_value High bound, must match type of low
799 *
800 * Supported by API versions 19 and newer.
801 */
802extern short __attribute__((const, overloadable))clamp(short value, short min_value, short max_value);
803#endif
804
805#if (defined(RS_VERSION) && (RS_VERSION >= 19))
806/*
807 * Clamp a value to a specified high and low bound.
808 *
809 * @param amount value to be clamped. Supports 1,2,3,4 components
810 * @param min_value Lower bound, must be scalar or matching vector.
811 * @param max_value High bound, must match type of low
812 *
813 * Supported by API versions 19 and newer.
814 */
815extern short2 __attribute__((const, overloadable))clamp(short2 value, short2 min_value, short2 max_value);
816#endif
817
818#if (defined(RS_VERSION) && (RS_VERSION >= 19))
819/*
820 * Clamp a value to a specified high and low bound.
821 *
822 * @param amount value to be clamped. Supports 1,2,3,4 components
823 * @param min_value Lower bound, must be scalar or matching vector.
824 * @param max_value High bound, must match type of low
825 *
826 * Supported by API versions 19 and newer.
827 */
828extern short3 __attribute__((const, overloadable))clamp(short3 value, short3 min_value, short3 max_value);
829#endif
830
831#if (defined(RS_VERSION) && (RS_VERSION >= 19))
832/*
833 * Clamp a value to a specified high and low bound.
834 *
835 * @param amount value to be clamped. Supports 1,2,3,4 components
836 * @param min_value Lower bound, must be scalar or matching vector.
837 * @param max_value High bound, must match type of low
838 *
839 * Supported by API versions 19 and newer.
840 */
841extern short4 __attribute__((const, overloadable))clamp(short4 value, short4 min_value, short4 max_value);
842#endif
843
844#if (defined(RS_VERSION) && (RS_VERSION >= 19))
845/*
846 * Clamp a value to a specified high and low bound.
847 *
848 * @param amount value to be clamped. Supports 1,2,3,4 components
849 * @param min_value Lower bound, must be scalar or matching vector.
850 * @param max_value High bound, must match type of low
851 *
852 * Supported by API versions 19 and newer.
853 */
854extern ushort __attribute__((const, overloadable))clamp(ushort value, ushort min_value, ushort max_value);
855#endif
856
857#if (defined(RS_VERSION) && (RS_VERSION >= 19))
858/*
859 * Clamp a value to a specified high and low bound.
860 *
861 * @param amount value to be clamped. Supports 1,2,3,4 components
862 * @param min_value Lower bound, must be scalar or matching vector.
863 * @param max_value High bound, must match type of low
864 *
865 * Supported by API versions 19 and newer.
866 */
867extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
868#endif
869
870#if (defined(RS_VERSION) && (RS_VERSION >= 19))
871/*
872 * Clamp a value to a specified high and low bound.
873 *
874 * @param amount value to be clamped. Supports 1,2,3,4 components
875 * @param min_value Lower bound, must be scalar or matching vector.
876 * @param max_value High bound, must match type of low
877 *
878 * Supported by API versions 19 and newer.
879 */
880extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
881#endif
882
883#if (defined(RS_VERSION) && (RS_VERSION >= 19))
884/*
885 * Clamp a value to a specified high and low bound.
886 *
887 * @param amount value to be clamped. Supports 1,2,3,4 components
888 * @param min_value Lower bound, must be scalar or matching vector.
889 * @param max_value High bound, must match type of low
890 *
891 * Supported by API versions 19 and newer.
892 */
893extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
894#endif
895
896#if (defined(RS_VERSION) && (RS_VERSION >= 19))
897/*
898 * Clamp a value to a specified high and low bound.
899 *
900 * @param amount value to be clamped. Supports 1,2,3,4 components
901 * @param min_value Lower bound, must be scalar or matching vector.
902 * @param max_value High bound, must match type of low
903 *
904 * Supported by API versions 19 and newer.
905 */
906extern int __attribute__((const, overloadable))clamp(int value, int min_value, int max_value);
907#endif
908
909#if (defined(RS_VERSION) && (RS_VERSION >= 19))
910/*
911 * Clamp a value to a specified high and low bound.
912 *
913 * @param amount value to be clamped. Supports 1,2,3,4 components
914 * @param min_value Lower bound, must be scalar or matching vector.
915 * @param max_value High bound, must match type of low
916 *
917 * Supported by API versions 19 and newer.
918 */
919extern int2 __attribute__((const, overloadable))clamp(int2 value, int2 min_value, int2 max_value);
920#endif
921
922#if (defined(RS_VERSION) && (RS_VERSION >= 19))
923/*
924 * Clamp a value to a specified high and low bound.
925 *
926 * @param amount value to be clamped. Supports 1,2,3,4 components
927 * @param min_value Lower bound, must be scalar or matching vector.
928 * @param max_value High bound, must match type of low
929 *
930 * Supported by API versions 19 and newer.
931 */
932extern int3 __attribute__((const, overloadable))clamp(int3 value, int3 min_value, int3 max_value);
933#endif
934
935#if (defined(RS_VERSION) && (RS_VERSION >= 19))
936/*
937 * Clamp a value to a specified high and low bound.
938 *
939 * @param amount value to be clamped. Supports 1,2,3,4 components
940 * @param min_value Lower bound, must be scalar or matching vector.
941 * @param max_value High bound, must match type of low
942 *
943 * Supported by API versions 19 and newer.
944 */
945extern int4 __attribute__((const, overloadable))clamp(int4 value, int4 min_value, int4 max_value);
946#endif
947
948#if (defined(RS_VERSION) && (RS_VERSION >= 19))
949/*
950 * Clamp a value to a specified high and low bound.
951 *
952 * @param amount value to be clamped. Supports 1,2,3,4 components
953 * @param min_value Lower bound, must be scalar or matching vector.
954 * @param max_value High bound, must match type of low
955 *
956 * Supported by API versions 19 and newer.
957 */
958extern uint __attribute__((const, overloadable))clamp(uint value, uint min_value, uint max_value);
959#endif
960
961#if (defined(RS_VERSION) && (RS_VERSION >= 19))
962/*
963 * Clamp a value to a specified high and low bound.
964 *
965 * @param amount value to be clamped. Supports 1,2,3,4 components
966 * @param min_value Lower bound, must be scalar or matching vector.
967 * @param max_value High bound, must match type of low
968 *
969 * Supported by API versions 19 and newer.
970 */
971extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint2 min_value, uint2 max_value);
972#endif
973
974#if (defined(RS_VERSION) && (RS_VERSION >= 19))
975/*
976 * Clamp a value to a specified high and low bound.
977 *
978 * @param amount value to be clamped. Supports 1,2,3,4 components
979 * @param min_value Lower bound, must be scalar or matching vector.
980 * @param max_value High bound, must match type of low
981 *
982 * Supported by API versions 19 and newer.
983 */
984extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint3 min_value, uint3 max_value);
985#endif
986
987#if (defined(RS_VERSION) && (RS_VERSION >= 19))
988/*
989 * Clamp a value to a specified high and low bound.
990 *
991 * @param amount value to be clamped. Supports 1,2,3,4 components
992 * @param min_value Lower bound, must be scalar or matching vector.
993 * @param max_value High bound, must match type of low
994 *
995 * Supported by API versions 19 and newer.
996 */
997extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint4 min_value, uint4 max_value);
998#endif
999
1000#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1001/*
1002 * Clamp a value to a specified high and low bound.
1003 *
1004 * @param amount value to be clamped. Supports 1,2,3,4 components
1005 * @param min_value Lower bound, must be scalar or matching vector.
1006 * @param max_value High bound, must match type of low
1007 *
1008 * Supported by API versions 19 and newer.
1009 */
1010extern long __attribute__((const, overloadable))clamp(long value, long min_value, long max_value);
1011#endif
1012
1013#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1014/*
1015 * Clamp a value to a specified high and low bound.
1016 *
1017 * @param amount value to be clamped. Supports 1,2,3,4 components
1018 * @param min_value Lower bound, must be scalar or matching vector.
1019 * @param max_value High bound, must match type of low
1020 *
1021 * Supported by API versions 19 and newer.
1022 */
1023extern long2 __attribute__((const, overloadable))clamp(long2 value, long2 min_value, long2 max_value);
1024#endif
1025
1026#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1027/*
1028 * Clamp a value to a specified high and low bound.
1029 *
1030 * @param amount value to be clamped. Supports 1,2,3,4 components
1031 * @param min_value Lower bound, must be scalar or matching vector.
1032 * @param max_value High bound, must match type of low
1033 *
1034 * Supported by API versions 19 and newer.
1035 */
1036extern long3 __attribute__((const, overloadable))clamp(long3 value, long3 min_value, long3 max_value);
1037#endif
1038
1039#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1040/*
1041 * Clamp a value to a specified high and low bound.
1042 *
1043 * @param amount value to be clamped. Supports 1,2,3,4 components
1044 * @param min_value Lower bound, must be scalar or matching vector.
1045 * @param max_value High bound, must match type of low
1046 *
1047 * Supported by API versions 19 and newer.
1048 */
1049extern long4 __attribute__((const, overloadable))clamp(long4 value, long4 min_value, long4 max_value);
1050#endif
1051
1052#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1053/*
1054 * Clamp a value to a specified high and low bound.
1055 *
1056 * @param amount value to be clamped. Supports 1,2,3,4 components
1057 * @param min_value Lower bound, must be scalar or matching vector.
1058 * @param max_value High bound, must match type of low
1059 *
1060 * Supported by API versions 19 and newer.
1061 */
1062extern ulong __attribute__((const, overloadable))clamp(ulong value, ulong min_value, ulong max_value);
1063#endif
1064
1065#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1066/*
1067 * Clamp a value to a specified high and low bound.
1068 *
1069 * @param amount value to be clamped. Supports 1,2,3,4 components
1070 * @param min_value Lower bound, must be scalar or matching vector.
1071 * @param max_value High bound, must match type of low
1072 *
1073 * Supported by API versions 19 and newer.
1074 */
1075extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
1076#endif
1077
1078#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1079/*
1080 * Clamp a value to a specified high and low bound.
1081 *
1082 * @param amount value to be clamped. Supports 1,2,3,4 components
1083 * @param min_value Lower bound, must be scalar or matching vector.
1084 * @param max_value High bound, must match type of low
1085 *
1086 * Supported by API versions 19 and newer.
1087 */
1088extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
1089#endif
1090
1091#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1092/*
1093 * Clamp a value to a specified high and low bound.
1094 *
1095 * @param amount value to be clamped. Supports 1,2,3,4 components
1096 * @param min_value Lower bound, must be scalar or matching vector.
1097 * @param max_value High bound, must match type of low
1098 *
1099 * Supported by API versions 19 and newer.
1100 */
1101extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
1102#endif
1103
1104#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1105/*
1106 * Clamp a value to a specified high and low bound.
1107 *
1108 * @param amount value to be clamped. Supports 1,2,3,4 components
1109 * @param min_value Lower bound, must be scalar or matching vector.
1110 * @param max_value High bound, must match type of low
1111 *
1112 * Supported by API versions 19 and newer.
1113 */
1114extern char2 __attribute__((const, overloadable))clamp(char2 value, char min_value, char max_value);
1115#endif
1116
1117#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1118/*
1119 * Clamp a value to a specified high and low bound.
1120 *
1121 * @param amount value to be clamped. Supports 1,2,3,4 components
1122 * @param min_value Lower bound, must be scalar or matching vector.
1123 * @param max_value High bound, must match type of low
1124 *
1125 * Supported by API versions 19 and newer.
1126 */
1127extern char3 __attribute__((const, overloadable))clamp(char3 value, char min_value, char max_value);
1128#endif
1129
1130#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1131/*
1132 * Clamp a value to a specified high and low bound.
1133 *
1134 * @param amount value to be clamped. Supports 1,2,3,4 components
1135 * @param min_value Lower bound, must be scalar or matching vector.
1136 * @param max_value High bound, must match type of low
1137 *
1138 * Supported by API versions 19 and newer.
1139 */
1140extern char4 __attribute__((const, overloadable))clamp(char4 value, char min_value, char max_value);
1141#endif
1142
1143#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1144/*
1145 * Clamp a value to a specified high and low bound.
1146 *
1147 * @param amount value to be clamped. Supports 1,2,3,4 components
1148 * @param min_value Lower bound, must be scalar or matching vector.
1149 * @param max_value High bound, must match type of low
1150 *
1151 * Supported by API versions 19 and newer.
1152 */
1153extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar min_value, uchar max_value);
1154#endif
1155
1156#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1157/*
1158 * Clamp a value to a specified high and low bound.
1159 *
1160 * @param amount value to be clamped. Supports 1,2,3,4 components
1161 * @param min_value Lower bound, must be scalar or matching vector.
1162 * @param max_value High bound, must match type of low
1163 *
1164 * Supported by API versions 19 and newer.
1165 */
1166extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar min_value, uchar max_value);
1167#endif
1168
1169#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1170/*
1171 * Clamp a value to a specified high and low bound.
1172 *
1173 * @param amount value to be clamped. Supports 1,2,3,4 components
1174 * @param min_value Lower bound, must be scalar or matching vector.
1175 * @param max_value High bound, must match type of low
1176 *
1177 * Supported by API versions 19 and newer.
1178 */
1179extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar min_value, uchar max_value);
1180#endif
1181
1182#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1183/*
1184 * Clamp a value to a specified high and low bound.
1185 *
1186 * @param amount value to be clamped. Supports 1,2,3,4 components
1187 * @param min_value Lower bound, must be scalar or matching vector.
1188 * @param max_value High bound, must match type of low
1189 *
1190 * Supported by API versions 19 and newer.
1191 */
1192extern short2 __attribute__((const, overloadable))clamp(short2 value, short min_value, short max_value);
1193#endif
1194
1195#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1196/*
1197 * Clamp a value to a specified high and low bound.
1198 *
1199 * @param amount value to be clamped. Supports 1,2,3,4 components
1200 * @param min_value Lower bound, must be scalar or matching vector.
1201 * @param max_value High bound, must match type of low
1202 *
1203 * Supported by API versions 19 and newer.
1204 */
1205extern short3 __attribute__((const, overloadable))clamp(short3 value, short min_value, short max_value);
1206#endif
1207
1208#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1209/*
1210 * Clamp a value to a specified high and low bound.
1211 *
1212 * @param amount value to be clamped. Supports 1,2,3,4 components
1213 * @param min_value Lower bound, must be scalar or matching vector.
1214 * @param max_value High bound, must match type of low
1215 *
1216 * Supported by API versions 19 and newer.
1217 */
1218extern short4 __attribute__((const, overloadable))clamp(short4 value, short min_value, short max_value);
1219#endif
1220
1221#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1222/*
1223 * Clamp a value to a specified high and low bound.
1224 *
1225 * @param amount value to be clamped. Supports 1,2,3,4 components
1226 * @param min_value Lower bound, must be scalar or matching vector.
1227 * @param max_value High bound, must match type of low
1228 *
1229 * Supported by API versions 19 and newer.
1230 */
1231extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort min_value, ushort max_value);
1232#endif
1233
1234#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1235/*
1236 * Clamp a value to a specified high and low bound.
1237 *
1238 * @param amount value to be clamped. Supports 1,2,3,4 components
1239 * @param min_value Lower bound, must be scalar or matching vector.
1240 * @param max_value High bound, must match type of low
1241 *
1242 * Supported by API versions 19 and newer.
1243 */
1244extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort min_value, ushort max_value);
1245#endif
1246
1247#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1248/*
1249 * Clamp a value to a specified high and low bound.
1250 *
1251 * @param amount value to be clamped. Supports 1,2,3,4 components
1252 * @param min_value Lower bound, must be scalar or matching vector.
1253 * @param max_value High bound, must match type of low
1254 *
1255 * Supported by API versions 19 and newer.
1256 */
1257extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort min_value, ushort max_value);
1258#endif
1259
1260#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1261/*
1262 * Clamp a value to a specified high and low bound.
1263 *
1264 * @param amount value to be clamped. Supports 1,2,3,4 components
1265 * @param min_value Lower bound, must be scalar or matching vector.
1266 * @param max_value High bound, must match type of low
1267 *
1268 * Supported by API versions 19 and newer.
1269 */
1270extern int2 __attribute__((const, overloadable))clamp(int2 value, int min_value, int max_value);
1271#endif
1272
1273#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1274/*
1275 * Clamp a value to a specified high and low bound.
1276 *
1277 * @param amount value to be clamped. Supports 1,2,3,4 components
1278 * @param min_value Lower bound, must be scalar or matching vector.
1279 * @param max_value High bound, must match type of low
1280 *
1281 * Supported by API versions 19 and newer.
1282 */
1283extern int3 __attribute__((const, overloadable))clamp(int3 value, int min_value, int max_value);
1284#endif
1285
1286#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1287/*
1288 * Clamp a value to a specified high and low bound.
1289 *
1290 * @param amount value to be clamped. Supports 1,2,3,4 components
1291 * @param min_value Lower bound, must be scalar or matching vector.
1292 * @param max_value High bound, must match type of low
1293 *
1294 * Supported by API versions 19 and newer.
1295 */
1296extern int4 __attribute__((const, overloadable))clamp(int4 value, int min_value, int max_value);
1297#endif
1298
1299#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1300/*
1301 * Clamp a value to a specified high and low bound.
1302 *
1303 * @param amount value to be clamped. Supports 1,2,3,4 components
1304 * @param min_value Lower bound, must be scalar or matching vector.
1305 * @param max_value High bound, must match type of low
1306 *
1307 * Supported by API versions 19 and newer.
1308 */
1309extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint min_value, uint max_value);
1310#endif
1311
1312#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1313/*
1314 * Clamp a value to a specified high and low bound.
1315 *
1316 * @param amount value to be clamped. Supports 1,2,3,4 components
1317 * @param min_value Lower bound, must be scalar or matching vector.
1318 * @param max_value High bound, must match type of low
1319 *
1320 * Supported by API versions 19 and newer.
1321 */
1322extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint min_value, uint max_value);
1323#endif
1324
1325#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1326/*
1327 * Clamp a value to a specified high and low bound.
1328 *
1329 * @param amount value to be clamped. Supports 1,2,3,4 components
1330 * @param min_value Lower bound, must be scalar or matching vector.
1331 * @param max_value High bound, must match type of low
1332 *
1333 * Supported by API versions 19 and newer.
1334 */
1335extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint min_value, uint max_value);
1336#endif
1337
1338#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1339/*
1340 * Clamp a value to a specified high and low bound.
1341 *
1342 * @param amount value to be clamped. Supports 1,2,3,4 components
1343 * @param min_value Lower bound, must be scalar or matching vector.
1344 * @param max_value High bound, must match type of low
1345 *
1346 * Supported by API versions 19 and newer.
1347 */
1348extern long2 __attribute__((const, overloadable))clamp(long2 value, long min_value, long max_value);
1349#endif
1350
1351#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1352/*
1353 * Clamp a value to a specified high and low bound.
1354 *
1355 * @param amount value to be clamped. Supports 1,2,3,4 components
1356 * @param min_value Lower bound, must be scalar or matching vector.
1357 * @param max_value High bound, must match type of low
1358 *
1359 * Supported by API versions 19 and newer.
1360 */
1361extern long3 __attribute__((const, overloadable))clamp(long3 value, long min_value, long max_value);
1362#endif
1363
1364#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1365/*
1366 * Clamp a value to a specified high and low bound.
1367 *
1368 * @param amount value to be clamped. Supports 1,2,3,4 components
1369 * @param min_value Lower bound, must be scalar or matching vector.
1370 * @param max_value High bound, must match type of low
1371 *
1372 * Supported by API versions 19 and newer.
1373 */
1374extern long4 __attribute__((const, overloadable))clamp(long4 value, long min_value, long max_value);
1375#endif
1376
1377#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1378/*
1379 * Clamp a value to a specified high and low bound.
1380 *
1381 * @param amount value to be clamped. Supports 1,2,3,4 components
1382 * @param min_value Lower bound, must be scalar or matching vector.
1383 * @param max_value High bound, must match type of low
1384 *
1385 * Supported by API versions 19 and newer.
1386 */
1387extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong min_value, ulong max_value);
1388#endif
1389
1390#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1391/*
1392 * Clamp a value to a specified high and low bound.
1393 *
1394 * @param amount value to be clamped. Supports 1,2,3,4 components
1395 * @param min_value Lower bound, must be scalar or matching vector.
1396 * @param max_value High bound, must match type of low
1397 *
1398 * Supported by API versions 19 and newer.
1399 */
1400extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong min_value, ulong max_value);
1401#endif
1402
1403#if (defined(RS_VERSION) && (RS_VERSION >= 19))
1404/*
1405 * Clamp a value to a specified high and low bound.
1406 *
1407 * @param amount value to be clamped. Supports 1,2,3,4 components
1408 * @param min_value Lower bound, must be scalar or matching vector.
1409 * @param max_value High bound, must match type of low
1410 *
1411 * Supported by API versions 19 and newer.
1412 */
1413extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong min_value, ulong max_value);
1414#endif
1415
1416#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1417/*
1418 * Return the number of leading 0-bits in a value.
1419 *
1420 * Supported by API versions 9 and newer.
1421 */
1422extern char __attribute__((const, overloadable))clz(char value);
1423#endif
1424
1425#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1426/*
1427 * Return the number of leading 0-bits in a value.
1428 *
1429 * Supported by API versions 9 and newer.
1430 */
1431extern char2 __attribute__((const, overloadable))clz(char2 value);
1432#endif
1433
1434#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1435/*
1436 * Return the number of leading 0-bits in a value.
1437 *
1438 * Supported by API versions 9 and newer.
1439 */
1440extern char3 __attribute__((const, overloadable))clz(char3 value);
1441#endif
1442
1443#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1444/*
1445 * Return the number of leading 0-bits in a value.
1446 *
1447 * Supported by API versions 9 and newer.
1448 */
1449extern char4 __attribute__((const, overloadable))clz(char4 value);
1450#endif
1451
1452#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1453/*
1454 * Return the number of leading 0-bits in a value.
1455 *
1456 * Supported by API versions 9 and newer.
1457 */
1458extern uchar __attribute__((const, overloadable))clz(uchar value);
1459#endif
1460
1461#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1462/*
1463 * Return the number of leading 0-bits in a value.
1464 *
1465 * Supported by API versions 9 and newer.
1466 */
1467extern uchar2 __attribute__((const, overloadable))clz(uchar2 value);
1468#endif
1469
1470#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1471/*
1472 * Return the number of leading 0-bits in a value.
1473 *
1474 * Supported by API versions 9 and newer.
1475 */
1476extern uchar3 __attribute__((const, overloadable))clz(uchar3 value);
1477#endif
1478
1479#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1480/*
1481 * Return the number of leading 0-bits in a value.
1482 *
1483 * Supported by API versions 9 and newer.
1484 */
1485extern uchar4 __attribute__((const, overloadable))clz(uchar4 value);
1486#endif
1487
1488#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1489/*
1490 * Return the number of leading 0-bits in a value.
1491 *
1492 * Supported by API versions 9 and newer.
1493 */
1494extern short __attribute__((const, overloadable))clz(short value);
1495#endif
1496
1497#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1498/*
1499 * Return the number of leading 0-bits in a value.
1500 *
1501 * Supported by API versions 9 and newer.
1502 */
1503extern short2 __attribute__((const, overloadable))clz(short2 value);
1504#endif
1505
1506#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1507/*
1508 * Return the number of leading 0-bits in a value.
1509 *
1510 * Supported by API versions 9 and newer.
1511 */
1512extern short3 __attribute__((const, overloadable))clz(short3 value);
1513#endif
1514
1515#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1516/*
1517 * Return the number of leading 0-bits in a value.
1518 *
1519 * Supported by API versions 9 and newer.
1520 */
1521extern short4 __attribute__((const, overloadable))clz(short4 value);
1522#endif
1523
1524#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1525/*
1526 * Return the number of leading 0-bits in a value.
1527 *
1528 * Supported by API versions 9 and newer.
1529 */
1530extern ushort __attribute__((const, overloadable))clz(ushort value);
1531#endif
1532
1533#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1534/*
1535 * Return the number of leading 0-bits in a value.
1536 *
1537 * Supported by API versions 9 and newer.
1538 */
1539extern ushort2 __attribute__((const, overloadable))clz(ushort2 value);
1540#endif
1541
1542#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1543/*
1544 * Return the number of leading 0-bits in a value.
1545 *
1546 * Supported by API versions 9 and newer.
1547 */
1548extern ushort3 __attribute__((const, overloadable))clz(ushort3 value);
1549#endif
1550
1551#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1552/*
1553 * Return the number of leading 0-bits in a value.
1554 *
1555 * Supported by API versions 9 and newer.
1556 */
1557extern ushort4 __attribute__((const, overloadable))clz(ushort4 value);
1558#endif
1559
1560#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1561/*
1562 * Return the number of leading 0-bits in a value.
1563 *
1564 * Supported by API versions 9 and newer.
1565 */
1566extern int __attribute__((const, overloadable))clz(int value);
1567#endif
1568
1569#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1570/*
1571 * Return the number of leading 0-bits in a value.
1572 *
1573 * Supported by API versions 9 and newer.
1574 */
1575extern int2 __attribute__((const, overloadable))clz(int2 value);
1576#endif
1577
1578#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1579/*
1580 * Return the number of leading 0-bits in a value.
1581 *
1582 * Supported by API versions 9 and newer.
1583 */
1584extern int3 __attribute__((const, overloadable))clz(int3 value);
1585#endif
1586
1587#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1588/*
1589 * Return the number of leading 0-bits in a value.
1590 *
1591 * Supported by API versions 9 and newer.
1592 */
1593extern int4 __attribute__((const, overloadable))clz(int4 value);
1594#endif
1595
1596#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1597/*
1598 * Return the number of leading 0-bits in a value.
1599 *
1600 * Supported by API versions 9 and newer.
1601 */
1602extern uint __attribute__((const, overloadable))clz(uint value);
1603#endif
1604
1605#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1606/*
1607 * Return the number of leading 0-bits in a value.
1608 *
1609 * Supported by API versions 9 and newer.
1610 */
1611extern uint2 __attribute__((const, overloadable))clz(uint2 value);
1612#endif
1613
1614#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1615/*
1616 * Return the number of leading 0-bits in a value.
1617 *
1618 * Supported by API versions 9 and newer.
1619 */
1620extern uint3 __attribute__((const, overloadable))clz(uint3 value);
1621#endif
1622
1623#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1624/*
1625 * Return the number of leading 0-bits in a value.
1626 *
1627 * Supported by API versions 9 and newer.
1628 */
1629extern uint4 __attribute__((const, overloadable))clz(uint4 value);
1630#endif
1631
1632#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1633/*
Jason Sams29087fa2014-01-09 17:06:17 -08001634 * Component wise conversion from float2 to float2
1635 *
1636 * Supported by API versions 9 and newer.
1637 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001638extern float2 __attribute__((const, overloadable))convert_float2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001639#endif
1640
1641#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1642/*
1643 * Component wise conversion from float3 to float3
1644 *
1645 * Supported by API versions 9 and newer.
1646 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001647extern float3 __attribute__((const, overloadable))convert_float3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001648#endif
1649
1650#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1651/*
1652 * Component wise conversion from float4 to float4
1653 *
1654 * Supported by API versions 9 and newer.
1655 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001656extern float4 __attribute__((const, overloadable))convert_float4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001657#endif
1658
1659#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1660/*
Jason Sams29087fa2014-01-09 17:06:17 -08001661 * Component wise conversion from char2 to float2
1662 *
1663 * Supported by API versions 9 and newer.
1664 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001665extern float2 __attribute__((const, overloadable))convert_float2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001666#endif
1667
1668#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1669/*
1670 * Component wise conversion from char3 to float3
1671 *
1672 * Supported by API versions 9 and newer.
1673 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001674extern float3 __attribute__((const, overloadable))convert_float3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001675#endif
1676
1677#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1678/*
1679 * Component wise conversion from char4 to float4
1680 *
1681 * Supported by API versions 9 and newer.
1682 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001683extern float4 __attribute__((const, overloadable))convert_float4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001684#endif
1685
1686#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1687/*
1688 * Component wise conversion from uchar2 to float2
1689 *
1690 * Supported by API versions 9 and newer.
1691 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001692extern float2 __attribute__((const, overloadable))convert_float2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001693#endif
1694
1695#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1696/*
1697 * Component wise conversion from uchar3 to float3
1698 *
1699 * Supported by API versions 9 and newer.
1700 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001701extern float3 __attribute__((const, overloadable))convert_float3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001702#endif
1703
1704#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1705/*
1706 * Component wise conversion from uchar4 to float4
1707 *
1708 * Supported by API versions 9 and newer.
1709 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001710extern float4 __attribute__((const, overloadable))convert_float4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001711#endif
1712
1713#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1714/*
1715 * Component wise conversion from short2 to float2
1716 *
1717 * Supported by API versions 9 and newer.
1718 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001719extern float2 __attribute__((const, overloadable))convert_float2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001720#endif
1721
1722#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1723/*
1724 * Component wise conversion from short3 to float3
1725 *
1726 * Supported by API versions 9 and newer.
1727 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001728extern float3 __attribute__((const, overloadable))convert_float3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001729#endif
1730
1731#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1732/*
1733 * Component wise conversion from short4 to float4
1734 *
1735 * Supported by API versions 9 and newer.
1736 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001737extern float4 __attribute__((const, overloadable))convert_float4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001738#endif
1739
1740#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1741/*
1742 * Component wise conversion from ushort2 to float2
1743 *
1744 * Supported by API versions 9 and newer.
1745 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001746extern float2 __attribute__((const, overloadable))convert_float2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001747#endif
1748
1749#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1750/*
1751 * Component wise conversion from ushort3 to float3
1752 *
1753 * Supported by API versions 9 and newer.
1754 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001755extern float3 __attribute__((const, overloadable))convert_float3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001756#endif
1757
1758#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1759/*
1760 * Component wise conversion from ushort4 to float4
1761 *
1762 * Supported by API versions 9 and newer.
1763 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001764extern float4 __attribute__((const, overloadable))convert_float4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001765#endif
1766
1767#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1768/*
1769 * Component wise conversion from int2 to float2
1770 *
1771 * Supported by API versions 9 and newer.
1772 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001773extern float2 __attribute__((const, overloadable))convert_float2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001774#endif
1775
1776#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1777/*
1778 * Component wise conversion from int3 to float3
1779 *
1780 * Supported by API versions 9 and newer.
1781 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001782extern float3 __attribute__((const, overloadable))convert_float3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001783#endif
1784
1785#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1786/*
1787 * Component wise conversion from int4 to float4
1788 *
1789 * Supported by API versions 9 and newer.
1790 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001791extern float4 __attribute__((const, overloadable))convert_float4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001792#endif
1793
1794#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1795/*
1796 * Component wise conversion from uint2 to float2
1797 *
1798 * Supported by API versions 9 and newer.
1799 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001800extern float2 __attribute__((const, overloadable))convert_float2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001801#endif
1802
1803#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1804/*
1805 * Component wise conversion from uint3 to float3
1806 *
1807 * Supported by API versions 9 and newer.
1808 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001809extern float3 __attribute__((const, overloadable))convert_float3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001810#endif
1811
1812#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1813/*
1814 * Component wise conversion from uint4 to float4
1815 *
1816 * Supported by API versions 9 and newer.
1817 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001818extern float4 __attribute__((const, overloadable))convert_float4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001819#endif
1820
1821#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1822/*
Jason Sams29087fa2014-01-09 17:06:17 -08001823 * Component wise conversion from float2 to char2
1824 *
1825 * Supported by API versions 9 and newer.
1826 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001827extern char2 __attribute__((const, overloadable))convert_char2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001828#endif
1829
1830#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1831/*
1832 * Component wise conversion from float3 to char3
1833 *
1834 * Supported by API versions 9 and newer.
1835 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001836extern char3 __attribute__((const, overloadable))convert_char3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001837#endif
1838
1839#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1840/*
1841 * Component wise conversion from float4 to char4
1842 *
1843 * Supported by API versions 9 and newer.
1844 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001845extern char4 __attribute__((const, overloadable))convert_char4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001846#endif
1847
1848#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1849/*
Jason Sams29087fa2014-01-09 17:06:17 -08001850 * Component wise conversion from char2 to char2
1851 *
1852 * Supported by API versions 9 and newer.
1853 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001854extern char2 __attribute__((const, overloadable))convert_char2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001855#endif
1856
1857#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1858/*
1859 * Component wise conversion from char3 to char3
1860 *
1861 * Supported by API versions 9 and newer.
1862 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001863extern char3 __attribute__((const, overloadable))convert_char3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001864#endif
1865
1866#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1867/*
1868 * Component wise conversion from char4 to char4
1869 *
1870 * Supported by API versions 9 and newer.
1871 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001872extern char4 __attribute__((const, overloadable))convert_char4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001873#endif
1874
1875#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1876/*
1877 * Component wise conversion from uchar2 to char2
1878 *
1879 * Supported by API versions 9 and newer.
1880 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001881extern char2 __attribute__((const, overloadable))convert_char2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001882#endif
1883
1884#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1885/*
1886 * Component wise conversion from uchar3 to char3
1887 *
1888 * Supported by API versions 9 and newer.
1889 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001890extern char3 __attribute__((const, overloadable))convert_char3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001891#endif
1892
1893#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1894/*
1895 * Component wise conversion from uchar4 to char4
1896 *
1897 * Supported by API versions 9 and newer.
1898 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001899extern char4 __attribute__((const, overloadable))convert_char4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001900#endif
1901
1902#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1903/*
1904 * Component wise conversion from short2 to char2
1905 *
1906 * Supported by API versions 9 and newer.
1907 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001908extern char2 __attribute__((const, overloadable))convert_char2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001909#endif
1910
1911#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1912/*
1913 * Component wise conversion from short3 to char3
1914 *
1915 * Supported by API versions 9 and newer.
1916 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001917extern char3 __attribute__((const, overloadable))convert_char3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001918#endif
1919
1920#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1921/*
1922 * Component wise conversion from short4 to char4
1923 *
1924 * Supported by API versions 9 and newer.
1925 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001926extern char4 __attribute__((const, overloadable))convert_char4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001927#endif
1928
1929#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1930/*
1931 * Component wise conversion from ushort2 to char2
1932 *
1933 * Supported by API versions 9 and newer.
1934 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001935extern char2 __attribute__((const, overloadable))convert_char2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001936#endif
1937
1938#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1939/*
1940 * Component wise conversion from ushort3 to char3
1941 *
1942 * Supported by API versions 9 and newer.
1943 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001944extern char3 __attribute__((const, overloadable))convert_char3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001945#endif
1946
1947#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1948/*
1949 * Component wise conversion from ushort4 to char4
1950 *
1951 * Supported by API versions 9 and newer.
1952 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001953extern char4 __attribute__((const, overloadable))convert_char4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001954#endif
1955
1956#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1957/*
1958 * Component wise conversion from int2 to char2
1959 *
1960 * Supported by API versions 9 and newer.
1961 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001962extern char2 __attribute__((const, overloadable))convert_char2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001963#endif
1964
1965#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1966/*
1967 * Component wise conversion from int3 to char3
1968 *
1969 * Supported by API versions 9 and newer.
1970 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001971extern char3 __attribute__((const, overloadable))convert_char3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001972#endif
1973
1974#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1975/*
1976 * Component wise conversion from int4 to char4
1977 *
1978 * Supported by API versions 9 and newer.
1979 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001980extern char4 __attribute__((const, overloadable))convert_char4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001981#endif
1982
1983#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1984/*
1985 * Component wise conversion from uint2 to char2
1986 *
1987 * Supported by API versions 9 and newer.
1988 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001989extern char2 __attribute__((const, overloadable))convert_char2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001990#endif
1991
1992#if (defined(RS_VERSION) && (RS_VERSION >= 9))
1993/*
1994 * Component wise conversion from uint3 to char3
1995 *
1996 * Supported by API versions 9 and newer.
1997 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08001998extern char3 __attribute__((const, overloadable))convert_char3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08001999#endif
2000
2001#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2002/*
2003 * Component wise conversion from uint4 to char4
2004 *
2005 * Supported by API versions 9 and newer.
2006 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002007extern char4 __attribute__((const, overloadable))convert_char4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002008#endif
2009
2010#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2011/*
Jason Sams29087fa2014-01-09 17:06:17 -08002012 * Component wise conversion from float2 to uchar2
2013 *
2014 * Supported by API versions 9 and newer.
2015 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002016extern uchar2 __attribute__((const, overloadable))convert_uchar2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002017#endif
2018
2019#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2020/*
2021 * Component wise conversion from float3 to uchar3
2022 *
2023 * Supported by API versions 9 and newer.
2024 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002025extern uchar3 __attribute__((const, overloadable))convert_uchar3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002026#endif
2027
2028#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2029/*
2030 * Component wise conversion from float4 to uchar4
2031 *
2032 * Supported by API versions 9 and newer.
2033 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002034extern uchar4 __attribute__((const, overloadable))convert_uchar4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002035#endif
2036
2037#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2038/*
Jason Sams29087fa2014-01-09 17:06:17 -08002039 * Component wise conversion from char2 to uchar2
2040 *
2041 * Supported by API versions 9 and newer.
2042 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002043extern uchar2 __attribute__((const, overloadable))convert_uchar2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002044#endif
2045
2046#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2047/*
2048 * Component wise conversion from char3 to uchar3
2049 *
2050 * Supported by API versions 9 and newer.
2051 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002052extern uchar3 __attribute__((const, overloadable))convert_uchar3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002053#endif
2054
2055#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2056/*
2057 * Component wise conversion from char4 to uchar4
2058 *
2059 * Supported by API versions 9 and newer.
2060 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002061extern uchar4 __attribute__((const, overloadable))convert_uchar4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002062#endif
2063
2064#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2065/*
2066 * Component wise conversion from uchar2 to uchar2
2067 *
2068 * Supported by API versions 9 and newer.
2069 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002070extern uchar2 __attribute__((const, overloadable))convert_uchar2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002071#endif
2072
2073#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2074/*
2075 * Component wise conversion from uchar3 to uchar3
2076 *
2077 * Supported by API versions 9 and newer.
2078 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002079extern uchar3 __attribute__((const, overloadable))convert_uchar3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002080#endif
2081
2082#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2083/*
2084 * Component wise conversion from uchar4 to uchar4
2085 *
2086 * Supported by API versions 9 and newer.
2087 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002088extern uchar4 __attribute__((const, overloadable))convert_uchar4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002089#endif
2090
2091#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2092/*
2093 * Component wise conversion from short2 to uchar2
2094 *
2095 * Supported by API versions 9 and newer.
2096 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002097extern uchar2 __attribute__((const, overloadable))convert_uchar2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002098#endif
2099
2100#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2101/*
2102 * Component wise conversion from short3 to uchar3
2103 *
2104 * Supported by API versions 9 and newer.
2105 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002106extern uchar3 __attribute__((const, overloadable))convert_uchar3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002107#endif
2108
2109#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2110/*
2111 * Component wise conversion from short4 to uchar4
2112 *
2113 * Supported by API versions 9 and newer.
2114 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002115extern uchar4 __attribute__((const, overloadable))convert_uchar4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002116#endif
2117
2118#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2119/*
2120 * Component wise conversion from ushort2 to uchar2
2121 *
2122 * Supported by API versions 9 and newer.
2123 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002124extern uchar2 __attribute__((const, overloadable))convert_uchar2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002125#endif
2126
2127#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2128/*
2129 * Component wise conversion from ushort3 to uchar3
2130 *
2131 * Supported by API versions 9 and newer.
2132 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002133extern uchar3 __attribute__((const, overloadable))convert_uchar3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002134#endif
2135
2136#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2137/*
2138 * Component wise conversion from ushort4 to uchar4
2139 *
2140 * Supported by API versions 9 and newer.
2141 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002142extern uchar4 __attribute__((const, overloadable))convert_uchar4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002143#endif
2144
2145#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2146/*
2147 * Component wise conversion from int2 to uchar2
2148 *
2149 * Supported by API versions 9 and newer.
2150 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002151extern uchar2 __attribute__((const, overloadable))convert_uchar2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002152#endif
2153
2154#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2155/*
2156 * Component wise conversion from int3 to uchar3
2157 *
2158 * Supported by API versions 9 and newer.
2159 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002160extern uchar3 __attribute__((const, overloadable))convert_uchar3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002161#endif
2162
2163#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2164/*
2165 * Component wise conversion from int4 to uchar4
2166 *
2167 * Supported by API versions 9 and newer.
2168 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002169extern uchar4 __attribute__((const, overloadable))convert_uchar4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002170#endif
2171
2172#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2173/*
2174 * Component wise conversion from uint2 to uchar2
2175 *
2176 * Supported by API versions 9 and newer.
2177 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002178extern uchar2 __attribute__((const, overloadable))convert_uchar2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002179#endif
2180
2181#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2182/*
2183 * Component wise conversion from uint3 to uchar3
2184 *
2185 * Supported by API versions 9 and newer.
2186 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002187extern uchar3 __attribute__((const, overloadable))convert_uchar3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002188#endif
2189
2190#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2191/*
2192 * Component wise conversion from uint4 to uchar4
2193 *
2194 * Supported by API versions 9 and newer.
2195 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002196extern uchar4 __attribute__((const, overloadable))convert_uchar4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002197#endif
2198
2199#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2200/*
Jason Sams29087fa2014-01-09 17:06:17 -08002201 * Component wise conversion from float2 to short2
2202 *
2203 * Supported by API versions 9 and newer.
2204 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002205extern short2 __attribute__((const, overloadable))convert_short2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002206#endif
2207
2208#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2209/*
2210 * Component wise conversion from float3 to short3
2211 *
2212 * Supported by API versions 9 and newer.
2213 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002214extern short3 __attribute__((const, overloadable))convert_short3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002215#endif
2216
2217#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2218/*
2219 * Component wise conversion from float4 to short4
2220 *
2221 * Supported by API versions 9 and newer.
2222 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002223extern short4 __attribute__((const, overloadable))convert_short4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002224#endif
2225
2226#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2227/*
Jason Sams29087fa2014-01-09 17:06:17 -08002228 * Component wise conversion from char2 to short2
2229 *
2230 * Supported by API versions 9 and newer.
2231 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002232extern short2 __attribute__((const, overloadable))convert_short2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002233#endif
2234
2235#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2236/*
2237 * Component wise conversion from char3 to short3
2238 *
2239 * Supported by API versions 9 and newer.
2240 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002241extern short3 __attribute__((const, overloadable))convert_short3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002242#endif
2243
2244#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2245/*
2246 * Component wise conversion from char4 to short4
2247 *
2248 * Supported by API versions 9 and newer.
2249 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002250extern short4 __attribute__((const, overloadable))convert_short4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002251#endif
2252
2253#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2254/*
2255 * Component wise conversion from uchar2 to short2
2256 *
2257 * Supported by API versions 9 and newer.
2258 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002259extern short2 __attribute__((const, overloadable))convert_short2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002260#endif
2261
2262#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2263/*
2264 * Component wise conversion from uchar3 to short3
2265 *
2266 * Supported by API versions 9 and newer.
2267 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002268extern short3 __attribute__((const, overloadable))convert_short3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002269#endif
2270
2271#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2272/*
2273 * Component wise conversion from uchar4 to short4
2274 *
2275 * Supported by API versions 9 and newer.
2276 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002277extern short4 __attribute__((const, overloadable))convert_short4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002278#endif
2279
2280#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2281/*
2282 * Component wise conversion from short2 to short2
2283 *
2284 * Supported by API versions 9 and newer.
2285 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002286extern short2 __attribute__((const, overloadable))convert_short2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002287#endif
2288
2289#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2290/*
2291 * Component wise conversion from short3 to short3
2292 *
2293 * Supported by API versions 9 and newer.
2294 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002295extern short3 __attribute__((const, overloadable))convert_short3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002296#endif
2297
2298#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2299/*
2300 * Component wise conversion from short4 to short4
2301 *
2302 * Supported by API versions 9 and newer.
2303 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002304extern short4 __attribute__((const, overloadable))convert_short4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002305#endif
2306
2307#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2308/*
2309 * Component wise conversion from ushort2 to short2
2310 *
2311 * Supported by API versions 9 and newer.
2312 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002313extern short2 __attribute__((const, overloadable))convert_short2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002314#endif
2315
2316#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2317/*
2318 * Component wise conversion from ushort3 to short3
2319 *
2320 * Supported by API versions 9 and newer.
2321 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002322extern short3 __attribute__((const, overloadable))convert_short3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002323#endif
2324
2325#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2326/*
2327 * Component wise conversion from ushort4 to short4
2328 *
2329 * Supported by API versions 9 and newer.
2330 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002331extern short4 __attribute__((const, overloadable))convert_short4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002332#endif
2333
2334#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2335/*
2336 * Component wise conversion from int2 to short2
2337 *
2338 * Supported by API versions 9 and newer.
2339 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002340extern short2 __attribute__((const, overloadable))convert_short2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002341#endif
2342
2343#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2344/*
2345 * Component wise conversion from int3 to short3
2346 *
2347 * Supported by API versions 9 and newer.
2348 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002349extern short3 __attribute__((const, overloadable))convert_short3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002350#endif
2351
2352#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2353/*
2354 * Component wise conversion from int4 to short4
2355 *
2356 * Supported by API versions 9 and newer.
2357 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002358extern short4 __attribute__((const, overloadable))convert_short4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002359#endif
2360
2361#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2362/*
2363 * Component wise conversion from uint2 to short2
2364 *
2365 * Supported by API versions 9 and newer.
2366 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002367extern short2 __attribute__((const, overloadable))convert_short2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002368#endif
2369
2370#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2371/*
2372 * Component wise conversion from uint3 to short3
2373 *
2374 * Supported by API versions 9 and newer.
2375 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002376extern short3 __attribute__((const, overloadable))convert_short3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002377#endif
2378
2379#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2380/*
2381 * Component wise conversion from uint4 to short4
2382 *
2383 * Supported by API versions 9 and newer.
2384 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002385extern short4 __attribute__((const, overloadable))convert_short4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002386#endif
2387
2388#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2389/*
Jason Sams29087fa2014-01-09 17:06:17 -08002390 * Component wise conversion from float2 to ushort2
2391 *
2392 * Supported by API versions 9 and newer.
2393 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002394extern ushort2 __attribute__((const, overloadable))convert_ushort2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002395#endif
2396
2397#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2398/*
2399 * Component wise conversion from float3 to ushort3
2400 *
2401 * Supported by API versions 9 and newer.
2402 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002403extern ushort3 __attribute__((const, overloadable))convert_ushort3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002404#endif
2405
2406#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2407/*
2408 * Component wise conversion from float4 to ushort4
2409 *
2410 * Supported by API versions 9 and newer.
2411 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002412extern ushort4 __attribute__((const, overloadable))convert_ushort4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002413#endif
2414
2415#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2416/*
Jason Sams29087fa2014-01-09 17:06:17 -08002417 * Component wise conversion from char2 to ushort2
2418 *
2419 * Supported by API versions 9 and newer.
2420 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002421extern ushort2 __attribute__((const, overloadable))convert_ushort2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002422#endif
2423
2424#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2425/*
2426 * Component wise conversion from char3 to ushort3
2427 *
2428 * Supported by API versions 9 and newer.
2429 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002430extern ushort3 __attribute__((const, overloadable))convert_ushort3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002431#endif
2432
2433#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2434/*
2435 * Component wise conversion from char4 to ushort4
2436 *
2437 * Supported by API versions 9 and newer.
2438 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002439extern ushort4 __attribute__((const, overloadable))convert_ushort4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002440#endif
2441
2442#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2443/*
2444 * Component wise conversion from uchar2 to ushort2
2445 *
2446 * Supported by API versions 9 and newer.
2447 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002448extern ushort2 __attribute__((const, overloadable))convert_ushort2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002449#endif
2450
2451#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2452/*
2453 * Component wise conversion from uchar3 to ushort3
2454 *
2455 * Supported by API versions 9 and newer.
2456 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002457extern ushort3 __attribute__((const, overloadable))convert_ushort3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002458#endif
2459
2460#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2461/*
2462 * Component wise conversion from uchar4 to ushort4
2463 *
2464 * Supported by API versions 9 and newer.
2465 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002466extern ushort4 __attribute__((const, overloadable))convert_ushort4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002467#endif
2468
2469#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2470/*
2471 * Component wise conversion from short2 to ushort2
2472 *
2473 * Supported by API versions 9 and newer.
2474 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002475extern ushort2 __attribute__((const, overloadable))convert_ushort2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002476#endif
2477
2478#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2479/*
2480 * Component wise conversion from short3 to ushort3
2481 *
2482 * Supported by API versions 9 and newer.
2483 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002484extern ushort3 __attribute__((const, overloadable))convert_ushort3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002485#endif
2486
2487#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2488/*
2489 * Component wise conversion from short4 to ushort4
2490 *
2491 * Supported by API versions 9 and newer.
2492 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002493extern ushort4 __attribute__((const, overloadable))convert_ushort4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002494#endif
2495
2496#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2497/*
2498 * Component wise conversion from ushort2 to ushort2
2499 *
2500 * Supported by API versions 9 and newer.
2501 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002502extern ushort2 __attribute__((const, overloadable))convert_ushort2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002503#endif
2504
2505#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2506/*
2507 * Component wise conversion from ushort3 to ushort3
2508 *
2509 * Supported by API versions 9 and newer.
2510 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002511extern ushort3 __attribute__((const, overloadable))convert_ushort3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002512#endif
2513
2514#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2515/*
2516 * Component wise conversion from ushort4 to ushort4
2517 *
2518 * Supported by API versions 9 and newer.
2519 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002520extern ushort4 __attribute__((const, overloadable))convert_ushort4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002521#endif
2522
2523#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2524/*
2525 * Component wise conversion from int2 to ushort2
2526 *
2527 * Supported by API versions 9 and newer.
2528 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002529extern ushort2 __attribute__((const, overloadable))convert_ushort2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002530#endif
2531
2532#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2533/*
2534 * Component wise conversion from int3 to ushort3
2535 *
2536 * Supported by API versions 9 and newer.
2537 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002538extern ushort3 __attribute__((const, overloadable))convert_ushort3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002539#endif
2540
2541#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2542/*
2543 * Component wise conversion from int4 to ushort4
2544 *
2545 * Supported by API versions 9 and newer.
2546 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002547extern ushort4 __attribute__((const, overloadable))convert_ushort4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002548#endif
2549
2550#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2551/*
2552 * Component wise conversion from uint2 to ushort2
2553 *
2554 * Supported by API versions 9 and newer.
2555 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002556extern ushort2 __attribute__((const, overloadable))convert_ushort2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002557#endif
2558
2559#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2560/*
2561 * Component wise conversion from uint3 to ushort3
2562 *
2563 * Supported by API versions 9 and newer.
2564 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002565extern ushort3 __attribute__((const, overloadable))convert_ushort3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002566#endif
2567
2568#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2569/*
2570 * Component wise conversion from uint4 to ushort4
2571 *
2572 * Supported by API versions 9 and newer.
2573 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002574extern ushort4 __attribute__((const, overloadable))convert_ushort4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002575#endif
2576
2577#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2578/*
Jason Sams29087fa2014-01-09 17:06:17 -08002579 * Component wise conversion from float2 to int2
2580 *
2581 * Supported by API versions 9 and newer.
2582 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002583extern int2 __attribute__((const, overloadable))convert_int2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002584#endif
2585
2586#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2587/*
2588 * Component wise conversion from float3 to int3
2589 *
2590 * Supported by API versions 9 and newer.
2591 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002592extern int3 __attribute__((const, overloadable))convert_int3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002593#endif
2594
2595#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2596/*
2597 * Component wise conversion from float4 to int4
2598 *
2599 * Supported by API versions 9 and newer.
2600 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002601extern int4 __attribute__((const, overloadable))convert_int4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002602#endif
2603
2604#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2605/*
Jason Sams29087fa2014-01-09 17:06:17 -08002606 * Component wise conversion from char2 to int2
2607 *
2608 * Supported by API versions 9 and newer.
2609 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002610extern int2 __attribute__((const, overloadable))convert_int2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002611#endif
2612
2613#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2614/*
2615 * Component wise conversion from char3 to int3
2616 *
2617 * Supported by API versions 9 and newer.
2618 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002619extern int3 __attribute__((const, overloadable))convert_int3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002620#endif
2621
2622#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2623/*
2624 * Component wise conversion from char4 to int4
2625 *
2626 * Supported by API versions 9 and newer.
2627 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002628extern int4 __attribute__((const, overloadable))convert_int4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002629#endif
2630
2631#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2632/*
2633 * Component wise conversion from uchar2 to int2
2634 *
2635 * Supported by API versions 9 and newer.
2636 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002637extern int2 __attribute__((const, overloadable))convert_int2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002638#endif
2639
2640#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2641/*
2642 * Component wise conversion from uchar3 to int3
2643 *
2644 * Supported by API versions 9 and newer.
2645 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002646extern int3 __attribute__((const, overloadable))convert_int3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002647#endif
2648
2649#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2650/*
2651 * Component wise conversion from uchar4 to int4
2652 *
2653 * Supported by API versions 9 and newer.
2654 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002655extern int4 __attribute__((const, overloadable))convert_int4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002656#endif
2657
2658#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2659/*
2660 * Component wise conversion from short2 to int2
2661 *
2662 * Supported by API versions 9 and newer.
2663 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002664extern int2 __attribute__((const, overloadable))convert_int2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002665#endif
2666
2667#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2668/*
2669 * Component wise conversion from short3 to int3
2670 *
2671 * Supported by API versions 9 and newer.
2672 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002673extern int3 __attribute__((const, overloadable))convert_int3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002674#endif
2675
2676#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2677/*
2678 * Component wise conversion from short4 to int4
2679 *
2680 * Supported by API versions 9 and newer.
2681 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002682extern int4 __attribute__((const, overloadable))convert_int4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002683#endif
2684
2685#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2686/*
2687 * Component wise conversion from ushort2 to int2
2688 *
2689 * Supported by API versions 9 and newer.
2690 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002691extern int2 __attribute__((const, overloadable))convert_int2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002692#endif
2693
2694#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2695/*
2696 * Component wise conversion from ushort3 to int3
2697 *
2698 * Supported by API versions 9 and newer.
2699 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002700extern int3 __attribute__((const, overloadable))convert_int3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002701#endif
2702
2703#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2704/*
2705 * Component wise conversion from ushort4 to int4
2706 *
2707 * Supported by API versions 9 and newer.
2708 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002709extern int4 __attribute__((const, overloadable))convert_int4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002710#endif
2711
2712#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2713/*
2714 * Component wise conversion from int2 to int2
2715 *
2716 * Supported by API versions 9 and newer.
2717 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002718extern int2 __attribute__((const, overloadable))convert_int2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002719#endif
2720
2721#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2722/*
2723 * Component wise conversion from int3 to int3
2724 *
2725 * Supported by API versions 9 and newer.
2726 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002727extern int3 __attribute__((const, overloadable))convert_int3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002728#endif
2729
2730#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2731/*
2732 * Component wise conversion from int4 to int4
2733 *
2734 * Supported by API versions 9 and newer.
2735 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002736extern int4 __attribute__((const, overloadable))convert_int4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002737#endif
2738
2739#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2740/*
2741 * Component wise conversion from uint2 to int2
2742 *
2743 * Supported by API versions 9 and newer.
2744 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002745extern int2 __attribute__((const, overloadable))convert_int2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002746#endif
2747
2748#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2749/*
2750 * Component wise conversion from uint3 to int3
2751 *
2752 * Supported by API versions 9 and newer.
2753 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002754extern int3 __attribute__((const, overloadable))convert_int3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002755#endif
2756
2757#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2758/*
2759 * Component wise conversion from uint4 to int4
2760 *
2761 * Supported by API versions 9 and newer.
2762 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002763extern int4 __attribute__((const, overloadable))convert_int4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002764#endif
2765
2766#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2767/*
Jason Sams29087fa2014-01-09 17:06:17 -08002768 * Component wise conversion from float2 to uint2
2769 *
2770 * Supported by API versions 9 and newer.
2771 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002772extern uint2 __attribute__((const, overloadable))convert_uint2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002773#endif
2774
2775#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2776/*
2777 * Component wise conversion from float3 to uint3
2778 *
2779 * Supported by API versions 9 and newer.
2780 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002781extern uint3 __attribute__((const, overloadable))convert_uint3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002782#endif
2783
2784#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2785/*
2786 * Component wise conversion from float4 to uint4
2787 *
2788 * Supported by API versions 9 and newer.
2789 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002790extern uint4 __attribute__((const, overloadable))convert_uint4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002791#endif
2792
2793#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2794/*
Jason Sams29087fa2014-01-09 17:06:17 -08002795 * Component wise conversion from char2 to uint2
2796 *
2797 * Supported by API versions 9 and newer.
2798 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002799extern uint2 __attribute__((const, overloadable))convert_uint2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002800#endif
2801
2802#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2803/*
2804 * Component wise conversion from char3 to uint3
2805 *
2806 * Supported by API versions 9 and newer.
2807 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002808extern uint3 __attribute__((const, overloadable))convert_uint3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002809#endif
2810
2811#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2812/*
2813 * Component wise conversion from char4 to uint4
2814 *
2815 * Supported by API versions 9 and newer.
2816 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002817extern uint4 __attribute__((const, overloadable))convert_uint4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002818#endif
2819
2820#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2821/*
2822 * Component wise conversion from uchar2 to uint2
2823 *
2824 * Supported by API versions 9 and newer.
2825 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002826extern uint2 __attribute__((const, overloadable))convert_uint2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002827#endif
2828
2829#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2830/*
2831 * Component wise conversion from uchar3 to uint3
2832 *
2833 * Supported by API versions 9 and newer.
2834 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002835extern uint3 __attribute__((const, overloadable))convert_uint3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002836#endif
2837
2838#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2839/*
2840 * Component wise conversion from uchar4 to uint4
2841 *
2842 * Supported by API versions 9 and newer.
2843 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002844extern uint4 __attribute__((const, overloadable))convert_uint4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002845#endif
2846
2847#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2848/*
2849 * Component wise conversion from short2 to uint2
2850 *
2851 * Supported by API versions 9 and newer.
2852 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002853extern uint2 __attribute__((const, overloadable))convert_uint2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002854#endif
2855
2856#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2857/*
2858 * Component wise conversion from short3 to uint3
2859 *
2860 * Supported by API versions 9 and newer.
2861 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002862extern uint3 __attribute__((const, overloadable))convert_uint3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002863#endif
2864
2865#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2866/*
2867 * Component wise conversion from short4 to uint4
2868 *
2869 * Supported by API versions 9 and newer.
2870 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002871extern uint4 __attribute__((const, overloadable))convert_uint4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002872#endif
2873
2874#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2875/*
2876 * Component wise conversion from ushort2 to uint2
2877 *
2878 * Supported by API versions 9 and newer.
2879 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002880extern uint2 __attribute__((const, overloadable))convert_uint2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002881#endif
2882
2883#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2884/*
2885 * Component wise conversion from ushort3 to uint3
2886 *
2887 * Supported by API versions 9 and newer.
2888 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002889extern uint3 __attribute__((const, overloadable))convert_uint3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002890#endif
2891
2892#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2893/*
2894 * Component wise conversion from ushort4 to uint4
2895 *
2896 * Supported by API versions 9 and newer.
2897 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002898extern uint4 __attribute__((const, overloadable))convert_uint4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002899#endif
2900
2901#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2902/*
2903 * Component wise conversion from int2 to uint2
2904 *
2905 * Supported by API versions 9 and newer.
2906 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002907extern uint2 __attribute__((const, overloadable))convert_uint2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002908#endif
2909
2910#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2911/*
2912 * Component wise conversion from int3 to uint3
2913 *
2914 * Supported by API versions 9 and newer.
2915 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002916extern uint3 __attribute__((const, overloadable))convert_uint3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002917#endif
2918
2919#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2920/*
2921 * Component wise conversion from int4 to uint4
2922 *
2923 * Supported by API versions 9 and newer.
2924 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002925extern uint4 __attribute__((const, overloadable))convert_uint4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002926#endif
2927
2928#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2929/*
2930 * Component wise conversion from uint2 to uint2
2931 *
2932 * Supported by API versions 9 and newer.
2933 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002934extern uint2 __attribute__((const, overloadable))convert_uint2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002935#endif
2936
2937#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2938/*
2939 * Component wise conversion from uint3 to uint3
2940 *
2941 * Supported by API versions 9 and newer.
2942 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002943extern uint3 __attribute__((const, overloadable))convert_uint3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002944#endif
2945
2946#if (defined(RS_VERSION) && (RS_VERSION >= 9))
2947/*
2948 * Component wise conversion from uint4 to uint4
2949 *
2950 * Supported by API versions 9 and newer.
2951 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002952extern uint4 __attribute__((const, overloadable))convert_uint4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002953#endif
2954
Jason Sams564a4002014-04-29 16:30:41 -07002955#if (defined(RS_VERSION) && (RS_VERSION >= 21))
2956/*
Jason Sams564a4002014-04-29 16:30:41 -07002957 * Component wise conversion from double2 to double2
2958 *
2959 * Supported by API versions 21 and newer.
2960 */
2961extern double2 __attribute__((const, overloadable))convert_double2(double2 v);
2962#endif
2963
2964#if (defined(RS_VERSION) && (RS_VERSION >= 21))
2965/*
2966 * Component wise conversion from double3 to double3
2967 *
2968 * Supported by API versions 21 and newer.
2969 */
2970extern double3 __attribute__((const, overloadable))convert_double3(double3 v);
2971#endif
2972
2973#if (defined(RS_VERSION) && (RS_VERSION >= 21))
2974/*
2975 * Component wise conversion from double4 to double4
2976 *
2977 * Supported by API versions 21 and newer.
2978 */
2979extern double4 __attribute__((const, overloadable))convert_double4(double4 v);
2980#endif
2981
2982#if (defined(RS_VERSION) && (RS_VERSION >= 21))
2983/*
2984 * Component wise conversion from long2 to double2
2985 *
2986 * Supported by API versions 21 and newer.
2987 */
2988extern double2 __attribute__((const, overloadable))convert_double2(long2 v);
2989#endif
2990
2991#if (defined(RS_VERSION) && (RS_VERSION >= 21))
2992/*
2993 * Component wise conversion from long3 to double3
2994 *
2995 * Supported by API versions 21 and newer.
2996 */
2997extern double3 __attribute__((const, overloadable))convert_double3(long3 v);
2998#endif
2999
3000#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3001/*
3002 * Component wise conversion from long4 to double4
3003 *
3004 * Supported by API versions 21 and newer.
3005 */
3006extern double4 __attribute__((const, overloadable))convert_double4(long4 v);
3007#endif
3008
3009#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3010/*
3011 * Component wise conversion from ulong2 to double2
3012 *
3013 * Supported by API versions 21 and newer.
3014 */
3015extern double2 __attribute__((const, overloadable))convert_double2(ulong2 v);
3016#endif
3017
3018#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3019/*
3020 * Component wise conversion from ulong3 to double3
3021 *
3022 * Supported by API versions 21 and newer.
3023 */
3024extern double3 __attribute__((const, overloadable))convert_double3(ulong3 v);
3025#endif
3026
3027#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3028/*
3029 * Component wise conversion from ulong4 to double4
3030 *
3031 * Supported by API versions 21 and newer.
3032 */
3033extern double4 __attribute__((const, overloadable))convert_double4(ulong4 v);
3034#endif
3035
3036#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3037/*
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07003038 * Component wise conversion from double2 to long2
3039 *
3040 * Supported by API versions 21 and newer.
3041 */
3042extern long2 __attribute__((const, overloadable))convert_long2(double2 v);
3043#endif
3044
3045#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3046/*
3047 * Component wise conversion from double3 to long3
3048 *
3049 * Supported by API versions 21 and newer.
3050 */
3051extern long3 __attribute__((const, overloadable))convert_long3(double3 v);
3052#endif
3053
3054#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3055/*
3056 * Component wise conversion from double4 to long4
3057 *
3058 * Supported by API versions 21 and newer.
3059 */
3060extern long4 __attribute__((const, overloadable))convert_long4(double4 v);
3061#endif
3062
3063#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3064/*
3065 * Component wise conversion from long2 to long2
3066 *
3067 * Supported by API versions 21 and newer.
3068 */
3069extern long2 __attribute__((const, overloadable))convert_long2(long2 v);
3070#endif
3071
3072#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3073/*
3074 * Component wise conversion from long3 to long3
3075 *
3076 * Supported by API versions 21 and newer.
3077 */
3078extern long3 __attribute__((const, overloadable))convert_long3(long3 v);
3079#endif
3080
3081#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3082/*
3083 * Component wise conversion from long4 to long4
3084 *
3085 * Supported by API versions 21 and newer.
3086 */
3087extern long4 __attribute__((const, overloadable))convert_long4(long4 v);
3088#endif
3089
3090#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3091/*
3092 * Component wise conversion from ulong2 to long2
3093 *
3094 * Supported by API versions 21 and newer.
3095 */
3096extern long2 __attribute__((const, overloadable))convert_long2(ulong2 v);
3097#endif
3098
3099#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3100/*
3101 * Component wise conversion from ulong3 to long3
3102 *
3103 * Supported by API versions 21 and newer.
3104 */
3105extern long3 __attribute__((const, overloadable))convert_long3(ulong3 v);
3106#endif
3107
3108#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3109/*
3110 * Component wise conversion from ulong4 to long4
3111 *
3112 * Supported by API versions 21 and newer.
3113 */
3114extern long4 __attribute__((const, overloadable))convert_long4(ulong4 v);
3115#endif
3116
3117#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3118/*
3119 * Component wise conversion from double2 to ulong2
3120 *
3121 * Supported by API versions 21 and newer.
3122 */
3123extern ulong2 __attribute__((const, overloadable))convert_ulong2(double2 v);
3124#endif
3125
3126#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3127/*
3128 * Component wise conversion from double3 to ulong3
3129 *
3130 * Supported by API versions 21 and newer.
3131 */
3132extern ulong3 __attribute__((const, overloadable))convert_ulong3(double3 v);
3133#endif
3134
3135#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3136/*
3137 * Component wise conversion from double4 to ulong4
3138 *
3139 * Supported by API versions 21 and newer.
3140 */
3141extern ulong4 __attribute__((const, overloadable))convert_ulong4(double4 v);
3142#endif
3143
3144#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3145/*
3146 * Component wise conversion from long2 to ulong2
3147 *
3148 * Supported by API versions 21 and newer.
3149 */
3150extern ulong2 __attribute__((const, overloadable))convert_ulong2(long2 v);
3151#endif
3152
3153#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3154/*
3155 * Component wise conversion from long3 to ulong3
3156 *
3157 * Supported by API versions 21 and newer.
3158 */
3159extern ulong3 __attribute__((const, overloadable))convert_ulong3(long3 v);
3160#endif
3161
3162#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3163/*
3164 * Component wise conversion from long4 to ulong4
3165 *
3166 * Supported by API versions 21 and newer.
3167 */
3168extern ulong4 __attribute__((const, overloadable))convert_ulong4(long4 v);
3169#endif
3170
3171#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3172/*
3173 * Component wise conversion from ulong2 to ulong2
3174 *
3175 * Supported by API versions 21 and newer.
3176 */
3177extern ulong2 __attribute__((const, overloadable))convert_ulong2(ulong2 v);
3178#endif
3179
3180#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3181/*
3182 * Component wise conversion from ulong3 to ulong3
3183 *
3184 * Supported by API versions 21 and newer.
3185 */
3186extern ulong3 __attribute__((const, overloadable))convert_ulong3(ulong3 v);
3187#endif
3188
3189#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3190/*
3191 * Component wise conversion from ulong4 to ulong4
3192 *
3193 * Supported by API versions 21 and newer.
3194 */
3195extern ulong4 __attribute__((const, overloadable))convert_ulong4(ulong4 v);
3196#endif
3197
3198#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3199/*
3200 * Component wise conversion from double2 to float2
3201 *
3202 * Supported by API versions 21 and newer.
3203 */
3204extern float2 __attribute__((const, overloadable))convert_float2(double2 v);
3205#endif
3206
3207#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3208/*
3209 * Component wise conversion from double3 to float3
3210 *
3211 * Supported by API versions 21 and newer.
3212 */
3213extern float3 __attribute__((const, overloadable))convert_float3(double3 v);
3214#endif
3215
3216#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3217/*
3218 * Component wise conversion from double4 to float4
3219 *
3220 * Supported by API versions 21 and newer.
3221 */
3222extern float4 __attribute__((const, overloadable))convert_float4(double4 v);
3223#endif
3224
3225#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3226/*
3227 * Component wise conversion from long2 to float2
3228 *
3229 * Supported by API versions 21 and newer.
3230 */
3231extern float2 __attribute__((const, overloadable))convert_float2(long2 v);
3232#endif
3233
3234#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3235/*
3236 * Component wise conversion from long3 to float3
3237 *
3238 * Supported by API versions 21 and newer.
3239 */
3240extern float3 __attribute__((const, overloadable))convert_float3(long3 v);
3241#endif
3242
3243#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3244/*
3245 * Component wise conversion from long4 to float4
3246 *
3247 * Supported by API versions 21 and newer.
3248 */
3249extern float4 __attribute__((const, overloadable))convert_float4(long4 v);
3250#endif
3251
3252#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3253/*
3254 * Component wise conversion from ulong2 to float2
3255 *
3256 * Supported by API versions 21 and newer.
3257 */
3258extern float2 __attribute__((const, overloadable))convert_float2(ulong2 v);
3259#endif
3260
3261#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3262/*
3263 * Component wise conversion from ulong3 to float3
3264 *
3265 * Supported by API versions 21 and newer.
3266 */
3267extern float3 __attribute__((const, overloadable))convert_float3(ulong3 v);
3268#endif
3269
3270#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3271/*
3272 * Component wise conversion from ulong4 to float4
3273 *
3274 * Supported by API versions 21 and newer.
3275 */
3276extern float4 __attribute__((const, overloadable))convert_float4(ulong4 v);
3277#endif
3278
3279#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3280/*
Jason Sams564a4002014-04-29 16:30:41 -07003281 * Component wise conversion from double2 to char2
3282 *
3283 * Supported by API versions 21 and newer.
3284 */
3285extern char2 __attribute__((const, overloadable))convert_char2(double2 v);
3286#endif
3287
3288#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3289/*
3290 * Component wise conversion from double3 to char3
3291 *
3292 * Supported by API versions 21 and newer.
3293 */
3294extern char3 __attribute__((const, overloadable))convert_char3(double3 v);
3295#endif
3296
3297#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3298/*
3299 * Component wise conversion from double4 to char4
3300 *
3301 * Supported by API versions 21 and newer.
3302 */
3303extern char4 __attribute__((const, overloadable))convert_char4(double4 v);
3304#endif
3305
3306#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3307/*
3308 * Component wise conversion from long2 to char2
3309 *
3310 * Supported by API versions 21 and newer.
3311 */
3312extern char2 __attribute__((const, overloadable))convert_char2(long2 v);
3313#endif
3314
3315#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3316/*
3317 * Component wise conversion from long3 to char3
3318 *
3319 * Supported by API versions 21 and newer.
3320 */
3321extern char3 __attribute__((const, overloadable))convert_char3(long3 v);
3322#endif
3323
3324#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3325/*
3326 * Component wise conversion from long4 to char4
3327 *
3328 * Supported by API versions 21 and newer.
3329 */
3330extern char4 __attribute__((const, overloadable))convert_char4(long4 v);
3331#endif
3332
3333#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3334/*
3335 * Component wise conversion from ulong2 to char2
3336 *
3337 * Supported by API versions 21 and newer.
3338 */
3339extern char2 __attribute__((const, overloadable))convert_char2(ulong2 v);
3340#endif
3341
3342#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3343/*
3344 * Component wise conversion from ulong3 to char3
3345 *
3346 * Supported by API versions 21 and newer.
3347 */
3348extern char3 __attribute__((const, overloadable))convert_char3(ulong3 v);
3349#endif
3350
3351#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3352/*
3353 * Component wise conversion from ulong4 to char4
3354 *
3355 * Supported by API versions 21 and newer.
3356 */
3357extern char4 __attribute__((const, overloadable))convert_char4(ulong4 v);
3358#endif
3359
3360#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3361/*
3362 * Component wise conversion from double2 to uchar2
3363 *
3364 * Supported by API versions 21 and newer.
3365 */
3366extern uchar2 __attribute__((const, overloadable))convert_uchar2(double2 v);
3367#endif
3368
3369#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3370/*
3371 * Component wise conversion from double3 to uchar3
3372 *
3373 * Supported by API versions 21 and newer.
3374 */
3375extern uchar3 __attribute__((const, overloadable))convert_uchar3(double3 v);
3376#endif
3377
3378#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3379/*
3380 * Component wise conversion from double4 to uchar4
3381 *
3382 * Supported by API versions 21 and newer.
3383 */
3384extern uchar4 __attribute__((const, overloadable))convert_uchar4(double4 v);
3385#endif
3386
3387#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3388/*
3389 * Component wise conversion from long2 to uchar2
3390 *
3391 * Supported by API versions 21 and newer.
3392 */
3393extern uchar2 __attribute__((const, overloadable))convert_uchar2(long2 v);
3394#endif
3395
3396#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3397/*
3398 * Component wise conversion from long3 to uchar3
3399 *
3400 * Supported by API versions 21 and newer.
3401 */
3402extern uchar3 __attribute__((const, overloadable))convert_uchar3(long3 v);
3403#endif
3404
3405#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3406/*
3407 * Component wise conversion from long4 to uchar4
3408 *
3409 * Supported by API versions 21 and newer.
3410 */
3411extern uchar4 __attribute__((const, overloadable))convert_uchar4(long4 v);
3412#endif
3413
3414#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3415/*
3416 * Component wise conversion from ulong2 to uchar2
3417 *
3418 * Supported by API versions 21 and newer.
3419 */
3420extern uchar2 __attribute__((const, overloadable))convert_uchar2(ulong2 v);
3421#endif
3422
3423#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3424/*
3425 * Component wise conversion from ulong3 to uchar3
3426 *
3427 * Supported by API versions 21 and newer.
3428 */
3429extern uchar3 __attribute__((const, overloadable))convert_uchar3(ulong3 v);
3430#endif
3431
3432#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3433/*
3434 * Component wise conversion from ulong4 to uchar4
3435 *
3436 * Supported by API versions 21 and newer.
3437 */
3438extern uchar4 __attribute__((const, overloadable))convert_uchar4(ulong4 v);
3439#endif
3440
3441#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3442/*
3443 * Component wise conversion from double2 to short2
3444 *
3445 * Supported by API versions 21 and newer.
3446 */
3447extern short2 __attribute__((const, overloadable))convert_short2(double2 v);
3448#endif
3449
3450#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3451/*
3452 * Component wise conversion from double3 to short3
3453 *
3454 * Supported by API versions 21 and newer.
3455 */
3456extern short3 __attribute__((const, overloadable))convert_short3(double3 v);
3457#endif
3458
3459#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3460/*
3461 * Component wise conversion from double4 to short4
3462 *
3463 * Supported by API versions 21 and newer.
3464 */
3465extern short4 __attribute__((const, overloadable))convert_short4(double4 v);
3466#endif
3467
3468#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3469/*
3470 * Component wise conversion from long2 to short2
3471 *
3472 * Supported by API versions 21 and newer.
3473 */
3474extern short2 __attribute__((const, overloadable))convert_short2(long2 v);
3475#endif
3476
3477#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3478/*
3479 * Component wise conversion from long3 to short3
3480 *
3481 * Supported by API versions 21 and newer.
3482 */
3483extern short3 __attribute__((const, overloadable))convert_short3(long3 v);
3484#endif
3485
3486#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3487/*
3488 * Component wise conversion from long4 to short4
3489 *
3490 * Supported by API versions 21 and newer.
3491 */
3492extern short4 __attribute__((const, overloadable))convert_short4(long4 v);
3493#endif
3494
3495#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3496/*
3497 * Component wise conversion from ulong2 to short2
3498 *
3499 * Supported by API versions 21 and newer.
3500 */
3501extern short2 __attribute__((const, overloadable))convert_short2(ulong2 v);
3502#endif
3503
3504#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3505/*
3506 * Component wise conversion from ulong3 to short3
3507 *
3508 * Supported by API versions 21 and newer.
3509 */
3510extern short3 __attribute__((const, overloadable))convert_short3(ulong3 v);
3511#endif
3512
3513#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3514/*
3515 * Component wise conversion from ulong4 to short4
3516 *
3517 * Supported by API versions 21 and newer.
3518 */
3519extern short4 __attribute__((const, overloadable))convert_short4(ulong4 v);
3520#endif
3521
3522#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3523/*
3524 * Component wise conversion from double2 to ushort2
3525 *
3526 * Supported by API versions 21 and newer.
3527 */
3528extern ushort2 __attribute__((const, overloadable))convert_ushort2(double2 v);
3529#endif
3530
3531#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3532/*
3533 * Component wise conversion from double3 to ushort3
3534 *
3535 * Supported by API versions 21 and newer.
3536 */
3537extern ushort3 __attribute__((const, overloadable))convert_ushort3(double3 v);
3538#endif
3539
3540#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3541/*
3542 * Component wise conversion from double4 to ushort4
3543 *
3544 * Supported by API versions 21 and newer.
3545 */
3546extern ushort4 __attribute__((const, overloadable))convert_ushort4(double4 v);
3547#endif
3548
3549#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3550/*
3551 * Component wise conversion from long2 to ushort2
3552 *
3553 * Supported by API versions 21 and newer.
3554 */
3555extern ushort2 __attribute__((const, overloadable))convert_ushort2(long2 v);
3556#endif
3557
3558#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3559/*
3560 * Component wise conversion from long3 to ushort3
3561 *
3562 * Supported by API versions 21 and newer.
3563 */
3564extern ushort3 __attribute__((const, overloadable))convert_ushort3(long3 v);
3565#endif
3566
3567#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3568/*
3569 * Component wise conversion from long4 to ushort4
3570 *
3571 * Supported by API versions 21 and newer.
3572 */
3573extern ushort4 __attribute__((const, overloadable))convert_ushort4(long4 v);
3574#endif
3575
3576#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3577/*
3578 * Component wise conversion from ulong2 to ushort2
3579 *
3580 * Supported by API versions 21 and newer.
3581 */
3582extern ushort2 __attribute__((const, overloadable))convert_ushort2(ulong2 v);
3583#endif
3584
3585#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3586/*
3587 * Component wise conversion from ulong3 to ushort3
3588 *
3589 * Supported by API versions 21 and newer.
3590 */
3591extern ushort3 __attribute__((const, overloadable))convert_ushort3(ulong3 v);
3592#endif
3593
3594#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3595/*
3596 * Component wise conversion from ulong4 to ushort4
3597 *
3598 * Supported by API versions 21 and newer.
3599 */
3600extern ushort4 __attribute__((const, overloadable))convert_ushort4(ulong4 v);
3601#endif
3602
3603#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3604/*
3605 * Component wise conversion from double2 to int2
3606 *
3607 * Supported by API versions 21 and newer.
3608 */
3609extern int2 __attribute__((const, overloadable))convert_int2(double2 v);
3610#endif
3611
3612#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3613/*
3614 * Component wise conversion from double3 to int3
3615 *
3616 * Supported by API versions 21 and newer.
3617 */
3618extern int3 __attribute__((const, overloadable))convert_int3(double3 v);
3619#endif
3620
3621#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3622/*
3623 * Component wise conversion from double4 to int4
3624 *
3625 * Supported by API versions 21 and newer.
3626 */
3627extern int4 __attribute__((const, overloadable))convert_int4(double4 v);
3628#endif
3629
3630#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3631/*
3632 * Component wise conversion from long2 to int2
3633 *
3634 * Supported by API versions 21 and newer.
3635 */
3636extern int2 __attribute__((const, overloadable))convert_int2(long2 v);
3637#endif
3638
3639#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3640/*
3641 * Component wise conversion from long3 to int3
3642 *
3643 * Supported by API versions 21 and newer.
3644 */
3645extern int3 __attribute__((const, overloadable))convert_int3(long3 v);
3646#endif
3647
3648#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3649/*
3650 * Component wise conversion from long4 to int4
3651 *
3652 * Supported by API versions 21 and newer.
3653 */
3654extern int4 __attribute__((const, overloadable))convert_int4(long4 v);
3655#endif
3656
3657#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3658/*
3659 * Component wise conversion from ulong2 to int2
3660 *
3661 * Supported by API versions 21 and newer.
3662 */
3663extern int2 __attribute__((const, overloadable))convert_int2(ulong2 v);
3664#endif
3665
3666#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3667/*
3668 * Component wise conversion from ulong3 to int3
3669 *
3670 * Supported by API versions 21 and newer.
3671 */
3672extern int3 __attribute__((const, overloadable))convert_int3(ulong3 v);
3673#endif
3674
3675#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3676/*
3677 * Component wise conversion from ulong4 to int4
3678 *
3679 * Supported by API versions 21 and newer.
3680 */
3681extern int4 __attribute__((const, overloadable))convert_int4(ulong4 v);
3682#endif
3683
3684#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3685/*
3686 * Component wise conversion from double2 to uint2
3687 *
3688 * Supported by API versions 21 and newer.
3689 */
3690extern uint2 __attribute__((const, overloadable))convert_uint2(double2 v);
3691#endif
3692
3693#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3694/*
3695 * Component wise conversion from double3 to uint3
3696 *
3697 * Supported by API versions 21 and newer.
3698 */
3699extern uint3 __attribute__((const, overloadable))convert_uint3(double3 v);
3700#endif
3701
3702#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3703/*
3704 * Component wise conversion from double4 to uint4
3705 *
3706 * Supported by API versions 21 and newer.
3707 */
3708extern uint4 __attribute__((const, overloadable))convert_uint4(double4 v);
3709#endif
3710
3711#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003712/*
3713 * Component wise conversion from long2 to uint2
3714 *
Jason Sams564a4002014-04-29 16:30:41 -07003715 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08003716 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003717extern uint2 __attribute__((const, overloadable))convert_uint2(long2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003718#endif
3719
Jason Sams564a4002014-04-29 16:30:41 -07003720#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003721/*
3722 * Component wise conversion from long3 to uint3
3723 *
Jason Sams564a4002014-04-29 16:30:41 -07003724 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08003725 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003726extern uint3 __attribute__((const, overloadable))convert_uint3(long3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003727#endif
3728
Jason Sams564a4002014-04-29 16:30:41 -07003729#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003730/*
3731 * Component wise conversion from long4 to uint4
3732 *
Jason Sams564a4002014-04-29 16:30:41 -07003733 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08003734 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003735extern uint4 __attribute__((const, overloadable))convert_uint4(long4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003736#endif
3737
Jason Sams564a4002014-04-29 16:30:41 -07003738#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003739/*
3740 * Component wise conversion from ulong2 to uint2
3741 *
Jason Sams564a4002014-04-29 16:30:41 -07003742 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08003743 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003744extern uint2 __attribute__((const, overloadable))convert_uint2(ulong2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003745#endif
3746
Jason Sams564a4002014-04-29 16:30:41 -07003747#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003748/*
3749 * Component wise conversion from ulong3 to uint3
3750 *
Jason Sams564a4002014-04-29 16:30:41 -07003751 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08003752 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003753extern uint3 __attribute__((const, overloadable))convert_uint3(ulong3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003754#endif
3755
Jason Sams564a4002014-04-29 16:30:41 -07003756#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003757/*
3758 * Component wise conversion from ulong4 to uint4
3759 *
Jason Sams564a4002014-04-29 16:30:41 -07003760 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08003761 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003762extern uint4 __attribute__((const, overloadable))convert_uint4(ulong4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003763#endif
3764
Jason Sams564a4002014-04-29 16:30:41 -07003765#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jason Sams29087fa2014-01-09 17:06:17 -08003766/*
Jason Sams564a4002014-04-29 16:30:41 -07003767 * Component wise conversion from float2 to double2
3768 *
3769 * Supported by API versions 21 and newer.
3770 */
3771extern double2 __attribute__((const, overloadable))convert_double2(float2 v);
3772#endif
3773
3774#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3775/*
3776 * Component wise conversion from float3 to double3
3777 *
3778 * Supported by API versions 21 and newer.
3779 */
3780extern double3 __attribute__((const, overloadable))convert_double3(float3 v);
3781#endif
3782
3783#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3784/*
3785 * Component wise conversion from float4 to double4
3786 *
3787 * Supported by API versions 21 and newer.
3788 */
3789extern double4 __attribute__((const, overloadable))convert_double4(float4 v);
3790#endif
3791
3792#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3793/*
Jason Sams564a4002014-04-29 16:30:41 -07003794 * Component wise conversion from char2 to double2
3795 *
3796 * Supported by API versions 21 and newer.
3797 */
3798extern double2 __attribute__((const, overloadable))convert_double2(char2 v);
3799#endif
3800
3801#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3802/*
3803 * Component wise conversion from char3 to double3
3804 *
3805 * Supported by API versions 21 and newer.
3806 */
3807extern double3 __attribute__((const, overloadable))convert_double3(char3 v);
3808#endif
3809
3810#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3811/*
3812 * Component wise conversion from char4 to double4
3813 *
3814 * Supported by API versions 21 and newer.
3815 */
3816extern double4 __attribute__((const, overloadable))convert_double4(char4 v);
3817#endif
3818
3819#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3820/*
3821 * Component wise conversion from uchar2 to double2
3822 *
3823 * Supported by API versions 21 and newer.
3824 */
3825extern double2 __attribute__((const, overloadable))convert_double2(uchar2 v);
3826#endif
3827
3828#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3829/*
3830 * Component wise conversion from uchar3 to double3
3831 *
3832 * Supported by API versions 21 and newer.
3833 */
3834extern double3 __attribute__((const, overloadable))convert_double3(uchar3 v);
3835#endif
3836
3837#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3838/*
3839 * Component wise conversion from uchar4 to double4
3840 *
3841 * Supported by API versions 21 and newer.
3842 */
3843extern double4 __attribute__((const, overloadable))convert_double4(uchar4 v);
3844#endif
3845
3846#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3847/*
3848 * Component wise conversion from short2 to double2
3849 *
3850 * Supported by API versions 21 and newer.
3851 */
3852extern double2 __attribute__((const, overloadable))convert_double2(short2 v);
3853#endif
3854
3855#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3856/*
3857 * Component wise conversion from short3 to double3
3858 *
3859 * Supported by API versions 21 and newer.
3860 */
3861extern double3 __attribute__((const, overloadable))convert_double3(short3 v);
3862#endif
3863
3864#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3865/*
3866 * Component wise conversion from short4 to double4
3867 *
3868 * Supported by API versions 21 and newer.
3869 */
3870extern double4 __attribute__((const, overloadable))convert_double4(short4 v);
3871#endif
3872
3873#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3874/*
3875 * Component wise conversion from ushort2 to double2
3876 *
3877 * Supported by API versions 21 and newer.
3878 */
3879extern double2 __attribute__((const, overloadable))convert_double2(ushort2 v);
3880#endif
3881
3882#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3883/*
3884 * Component wise conversion from ushort3 to double3
3885 *
3886 * Supported by API versions 21 and newer.
3887 */
3888extern double3 __attribute__((const, overloadable))convert_double3(ushort3 v);
3889#endif
3890
3891#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3892/*
3893 * Component wise conversion from ushort4 to double4
3894 *
3895 * Supported by API versions 21 and newer.
3896 */
3897extern double4 __attribute__((const, overloadable))convert_double4(ushort4 v);
3898#endif
3899
3900#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3901/*
3902 * Component wise conversion from int2 to double2
3903 *
3904 * Supported by API versions 21 and newer.
3905 */
3906extern double2 __attribute__((const, overloadable))convert_double2(int2 v);
3907#endif
3908
3909#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3910/*
3911 * Component wise conversion from int3 to double3
3912 *
3913 * Supported by API versions 21 and newer.
3914 */
3915extern double3 __attribute__((const, overloadable))convert_double3(int3 v);
3916#endif
3917
3918#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3919/*
3920 * Component wise conversion from int4 to double4
3921 *
3922 * Supported by API versions 21 and newer.
3923 */
3924extern double4 __attribute__((const, overloadable))convert_double4(int4 v);
3925#endif
3926
3927#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3928/*
3929 * Component wise conversion from uint2 to double2
3930 *
3931 * Supported by API versions 21 and newer.
3932 */
3933extern double2 __attribute__((const, overloadable))convert_double2(uint2 v);
3934#endif
3935
3936#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3937/*
3938 * Component wise conversion from uint3 to double3
3939 *
3940 * Supported by API versions 21 and newer.
3941 */
3942extern double3 __attribute__((const, overloadable))convert_double3(uint3 v);
3943#endif
3944
3945#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3946/*
3947 * Component wise conversion from uint4 to double4
3948 *
3949 * Supported by API versions 21 and newer.
3950 */
3951extern double4 __attribute__((const, overloadable))convert_double4(uint4 v);
3952#endif
3953
3954#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3955/*
Jason Sams564a4002014-04-29 16:30:41 -07003956 * Component wise conversion from float2 to long2
3957 *
3958 * Supported by API versions 21 and newer.
3959 */
3960extern long2 __attribute__((const, overloadable))convert_long2(float2 v);
3961#endif
3962
3963#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3964/*
3965 * Component wise conversion from float3 to long3
3966 *
3967 * Supported by API versions 21 and newer.
3968 */
3969extern long3 __attribute__((const, overloadable))convert_long3(float3 v);
3970#endif
3971
3972#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3973/*
3974 * Component wise conversion from float4 to long4
3975 *
3976 * Supported by API versions 21 and newer.
3977 */
3978extern long4 __attribute__((const, overloadable))convert_long4(float4 v);
3979#endif
3980
3981#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3982/*
Jason Sams564a4002014-04-29 16:30:41 -07003983 * Component wise conversion from char2 to long2
3984 *
3985 * Supported by API versions 21 and newer.
3986 */
3987extern long2 __attribute__((const, overloadable))convert_long2(char2 v);
3988#endif
3989
3990#if (defined(RS_VERSION) && (RS_VERSION >= 21))
3991/*
3992 * Component wise conversion from char3 to long3
3993 *
3994 * Supported by API versions 21 and newer.
3995 */
3996extern long3 __attribute__((const, overloadable))convert_long3(char3 v);
3997#endif
3998
3999#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4000/*
4001 * Component wise conversion from char4 to long4
4002 *
4003 * Supported by API versions 21 and newer.
4004 */
4005extern long4 __attribute__((const, overloadable))convert_long4(char4 v);
4006#endif
4007
4008#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4009/*
4010 * Component wise conversion from uchar2 to long2
4011 *
4012 * Supported by API versions 21 and newer.
4013 */
4014extern long2 __attribute__((const, overloadable))convert_long2(uchar2 v);
4015#endif
4016
4017#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4018/*
4019 * Component wise conversion from uchar3 to long3
4020 *
4021 * Supported by API versions 21 and newer.
4022 */
4023extern long3 __attribute__((const, overloadable))convert_long3(uchar3 v);
4024#endif
4025
4026#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4027/*
4028 * Component wise conversion from uchar4 to long4
4029 *
4030 * Supported by API versions 21 and newer.
4031 */
4032extern long4 __attribute__((const, overloadable))convert_long4(uchar4 v);
4033#endif
4034
4035#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4036/*
4037 * Component wise conversion from short2 to long2
4038 *
4039 * Supported by API versions 21 and newer.
4040 */
4041extern long2 __attribute__((const, overloadable))convert_long2(short2 v);
4042#endif
4043
4044#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4045/*
4046 * Component wise conversion from short3 to long3
4047 *
4048 * Supported by API versions 21 and newer.
4049 */
4050extern long3 __attribute__((const, overloadable))convert_long3(short3 v);
4051#endif
4052
4053#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4054/*
4055 * Component wise conversion from short4 to long4
4056 *
4057 * Supported by API versions 21 and newer.
4058 */
4059extern long4 __attribute__((const, overloadable))convert_long4(short4 v);
4060#endif
4061
4062#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4063/*
4064 * Component wise conversion from ushort2 to long2
4065 *
4066 * Supported by API versions 21 and newer.
4067 */
4068extern long2 __attribute__((const, overloadable))convert_long2(ushort2 v);
4069#endif
4070
4071#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4072/*
4073 * Component wise conversion from ushort3 to long3
4074 *
4075 * Supported by API versions 21 and newer.
4076 */
4077extern long3 __attribute__((const, overloadable))convert_long3(ushort3 v);
4078#endif
4079
4080#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4081/*
4082 * Component wise conversion from ushort4 to long4
4083 *
4084 * Supported by API versions 21 and newer.
4085 */
4086extern long4 __attribute__((const, overloadable))convert_long4(ushort4 v);
4087#endif
4088
4089#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4090/*
4091 * Component wise conversion from int2 to long2
4092 *
4093 * Supported by API versions 21 and newer.
4094 */
4095extern long2 __attribute__((const, overloadable))convert_long2(int2 v);
4096#endif
4097
4098#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4099/*
4100 * Component wise conversion from int3 to long3
4101 *
4102 * Supported by API versions 21 and newer.
4103 */
4104extern long3 __attribute__((const, overloadable))convert_long3(int3 v);
4105#endif
4106
4107#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4108/*
4109 * Component wise conversion from int4 to long4
4110 *
4111 * Supported by API versions 21 and newer.
4112 */
4113extern long4 __attribute__((const, overloadable))convert_long4(int4 v);
4114#endif
4115
4116#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4117/*
4118 * Component wise conversion from uint2 to long2
4119 *
4120 * Supported by API versions 21 and newer.
4121 */
4122extern long2 __attribute__((const, overloadable))convert_long2(uint2 v);
4123#endif
4124
4125#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4126/*
4127 * Component wise conversion from uint3 to long3
4128 *
4129 * Supported by API versions 21 and newer.
4130 */
4131extern long3 __attribute__((const, overloadable))convert_long3(uint3 v);
4132#endif
4133
4134#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4135/*
4136 * Component wise conversion from uint4 to long4
4137 *
4138 * Supported by API versions 21 and newer.
4139 */
4140extern long4 __attribute__((const, overloadable))convert_long4(uint4 v);
4141#endif
4142
4143#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4144/*
Jason Sams564a4002014-04-29 16:30:41 -07004145 * Component wise conversion from float2 to ulong2
4146 *
4147 * Supported by API versions 21 and newer.
4148 */
4149extern ulong2 __attribute__((const, overloadable))convert_ulong2(float2 v);
4150#endif
4151
4152#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4153/*
4154 * Component wise conversion from float3 to ulong3
4155 *
4156 * Supported by API versions 21 and newer.
4157 */
4158extern ulong3 __attribute__((const, overloadable))convert_ulong3(float3 v);
4159#endif
4160
4161#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4162/*
4163 * Component wise conversion from float4 to ulong4
4164 *
4165 * Supported by API versions 21 and newer.
4166 */
4167extern ulong4 __attribute__((const, overloadable))convert_ulong4(float4 v);
4168#endif
4169
4170#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4171/*
Jason Sams564a4002014-04-29 16:30:41 -07004172 * Component wise conversion from char2 to ulong2
4173 *
4174 * Supported by API versions 21 and newer.
4175 */
4176extern ulong2 __attribute__((const, overloadable))convert_ulong2(char2 v);
4177#endif
4178
4179#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4180/*
4181 * Component wise conversion from char3 to ulong3
4182 *
4183 * Supported by API versions 21 and newer.
4184 */
4185extern ulong3 __attribute__((const, overloadable))convert_ulong3(char3 v);
4186#endif
4187
4188#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4189/*
4190 * Component wise conversion from char4 to ulong4
4191 *
4192 * Supported by API versions 21 and newer.
4193 */
4194extern ulong4 __attribute__((const, overloadable))convert_ulong4(char4 v);
4195#endif
4196
4197#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4198/*
4199 * Component wise conversion from uchar2 to ulong2
4200 *
4201 * Supported by API versions 21 and newer.
4202 */
4203extern ulong2 __attribute__((const, overloadable))convert_ulong2(uchar2 v);
4204#endif
4205
4206#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4207/*
4208 * Component wise conversion from uchar3 to ulong3
4209 *
4210 * Supported by API versions 21 and newer.
4211 */
4212extern ulong3 __attribute__((const, overloadable))convert_ulong3(uchar3 v);
4213#endif
4214
4215#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4216/*
4217 * Component wise conversion from uchar4 to ulong4
4218 *
4219 * Supported by API versions 21 and newer.
4220 */
4221extern ulong4 __attribute__((const, overloadable))convert_ulong4(uchar4 v);
4222#endif
4223
4224#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4225/*
4226 * Component wise conversion from short2 to ulong2
4227 *
4228 * Supported by API versions 21 and newer.
4229 */
4230extern ulong2 __attribute__((const, overloadable))convert_ulong2(short2 v);
4231#endif
4232
4233#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4234/*
4235 * Component wise conversion from short3 to ulong3
4236 *
4237 * Supported by API versions 21 and newer.
4238 */
4239extern ulong3 __attribute__((const, overloadable))convert_ulong3(short3 v);
4240#endif
4241
4242#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4243/*
4244 * Component wise conversion from short4 to ulong4
4245 *
4246 * Supported by API versions 21 and newer.
4247 */
4248extern ulong4 __attribute__((const, overloadable))convert_ulong4(short4 v);
4249#endif
4250
4251#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4252/*
4253 * Component wise conversion from ushort2 to ulong2
4254 *
4255 * Supported by API versions 21 and newer.
4256 */
4257extern ulong2 __attribute__((const, overloadable))convert_ulong2(ushort2 v);
4258#endif
4259
4260#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4261/*
4262 * Component wise conversion from ushort3 to ulong3
4263 *
4264 * Supported by API versions 21 and newer.
4265 */
4266extern ulong3 __attribute__((const, overloadable))convert_ulong3(ushort3 v);
4267#endif
4268
4269#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4270/*
4271 * Component wise conversion from ushort4 to ulong4
4272 *
4273 * Supported by API versions 21 and newer.
4274 */
4275extern ulong4 __attribute__((const, overloadable))convert_ulong4(ushort4 v);
4276#endif
4277
4278#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4279/*
4280 * Component wise conversion from int2 to ulong2
4281 *
4282 * Supported by API versions 21 and newer.
4283 */
4284extern ulong2 __attribute__((const, overloadable))convert_ulong2(int2 v);
4285#endif
4286
4287#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4288/*
4289 * Component wise conversion from int3 to ulong3
4290 *
4291 * Supported by API versions 21 and newer.
4292 */
4293extern ulong3 __attribute__((const, overloadable))convert_ulong3(int3 v);
4294#endif
4295
4296#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4297/*
4298 * Component wise conversion from int4 to ulong4
4299 *
4300 * Supported by API versions 21 and newer.
4301 */
4302extern ulong4 __attribute__((const, overloadable))convert_ulong4(int4 v);
4303#endif
4304
4305#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4306/*
4307 * Component wise conversion from uint2 to ulong2
4308 *
4309 * Supported by API versions 21 and newer.
4310 */
4311extern ulong2 __attribute__((const, overloadable))convert_ulong2(uint2 v);
4312#endif
4313
4314#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4315/*
4316 * Component wise conversion from uint3 to ulong3
4317 *
4318 * Supported by API versions 21 and newer.
4319 */
4320extern ulong3 __attribute__((const, overloadable))convert_ulong3(uint3 v);
4321#endif
4322
4323#if (defined(RS_VERSION) && (RS_VERSION >= 21))
4324/*
4325 * Component wise conversion from uint4 to ulong4
4326 *
4327 * Supported by API versions 21 and newer.
4328 */
4329extern ulong4 __attribute__((const, overloadable))convert_ulong4(uint4 v);
4330#endif
4331
Jason Sams29087fa2014-01-09 17:06:17 -08004332#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4333/*
Jason Sams29087fa2014-01-09 17:06:17 -08004334 * Copy the sign bit from y to x.
4335 *
4336 * Supported by API versions 9 and newer.
4337 */
4338extern float __attribute__((const, overloadable))copysign(float x, float y);
4339#endif
4340
4341#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4342/*
4343 * Copy the sign bit from y to x.
4344 *
4345 * Supported by API versions 9 and newer.
4346 */
4347extern float2 __attribute__((const, overloadable))copysign(float2 x, float2 y);
4348#endif
4349
4350#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4351/*
4352 * Copy the sign bit from y to x.
4353 *
4354 * Supported by API versions 9 and newer.
4355 */
4356extern float3 __attribute__((const, overloadable))copysign(float3 x, float3 y);
4357#endif
4358
4359#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4360/*
4361 * Copy the sign bit from y to x.
4362 *
4363 * Supported by API versions 9 and newer.
4364 */
4365extern float4 __attribute__((const, overloadable))copysign(float4 x, float4 y);
4366#endif
4367
4368#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4369/*
4370 * Return the cosine.
4371 *
4372 * Supported by API versions 9 and newer.
4373 */
4374extern float __attribute__((const, overloadable))cos(float);
4375#endif
4376
4377#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4378/*
4379 * Return the cosine.
4380 *
4381 * Supported by API versions 9 and newer.
4382 */
4383extern float2 __attribute__((const, overloadable))cos(float2);
4384#endif
4385
4386#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4387/*
4388 * Return the cosine.
4389 *
4390 * Supported by API versions 9 and newer.
4391 */
4392extern float3 __attribute__((const, overloadable))cos(float3);
4393#endif
4394
4395#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4396/*
4397 * Return the cosine.
4398 *
4399 * Supported by API versions 9 and newer.
4400 */
4401extern float4 __attribute__((const, overloadable))cos(float4);
4402#endif
4403
4404#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4405/*
4406 * Return the hypebolic cosine.
4407 *
4408 * Supported by API versions 9 and newer.
4409 */
4410extern float __attribute__((const, overloadable))cosh(float);
4411#endif
4412
4413#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4414/*
4415 * Return the hypebolic cosine.
4416 *
4417 * Supported by API versions 9 and newer.
4418 */
4419extern float2 __attribute__((const, overloadable))cosh(float2);
4420#endif
4421
4422#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4423/*
4424 * Return the hypebolic cosine.
4425 *
4426 * Supported by API versions 9 and newer.
4427 */
4428extern float3 __attribute__((const, overloadable))cosh(float3);
4429#endif
4430
4431#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4432/*
4433 * Return the hypebolic cosine.
4434 *
4435 * Supported by API versions 9 and newer.
4436 */
4437extern float4 __attribute__((const, overloadable))cosh(float4);
4438#endif
4439
4440#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4441/*
4442 * Return the cosine of the value * PI.
4443 *
4444 * Supported by API versions 9 and newer.
4445 */
4446extern float __attribute__((const, overloadable))cospi(float);
4447#endif
4448
4449#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4450/*
4451 * Return the cosine of the value * PI.
4452 *
4453 * Supported by API versions 9 and newer.
4454 */
4455extern float2 __attribute__((const, overloadable))cospi(float2);
4456#endif
4457
4458#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4459/*
4460 * Return the cosine of the value * PI.
4461 *
4462 * Supported by API versions 9 and newer.
4463 */
4464extern float3 __attribute__((const, overloadable))cospi(float3);
4465#endif
4466
4467#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4468/*
4469 * Return the cosine of the value * PI.
4470 *
4471 * Supported by API versions 9 and newer.
4472 */
4473extern float4 __attribute__((const, overloadable))cospi(float4);
4474#endif
4475
4476#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4477/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004478 * Compute the cross product of two vectors.
Jason Sams29087fa2014-01-09 17:06:17 -08004479 *
4480 * Supported by API versions 9 and newer.
4481 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004482extern float3 __attribute__((const, overloadable))cross(float3 lhs, float3 rhs);
Jason Sams29087fa2014-01-09 17:06:17 -08004483#endif
4484
4485#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4486/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004487 * Compute the cross product of two vectors.
Jason Sams29087fa2014-01-09 17:06:17 -08004488 *
4489 * Supported by API versions 9 and newer.
4490 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004491extern float4 __attribute__((const, overloadable))cross(float4 lhs, float4 rhs);
Jason Sams29087fa2014-01-09 17:06:17 -08004492#endif
4493
4494#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4495/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004496 * Convert from radians to degrees.
Jason Sams29087fa2014-01-09 17:06:17 -08004497 *
4498 * Supported by API versions 9 and newer.
4499 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004500extern float __attribute__((const, overloadable))degrees(float value);
Jason Sams29087fa2014-01-09 17:06:17 -08004501#endif
4502
4503#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4504/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004505 * Convert from radians to degrees.
Jason Sams29087fa2014-01-09 17:06:17 -08004506 *
4507 * Supported by API versions 9 and newer.
4508 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004509extern float2 __attribute__((const, overloadable))degrees(float2 value);
4510#endif
4511
4512#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4513/*
4514 * Convert from radians to degrees.
4515 *
4516 * Supported by API versions 9 and newer.
4517 */
4518extern float3 __attribute__((const, overloadable))degrees(float3 value);
4519#endif
4520
4521#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4522/*
4523 * Convert from radians to degrees.
4524 *
4525 * Supported by API versions 9 and newer.
4526 */
4527extern float4 __attribute__((const, overloadable))degrees(float4 value);
4528#endif
4529
4530#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4531/*
4532 * Compute the distance between two points.
4533 *
4534 * Supported by API versions 9 and newer.
4535 */
4536extern float __attribute__((const, overloadable))distance(float lhs, float rhs);
4537#endif
4538
4539#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4540/*
4541 * Compute the distance between two points.
4542 *
4543 * Supported by API versions 9 and newer.
4544 */
4545extern float __attribute__((const, overloadable))distance(float2 lhs, float2 rhs);
4546#endif
4547
4548#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4549/*
4550 * Compute the distance between two points.
4551 *
4552 * Supported by API versions 9 and newer.
4553 */
4554extern float __attribute__((const, overloadable))distance(float3 lhs, float3 rhs);
4555#endif
4556
4557#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4558/*
4559 * Compute the distance between two points.
4560 *
4561 * Supported by API versions 9 and newer.
4562 */
4563extern float __attribute__((const, overloadable))distance(float4 lhs, float4 rhs);
4564#endif
4565
4566#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4567/*
4568 * Compute the dot product of two vectors.
4569 *
4570 * Supported by API versions 9 and newer.
4571 */
4572extern float __attribute__((const, overloadable))dot(float lhs, float rhs);
4573#endif
4574
4575#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4576/*
4577 * Compute the dot product of two vectors.
4578 *
4579 * Supported by API versions 9 and newer.
4580 */
4581extern float __attribute__((const, overloadable))dot(float2 lhs, float2 rhs);
4582#endif
4583
4584#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4585/*
4586 * Compute the dot product of two vectors.
4587 *
4588 * Supported by API versions 9 and newer.
4589 */
4590extern float __attribute__((const, overloadable))dot(float3 lhs, float3 rhs);
4591#endif
4592
4593#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4594/*
4595 * Compute the dot product of two vectors.
4596 *
4597 * Supported by API versions 9 and newer.
4598 */
4599extern float __attribute__((const, overloadable))dot(float4 lhs, float4 rhs);
Jason Sams29087fa2014-01-09 17:06:17 -08004600#endif
4601
4602#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4603/*
4604 * Return the error function.
4605 *
4606 * Supported by API versions 9 and newer.
4607 */
4608extern float __attribute__((const, overloadable))erf(float);
4609#endif
4610
4611#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4612/*
4613 * Return the error function.
4614 *
4615 * Supported by API versions 9 and newer.
4616 */
4617extern float2 __attribute__((const, overloadable))erf(float2);
4618#endif
4619
4620#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4621/*
4622 * Return the error function.
4623 *
4624 * Supported by API versions 9 and newer.
4625 */
4626extern float3 __attribute__((const, overloadable))erf(float3);
4627#endif
4628
4629#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4630/*
4631 * Return the error function.
4632 *
4633 * Supported by API versions 9 and newer.
4634 */
4635extern float4 __attribute__((const, overloadable))erf(float4);
4636#endif
4637
4638#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4639/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004640 * Return the complementary error function.
4641 *
4642 * Supported by API versions 9 and newer.
4643 */
4644extern float __attribute__((const, overloadable))erfc(float);
4645#endif
4646
4647#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4648/*
4649 * Return the complementary error function.
4650 *
4651 * Supported by API versions 9 and newer.
4652 */
4653extern float2 __attribute__((const, overloadable))erfc(float2);
4654#endif
4655
4656#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4657/*
4658 * Return the complementary error function.
4659 *
4660 * Supported by API versions 9 and newer.
4661 */
4662extern float3 __attribute__((const, overloadable))erfc(float3);
4663#endif
4664
4665#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4666/*
4667 * Return the complementary error function.
4668 *
4669 * Supported by API versions 9 and newer.
4670 */
4671extern float4 __attribute__((const, overloadable))erfc(float4);
4672#endif
4673
4674#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4675/*
Jason Sams29087fa2014-01-09 17:06:17 -08004676 * Return e ^ value.
4677 *
4678 * Supported by API versions 9 and newer.
4679 */
4680extern float __attribute__((const, overloadable))exp(float);
4681#endif
4682
4683#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4684/*
4685 * Return e ^ value.
4686 *
4687 * Supported by API versions 9 and newer.
4688 */
4689extern float2 __attribute__((const, overloadable))exp(float2);
4690#endif
4691
4692#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4693/*
4694 * Return e ^ value.
4695 *
4696 * Supported by API versions 9 and newer.
4697 */
4698extern float3 __attribute__((const, overloadable))exp(float3);
4699#endif
4700
4701#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4702/*
4703 * Return e ^ value.
4704 *
4705 * Supported by API versions 9 and newer.
4706 */
4707extern float4 __attribute__((const, overloadable))exp(float4);
4708#endif
4709
4710#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4711/*
Jason Sams29087fa2014-01-09 17:06:17 -08004712 * Return 10 ^ value.
4713 *
4714 * Supported by API versions 9 and newer.
4715 */
4716extern float __attribute__((const, overloadable))exp10(float);
4717#endif
4718
4719#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4720/*
4721 * Return 10 ^ value.
4722 *
4723 * Supported by API versions 9 and newer.
4724 */
4725extern float2 __attribute__((const, overloadable))exp10(float2);
4726#endif
4727
4728#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4729/*
4730 * Return 10 ^ value.
4731 *
4732 * Supported by API versions 9 and newer.
4733 */
4734extern float3 __attribute__((const, overloadable))exp10(float3);
4735#endif
4736
4737#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4738/*
4739 * Return 10 ^ value.
4740 *
4741 * Supported by API versions 9 and newer.
4742 */
4743extern float4 __attribute__((const, overloadable))exp10(float4);
4744#endif
4745
4746#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4747/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004748 * Return 2 ^ value.
4749 *
4750 * Supported by API versions 9 and newer.
4751 */
4752extern float __attribute__((const, overloadable))exp2(float);
4753#endif
4754
4755#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4756/*
4757 * Return 2 ^ value.
4758 *
4759 * Supported by API versions 9 and newer.
4760 */
4761extern float2 __attribute__((const, overloadable))exp2(float2);
4762#endif
4763
4764#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4765/*
4766 * Return 2 ^ value.
4767 *
4768 * Supported by API versions 9 and newer.
4769 */
4770extern float3 __attribute__((const, overloadable))exp2(float3);
4771#endif
4772
4773#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4774/*
4775 * Return 2 ^ value.
4776 *
4777 * Supported by API versions 9 and newer.
4778 */
4779extern float4 __attribute__((const, overloadable))exp2(float4);
4780#endif
4781
4782#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4783/*
Jason Sams29087fa2014-01-09 17:06:17 -08004784 * Return (e ^ value) - 1.
4785 *
4786 * Supported by API versions 9 and newer.
4787 */
4788extern float __attribute__((const, overloadable))expm1(float);
4789#endif
4790
4791#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4792/*
4793 * Return (e ^ value) - 1.
4794 *
4795 * Supported by API versions 9 and newer.
4796 */
4797extern float2 __attribute__((const, overloadable))expm1(float2);
4798#endif
4799
4800#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4801/*
4802 * Return (e ^ value) - 1.
4803 *
4804 * Supported by API versions 9 and newer.
4805 */
4806extern float3 __attribute__((const, overloadable))expm1(float3);
4807#endif
4808
4809#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4810/*
4811 * Return (e ^ value) - 1.
4812 *
4813 * Supported by API versions 9 and newer.
4814 */
4815extern float4 __attribute__((const, overloadable))expm1(float4);
4816#endif
4817
4818#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4819/*
4820 * Return the absolute value of a value.
4821 *
4822 * Supported by API versions 9 and newer.
4823 */
4824extern float __attribute__((const, overloadable))fabs(float);
4825#endif
4826
4827#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4828/*
4829 * Return the absolute value of a value.
4830 *
4831 * Supported by API versions 9 and newer.
4832 */
4833extern float2 __attribute__((const, overloadable))fabs(float2);
4834#endif
4835
4836#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4837/*
4838 * Return the absolute value of a value.
4839 *
4840 * Supported by API versions 9 and newer.
4841 */
4842extern float3 __attribute__((const, overloadable))fabs(float3);
4843#endif
4844
4845#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4846/*
4847 * Return the absolute value of a value.
4848 *
4849 * Supported by API versions 9 and newer.
4850 */
4851extern float4 __attribute__((const, overloadable))fabs(float4);
4852#endif
4853
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004854#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jason Sams29087fa2014-01-09 17:06:17 -08004855/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004856 * Compute the approximate distance between two points.
Jason Sams29087fa2014-01-09 17:06:17 -08004857 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004858 * Supported by API versions 17 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08004859 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004860extern float __attribute__((const, overloadable))fast_distance(float lhs, float rhs);
4861#endif
4862
4863#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4864/*
4865 * Compute the approximate distance between two points.
4866 *
4867 * Supported by API versions 17 and newer.
4868 */
4869extern float __attribute__((const, overloadable))fast_distance(float2 lhs, float2 rhs);
4870#endif
4871
4872#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4873/*
4874 * Compute the approximate distance between two points.
4875 *
4876 * Supported by API versions 17 and newer.
4877 */
4878extern float __attribute__((const, overloadable))fast_distance(float3 lhs, float3 rhs);
4879#endif
4880
4881#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4882/*
4883 * Compute the approximate distance between two points.
4884 *
4885 * Supported by API versions 17 and newer.
4886 */
4887extern float __attribute__((const, overloadable))fast_distance(float4 lhs, float4 rhs);
4888#endif
4889
4890#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4891/*
4892 * Compute the approximate length of a vector.
4893 *
4894 * Supported by API versions 17 and newer.
4895 */
4896extern float __attribute__((const, overloadable))fast_length(float v);
4897#endif
4898
4899#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4900/*
4901 * Compute the approximate length of a vector.
4902 *
4903 * Supported by API versions 17 and newer.
4904 */
4905extern float __attribute__((const, overloadable))fast_length(float2 v);
4906#endif
4907
4908#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4909/*
4910 * Compute the approximate length of a vector.
4911 *
4912 * Supported by API versions 17 and newer.
4913 */
4914extern float __attribute__((const, overloadable))fast_length(float3 v);
4915#endif
4916
4917#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4918/*
4919 * Compute the approximate length of a vector.
4920 *
4921 * Supported by API versions 17 and newer.
4922 */
4923extern float __attribute__((const, overloadable))fast_length(float4 v);
4924#endif
4925
4926#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4927/*
4928 * Approximately normalize a vector.
4929 *
4930 * Supported by API versions 17 and newer.
4931 */
4932extern float __attribute__((const, overloadable))fast_normalize(float v);
4933#endif
4934
4935#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4936/*
4937 * Approximately normalize a vector.
4938 *
4939 * Supported by API versions 17 and newer.
4940 */
4941extern float2 __attribute__((const, overloadable))fast_normalize(float2 v);
4942#endif
4943
4944#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4945/*
4946 * Approximately normalize a vector.
4947 *
4948 * Supported by API versions 17 and newer.
4949 */
4950extern float3 __attribute__((const, overloadable))fast_normalize(float3 v);
4951#endif
4952
4953#if (defined(RS_VERSION) && (RS_VERSION >= 17))
4954/*
4955 * Approximately normalize a vector.
4956 *
4957 * Supported by API versions 17 and newer.
4958 */
4959extern float4 __attribute__((const, overloadable))fast_normalize(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08004960#endif
4961
4962#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4963/*
4964 * Return the positive difference between two values.
4965 *
4966 * Supported by API versions 9 and newer.
4967 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004968extern float __attribute__((const, overloadable))fdim(float a, float b);
Jason Sams29087fa2014-01-09 17:06:17 -08004969#endif
4970
4971#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4972/*
4973 * Return the positive difference between two values.
4974 *
4975 * Supported by API versions 9 and newer.
4976 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004977extern float2 __attribute__((const, overloadable))fdim(float2 a, float2 b);
Jason Sams29087fa2014-01-09 17:06:17 -08004978#endif
4979
4980#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4981/*
4982 * Return the positive difference between two values.
4983 *
4984 * Supported by API versions 9 and newer.
4985 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08004986extern float3 __attribute__((const, overloadable))fdim(float3 a, float3 b);
4987#endif
4988
4989#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4990/*
4991 * Return the positive difference between two values.
4992 *
4993 * Supported by API versions 9 and newer.
4994 */
4995extern float4 __attribute__((const, overloadable))fdim(float4 a, float4 b);
Jason Sams29087fa2014-01-09 17:06:17 -08004996#endif
4997
4998#if (defined(RS_VERSION) && (RS_VERSION >= 9))
4999/*
5000 * Return the smallest integer not greater than a value.
5001 *
5002 * Supported by API versions 9 and newer.
5003 */
5004extern float __attribute__((const, overloadable))floor(float);
5005#endif
5006
5007#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5008/*
5009 * Return the smallest integer not greater than a value.
5010 *
5011 * Supported by API versions 9 and newer.
5012 */
5013extern float2 __attribute__((const, overloadable))floor(float2);
5014#endif
5015
5016#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5017/*
5018 * Return the smallest integer not greater than a value.
5019 *
5020 * Supported by API versions 9 and newer.
5021 */
5022extern float3 __attribute__((const, overloadable))floor(float3);
5023#endif
5024
5025#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5026/*
5027 * Return the smallest integer not greater than a value.
5028 *
5029 * Supported by API versions 9 and newer.
5030 */
5031extern float4 __attribute__((const, overloadable))floor(float4);
5032#endif
5033
5034#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5035/*
5036 * Return (a * b) + c.
5037 *
5038 * Supported by API versions 9 and newer.
5039 */
5040extern float __attribute__((const, overloadable))fma(float a, float b, float c);
5041#endif
5042
5043#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5044/*
5045 * Return (a * b) + c.
5046 *
5047 * Supported by API versions 9 and newer.
5048 */
5049extern float2 __attribute__((const, overloadable))fma(float2 a, float2 b, float2 c);
5050#endif
5051
5052#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5053/*
5054 * Return (a * b) + c.
5055 *
5056 * Supported by API versions 9 and newer.
5057 */
5058extern float3 __attribute__((const, overloadable))fma(float3 a, float3 b, float3 c);
5059#endif
5060
5061#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5062/*
5063 * Return (a * b) + c.
5064 *
5065 * Supported by API versions 9 and newer.
5066 */
5067extern float4 __attribute__((const, overloadable))fma(float4 a, float4 b, float4 c);
5068#endif
5069
5070#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5071/*
5072 * Return (x < y ? y : x)
5073 *
5074 * Supported by API versions 9 and newer.
5075 */
5076extern float __attribute__((const, overloadable))fmax(float x, float y);
5077#endif
5078
5079#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5080/*
5081 * Return (x < y ? y : x)
5082 *
5083 * Supported by API versions 9 and newer.
5084 */
5085extern float2 __attribute__((const, overloadable))fmax(float2 x, float2 y);
5086#endif
5087
5088#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5089/*
5090 * Return (x < y ? y : x)
5091 *
5092 * Supported by API versions 9 and newer.
5093 */
5094extern float3 __attribute__((const, overloadable))fmax(float3 x, float3 y);
5095#endif
5096
5097#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5098/*
5099 * Return (x < y ? y : x)
5100 *
5101 * Supported by API versions 9 and newer.
5102 */
5103extern float4 __attribute__((const, overloadable))fmax(float4 x, float4 y);
5104#endif
5105
5106#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5107/*
5108 * Return (x < y ? y : x)
5109 *
5110 * Supported by API versions 9 and newer.
5111 */
Jason Sams29087fa2014-01-09 17:06:17 -08005112extern float2 __attribute__((const, overloadable))fmax(float2 x, float y);
5113#endif
5114
5115#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5116/*
5117 * Return (x < y ? y : x)
5118 *
5119 * Supported by API versions 9 and newer.
5120 */
5121extern float3 __attribute__((const, overloadable))fmax(float3 x, float y);
5122#endif
5123
5124#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5125/*
5126 * Return (x < y ? y : x)
5127 *
5128 * Supported by API versions 9 and newer.
5129 */
5130extern float4 __attribute__((const, overloadable))fmax(float4 x, float y);
5131#endif
5132
5133#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5134/*
5135 * Return (x > y ? y : x)
5136 *
5137 * Supported by API versions 9 and newer.
5138 */
5139extern float __attribute__((const, overloadable))fmin(float x, float y);
5140#endif
5141
5142#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5143/*
5144 * Return (x > y ? y : x)
5145 *
5146 * Supported by API versions 9 and newer.
5147 */
5148extern float2 __attribute__((const, overloadable))fmin(float2 x, float2 y);
5149#endif
5150
5151#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5152/*
5153 * Return (x > y ? y : x)
5154 *
5155 * Supported by API versions 9 and newer.
5156 */
5157extern float3 __attribute__((const, overloadable))fmin(float3 x, float3 y);
5158#endif
5159
5160#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5161/*
5162 * Return (x > y ? y : x)
5163 *
5164 * Supported by API versions 9 and newer.
5165 */
5166extern float4 __attribute__((const, overloadable))fmin(float4 x, float4 y);
5167#endif
5168
5169#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5170/*
5171 * Return (x > y ? y : x)
5172 *
5173 * Supported by API versions 9 and newer.
5174 */
Jason Sams29087fa2014-01-09 17:06:17 -08005175extern float2 __attribute__((const, overloadable))fmin(float2 x, float y);
5176#endif
5177
5178#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5179/*
5180 * Return (x > y ? y : x)
5181 *
5182 * Supported by API versions 9 and newer.
5183 */
5184extern float3 __attribute__((const, overloadable))fmin(float3 x, float y);
5185#endif
5186
5187#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5188/*
5189 * Return (x > y ? y : x)
5190 *
5191 * Supported by API versions 9 and newer.
5192 */
5193extern float4 __attribute__((const, overloadable))fmin(float4 x, float y);
5194#endif
5195
5196#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5197/*
5198 * Return the remainder from x / y
5199 *
5200 * Supported by API versions 9 and newer.
5201 */
5202extern float __attribute__((const, overloadable))fmod(float x, float y);
5203#endif
5204
5205#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5206/*
5207 * Return the remainder from x / y
5208 *
5209 * Supported by API versions 9 and newer.
5210 */
5211extern float2 __attribute__((const, overloadable))fmod(float2 x, float2 y);
5212#endif
5213
5214#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5215/*
5216 * Return the remainder from x / y
5217 *
5218 * Supported by API versions 9 and newer.
5219 */
5220extern float3 __attribute__((const, overloadable))fmod(float3 x, float3 y);
5221#endif
5222
5223#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5224/*
5225 * Return the remainder from x / y
5226 *
5227 * Supported by API versions 9 and newer.
5228 */
5229extern float4 __attribute__((const, overloadable))fmod(float4 x, float4 y);
5230#endif
5231
5232#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5233/*
5234 * Return fractional part of v
5235 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005236 * @param floor floor[0] will be set to the floor of the input value.
Jason Sams29087fa2014-01-09 17:06:17 -08005237 *
5238 * Supported by API versions 9 and newer.
5239 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005240extern float __attribute__((overloadable))fract(float v, float* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08005241#endif
5242
5243#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5244/*
5245 * Return fractional part of v
5246 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005247 * @param floor floor[0] will be set to the floor of the input value.
Jason Sams29087fa2014-01-09 17:06:17 -08005248 *
5249 * Supported by API versions 9 and newer.
5250 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005251extern float2 __attribute__((overloadable))fract(float2 v, float2* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08005252#endif
5253
5254#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5255/*
5256 * Return fractional part of v
5257 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005258 * @param floor floor[0] will be set to the floor of the input value.
Jason Sams29087fa2014-01-09 17:06:17 -08005259 *
5260 * Supported by API versions 9 and newer.
5261 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005262extern float3 __attribute__((overloadable))fract(float3 v, float3* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08005263#endif
5264
5265#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5266/*
5267 * Return fractional part of v
5268 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005269 * @param floor floor[0] will be set to the floor of the input value.
Jason Sams29087fa2014-01-09 17:06:17 -08005270 *
5271 * Supported by API versions 9 and newer.
5272 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005273extern float4 __attribute__((overloadable))fract(float4 v, float4* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08005274#endif
5275
5276#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5277/*
5278 * Return fractional part of v
5279 *
5280 * Supported by API versions 9 and newer.
5281 */
5282static float __attribute__((const, overloadable))fract(float v) {
5283 float unused;
5284 return fract(v, &unused);
5285}
5286#endif
5287
5288#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5289/*
5290 * Return fractional part of v
5291 *
5292 * Supported by API versions 9 and newer.
5293 */
5294static float2 __attribute__((const, overloadable))fract(float2 v) {
5295 float2 unused;
5296 return fract(v, &unused);
5297}
5298#endif
5299
5300#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5301/*
5302 * Return fractional part of v
5303 *
5304 * Supported by API versions 9 and newer.
5305 */
5306static float3 __attribute__((const, overloadable))fract(float3 v) {
5307 float3 unused;
5308 return fract(v, &unused);
5309}
5310#endif
5311
5312#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5313/*
5314 * Return fractional part of v
5315 *
5316 * Supported by API versions 9 and newer.
5317 */
5318static float4 __attribute__((const, overloadable))fract(float4 v) {
5319 float4 unused;
5320 return fract(v, &unused);
5321}
5322#endif
5323
5324#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5325/*
5326 * Return the mantissa and place the exponent into iptr[0]
5327 *
5328 * @param v Supports float, float2, float3, float4.
5329 *
5330 * Supported by API versions 9 and newer.
5331 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005332extern float __attribute__((overloadable))frexp(float v, int* iptr);
Jason Sams29087fa2014-01-09 17:06:17 -08005333#endif
5334
5335#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5336/*
5337 * Return the mantissa and place the exponent into iptr[0]
5338 *
5339 * @param v Supports float, float2, float3, float4.
5340 *
5341 * Supported by API versions 9 and newer.
5342 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005343extern float2 __attribute__((overloadable))frexp(float2 v, int2* iptr);
Jason Sams29087fa2014-01-09 17:06:17 -08005344#endif
5345
5346#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5347/*
5348 * Return the mantissa and place the exponent into iptr[0]
5349 *
5350 * @param v Supports float, float2, float3, float4.
5351 *
5352 * Supported by API versions 9 and newer.
5353 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005354extern float3 __attribute__((overloadable))frexp(float3 v, int3* iptr);
Jason Sams29087fa2014-01-09 17:06:17 -08005355#endif
5356
5357#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5358/*
5359 * Return the mantissa and place the exponent into iptr[0]
5360 *
5361 * @param v Supports float, float2, float3, float4.
5362 *
5363 * Supported by API versions 9 and newer.
5364 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005365extern float4 __attribute__((overloadable))frexp(float4 v, int4* iptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005366#endif
5367
5368#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5369/*
5370 * Return the approximate reciprocal of a value.
5371 *
5372 * Supported by API versions 17 and newer.
5373 */
5374extern float __attribute__((const, overloadable))half_recip(float v);
5375#endif
5376
5377#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5378/*
5379 * Return the approximate reciprocal of a value.
5380 *
5381 * Supported by API versions 17 and newer.
5382 */
5383extern float2 __attribute__((const, overloadable))half_recip(float2 v);
5384#endif
5385
5386#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5387/*
5388 * Return the approximate reciprocal of a value.
5389 *
5390 * Supported by API versions 17 and newer.
5391 */
5392extern float3 __attribute__((const, overloadable))half_recip(float3 v);
5393#endif
5394
5395#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5396/*
5397 * Return the approximate reciprocal of a value.
5398 *
5399 * Supported by API versions 17 and newer.
5400 */
5401extern float4 __attribute__((const, overloadable))half_recip(float4 v);
5402#endif
5403
5404#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5405/*
5406 * Return the approximate value of (1.f / sqrt(value)).
5407 *
5408 * Supported by API versions 17 and newer.
5409 */
5410extern float __attribute__((const, overloadable))half_rsqrt(float v);
5411#endif
5412
5413#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5414/*
5415 * Return the approximate value of (1.f / sqrt(value)).
5416 *
5417 * Supported by API versions 17 and newer.
5418 */
5419extern float2 __attribute__((const, overloadable))half_rsqrt(float2 v);
5420#endif
5421
5422#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5423/*
5424 * Return the approximate value of (1.f / sqrt(value)).
5425 *
5426 * Supported by API versions 17 and newer.
5427 */
5428extern float3 __attribute__((const, overloadable))half_rsqrt(float3 v);
5429#endif
5430
5431#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5432/*
5433 * Return the approximate value of (1.f / sqrt(value)).
5434 *
5435 * Supported by API versions 17 and newer.
5436 */
5437extern float4 __attribute__((const, overloadable))half_rsqrt(float4 v);
5438#endif
5439
5440#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5441/*
5442 * Return the approximate square root of a value.
5443 *
5444 * Supported by API versions 17 and newer.
5445 */
5446extern float __attribute__((const, overloadable))half_sqrt(float v);
5447#endif
5448
5449#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5450/*
5451 * Return the approximate square root of a value.
5452 *
5453 * Supported by API versions 17 and newer.
5454 */
5455extern float2 __attribute__((const, overloadable))half_sqrt(float2 v);
5456#endif
5457
5458#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5459/*
5460 * Return the approximate square root of a value.
5461 *
5462 * Supported by API versions 17 and newer.
5463 */
5464extern float3 __attribute__((const, overloadable))half_sqrt(float3 v);
5465#endif
5466
5467#if (defined(RS_VERSION) && (RS_VERSION >= 17))
5468/*
5469 * Return the approximate square root of a value.
5470 *
5471 * Supported by API versions 17 and newer.
5472 */
5473extern float4 __attribute__((const, overloadable))half_sqrt(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005474#endif
5475
5476#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5477/*
5478 * Return sqrt(x*x + y*y)
5479 *
5480 * Supported by API versions 9 and newer.
5481 */
5482extern float __attribute__((const, overloadable))hypot(float x, float y);
5483#endif
5484
5485#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5486/*
5487 * Return sqrt(x*x + y*y)
5488 *
5489 * Supported by API versions 9 and newer.
5490 */
5491extern float2 __attribute__((const, overloadable))hypot(float2 x, float2 y);
5492#endif
5493
5494#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5495/*
5496 * Return sqrt(x*x + y*y)
5497 *
5498 * Supported by API versions 9 and newer.
5499 */
5500extern float3 __attribute__((const, overloadable))hypot(float3 x, float3 y);
5501#endif
5502
5503#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5504/*
5505 * Return sqrt(x*x + y*y)
5506 *
5507 * Supported by API versions 9 and newer.
5508 */
5509extern float4 __attribute__((const, overloadable))hypot(float4 x, float4 y);
5510#endif
5511
5512#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5513/*
5514 * Return the integer exponent of a value
5515 *
5516 * Supported by API versions 9 and newer.
5517 */
5518extern int __attribute__((const, overloadable))ilogb(float);
5519#endif
5520
5521#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5522/*
5523 * Return the integer exponent of a value
5524 *
5525 * Supported by API versions 9 and newer.
5526 */
5527extern int2 __attribute__((const, overloadable))ilogb(float2);
5528#endif
5529
5530#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5531/*
5532 * Return the integer exponent of a value
5533 *
5534 * Supported by API versions 9 and newer.
5535 */
5536extern int3 __attribute__((const, overloadable))ilogb(float3);
5537#endif
5538
5539#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5540/*
5541 * Return the integer exponent of a value
5542 *
5543 * Supported by API versions 9 and newer.
5544 */
5545extern int4 __attribute__((const, overloadable))ilogb(float4);
5546#endif
5547
5548#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5549/*
5550 * Return (x * 2^y)
5551 *
Jason Sams29087fa2014-01-09 17:06:17 -08005552 * @param x Supports 1,2,3,4 components
5553 * @param y Supports single component or matching vector.
5554 *
5555 * Supported by API versions 9 and newer.
5556 */
5557extern float __attribute__((const, overloadable))ldexp(float x, int y);
5558#endif
5559
5560#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5561/*
5562 * Return (x * 2^y)
5563 *
5564 * @param x Supports 1,2,3,4 components
5565 * @param y Supports single component or matching vector.
5566 *
5567 * Supported by API versions 9 and newer.
5568 */
5569extern float2 __attribute__((const, overloadable))ldexp(float2 x, int2 y);
5570#endif
5571
5572#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5573/*
5574 * Return (x * 2^y)
5575 *
5576 * @param x Supports 1,2,3,4 components
5577 * @param y Supports single component or matching vector.
5578 *
5579 * Supported by API versions 9 and newer.
5580 */
5581extern float3 __attribute__((const, overloadable))ldexp(float3 x, int3 y);
5582#endif
5583
5584#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5585/*
5586 * Return (x * 2^y)
5587 *
5588 * @param x Supports 1,2,3,4 components
5589 * @param y Supports single component or matching vector.
5590 *
5591 * Supported by API versions 9 and newer.
5592 */
5593extern float4 __attribute__((const, overloadable))ldexp(float4 x, int4 y);
5594#endif
5595
5596#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5597/*
5598 * Return (x * 2^y)
5599 *
5600 * @param x Supports 1,2,3,4 components
5601 * @param y Supports single component or matching vector.
5602 *
5603 * Supported by API versions 9 and newer.
5604 */
5605extern float2 __attribute__((const, overloadable))ldexp(float2 x, int y);
5606#endif
5607
5608#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5609/*
5610 * Return (x * 2^y)
5611 *
5612 * @param x Supports 1,2,3,4 components
5613 * @param y Supports single component or matching vector.
5614 *
5615 * Supported by API versions 9 and newer.
5616 */
5617extern float3 __attribute__((const, overloadable))ldexp(float3 x, int y);
5618#endif
5619
5620#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5621/*
5622 * Return (x * 2^y)
5623 *
5624 * @param x Supports 1,2,3,4 components
5625 * @param y Supports single component or matching vector.
5626 *
5627 * Supported by API versions 9 and newer.
5628 */
5629extern float4 __attribute__((const, overloadable))ldexp(float4 x, int y);
5630#endif
5631
5632#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5633/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005634 * Compute the length of a vector.
Jason Sams29087fa2014-01-09 17:06:17 -08005635 *
5636 * Supported by API versions 9 and newer.
5637 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005638extern float __attribute__((const, overloadable))length(float v);
5639#endif
5640
5641#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5642/*
5643 * Compute the length of a vector.
5644 *
5645 * Supported by API versions 9 and newer.
5646 */
5647extern float __attribute__((const, overloadable))length(float2 v);
5648#endif
5649
5650#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5651/*
5652 * Compute the length of a vector.
5653 *
5654 * Supported by API versions 9 and newer.
5655 */
5656extern float __attribute__((const, overloadable))length(float3 v);
5657#endif
5658
5659#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5660/*
5661 * Compute the length of a vector.
5662 *
5663 * Supported by API versions 9 and newer.
5664 */
5665extern float __attribute__((const, overloadable))length(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005666#endif
5667
5668#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5669/*
5670 * Return the log gamma and sign
5671 *
5672 * Supported by API versions 9 and newer.
5673 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005674extern float __attribute__((const, overloadable))lgamma(float);
Jason Sams29087fa2014-01-09 17:06:17 -08005675#endif
5676
5677#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5678/*
5679 * Return the log gamma and sign
5680 *
5681 * Supported by API versions 9 and newer.
5682 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005683extern float2 __attribute__((const, overloadable))lgamma(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08005684#endif
5685
5686#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5687/*
5688 * Return the log gamma and sign
5689 *
5690 * Supported by API versions 9 and newer.
5691 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005692extern float3 __attribute__((const, overloadable))lgamma(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08005693#endif
5694
5695#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5696/*
5697 * Return the log gamma and sign
5698 *
5699 * Supported by API versions 9 and newer.
5700 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005701extern float4 __attribute__((const, overloadable))lgamma(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08005702#endif
5703
5704#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5705/*
5706 * Return the log gamma and sign
5707 *
5708 * Supported by API versions 9 and newer.
5709 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005710extern float __attribute__((overloadable))lgamma(float x, int* y);
Jason Sams29087fa2014-01-09 17:06:17 -08005711#endif
5712
5713#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5714/*
5715 * Return the log gamma and sign
5716 *
5717 * Supported by API versions 9 and newer.
5718 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005719extern float2 __attribute__((overloadable))lgamma(float2 x, int2* y);
Jason Sams29087fa2014-01-09 17:06:17 -08005720#endif
5721
5722#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5723/*
5724 * Return the log gamma and sign
5725 *
5726 * Supported by API versions 9 and newer.
5727 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005728extern float3 __attribute__((overloadable))lgamma(float3 x, int3* y);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005729#endif
5730
5731#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5732/*
5733 * Return the log gamma and sign
5734 *
5735 * Supported by API versions 9 and newer.
5736 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08005737extern float4 __attribute__((overloadable))lgamma(float4 x, int4* y);
Jason Sams29087fa2014-01-09 17:06:17 -08005738#endif
5739
5740#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5741/*
5742 * Return the natural logarithm.
5743 *
5744 * Supported by API versions 9 and newer.
5745 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005746extern float __attribute__((const, overloadable))log(float);
Jason Sams29087fa2014-01-09 17:06:17 -08005747#endif
5748
5749#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5750/*
5751 * Return the natural logarithm.
5752 *
5753 * Supported by API versions 9 and newer.
5754 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005755extern float2 __attribute__((const, overloadable))log(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08005756#endif
5757
5758#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5759/*
5760 * Return the natural logarithm.
5761 *
5762 * Supported by API versions 9 and newer.
5763 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005764extern float3 __attribute__((const, overloadable))log(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08005765#endif
5766
5767#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5768/*
5769 * Return the natural logarithm.
5770 *
5771 * Supported by API versions 9 and newer.
5772 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005773extern float4 __attribute__((const, overloadable))log(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08005774#endif
5775
5776#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5777/*
5778 * Return the base 10 logarithm.
5779 *
5780 * Supported by API versions 9 and newer.
5781 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005782extern float __attribute__((const, overloadable))log10(float);
Jason Sams29087fa2014-01-09 17:06:17 -08005783#endif
5784
5785#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5786/*
5787 * Return the base 10 logarithm.
5788 *
5789 * Supported by API versions 9 and newer.
5790 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005791extern float2 __attribute__((const, overloadable))log10(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08005792#endif
5793
5794#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5795/*
5796 * Return the base 10 logarithm.
5797 *
5798 * Supported by API versions 9 and newer.
5799 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005800extern float3 __attribute__((const, overloadable))log10(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08005801#endif
5802
5803#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5804/*
5805 * Return the base 10 logarithm.
5806 *
5807 * Supported by API versions 9 and newer.
5808 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005809extern float4 __attribute__((const, overloadable))log10(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08005810#endif
5811
5812#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5813/*
5814 * Return the natural logarithm of (v + 1.0f)
5815 *
5816 * Supported by API versions 9 and newer.
5817 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005818extern float __attribute__((const, overloadable))log1p(float);
Jason Sams29087fa2014-01-09 17:06:17 -08005819#endif
5820
5821#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5822/*
5823 * Return the natural logarithm of (v + 1.0f)
5824 *
5825 * Supported by API versions 9 and newer.
5826 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005827extern float2 __attribute__((const, overloadable))log1p(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08005828#endif
5829
5830#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5831/*
5832 * Return the natural logarithm of (v + 1.0f)
5833 *
5834 * Supported by API versions 9 and newer.
5835 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005836extern float3 __attribute__((const, overloadable))log1p(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08005837#endif
5838
5839#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5840/*
5841 * Return the natural logarithm of (v + 1.0f)
5842 *
5843 * Supported by API versions 9 and newer.
5844 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005845extern float4 __attribute__((const, overloadable))log1p(float4);
5846#endif
5847
5848#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5849/*
5850 * Return the base 2 logarithm.
5851 *
5852 * Supported by API versions 9 and newer.
5853 */
5854extern float __attribute__((const, overloadable))log2(float);
5855#endif
5856
5857#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5858/*
5859 * Return the base 2 logarithm.
5860 *
5861 * Supported by API versions 9 and newer.
5862 */
5863extern float2 __attribute__((const, overloadable))log2(float2);
5864#endif
5865
5866#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5867/*
5868 * Return the base 2 logarithm.
5869 *
5870 * Supported by API versions 9 and newer.
5871 */
5872extern float3 __attribute__((const, overloadable))log2(float3);
5873#endif
5874
5875#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5876/*
5877 * Return the base 2 logarithm.
5878 *
5879 * Supported by API versions 9 and newer.
5880 */
5881extern float4 __attribute__((const, overloadable))log2(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08005882#endif
5883
5884#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5885/*
5886 * Compute the exponent of the value.
5887 *
5888 * Supported by API versions 9 and newer.
5889 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005890extern float __attribute__((const, overloadable))logb(float);
Jason Sams29087fa2014-01-09 17:06:17 -08005891#endif
5892
5893#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5894/*
5895 * Compute the exponent of the value.
5896 *
5897 * Supported by API versions 9 and newer.
5898 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005899extern float2 __attribute__((const, overloadable))logb(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08005900#endif
5901
5902#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5903/*
5904 * Compute the exponent of the value.
5905 *
5906 * Supported by API versions 9 and newer.
5907 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005908extern float3 __attribute__((const, overloadable))logb(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08005909#endif
5910
5911#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5912/*
5913 * Compute the exponent of the value.
5914 *
5915 * Supported by API versions 9 and newer.
5916 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08005917extern float4 __attribute__((const, overloadable))logb(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08005918#endif
5919
5920#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5921/*
5922 * Compute (a * b) + c
5923 *
5924 * Supported by API versions 9 and newer.
5925 */
5926extern float __attribute__((const, overloadable))mad(float a, float b, float c);
5927#endif
5928
5929#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5930/*
5931 * Compute (a * b) + c
5932 *
5933 * Supported by API versions 9 and newer.
5934 */
5935extern float2 __attribute__((const, overloadable))mad(float2 a, float2 b, float2 c);
5936#endif
5937
5938#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5939/*
5940 * Compute (a * b) + c
5941 *
5942 * Supported by API versions 9 and newer.
5943 */
5944extern float3 __attribute__((const, overloadable))mad(float3 a, float3 b, float3 c);
5945#endif
5946
5947#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5948/*
5949 * Compute (a * b) + c
5950 *
5951 * Supported by API versions 9 and newer.
5952 */
5953extern float4 __attribute__((const, overloadable))mad(float4 a, float4 b, float4 c);
5954#endif
5955
5956#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5957/*
Jason Sams29087fa2014-01-09 17:06:17 -08005958 * Return the maximum value from two arguments
5959 *
5960 * Supported by API versions 9 and newer.
5961 */
5962extern float __attribute__((const, overloadable))max(float, float);
5963#endif
5964
5965#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5966/*
5967 * Return the maximum value from two arguments
5968 *
5969 * Supported by API versions 9 and newer.
5970 */
5971extern float2 __attribute__((const, overloadable))max(float2, float2);
5972#endif
5973
5974#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5975/*
5976 * Return the maximum value from two arguments
5977 *
5978 * Supported by API versions 9 and newer.
5979 */
5980extern float3 __attribute__((const, overloadable))max(float3, float3);
5981#endif
5982
5983#if (defined(RS_VERSION) && (RS_VERSION >= 9))
5984/*
5985 * Return the maximum value from two arguments
5986 *
5987 * Supported by API versions 9 and newer.
5988 */
5989extern float4 __attribute__((const, overloadable))max(float4, float4);
5990#endif
5991
5992#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
5993/*
5994 * Return the maximum value from two arguments
5995 *
5996 * Suppored by API versions 9 - 19
5997 */
5998static char __attribute__((const, overloadable))max(char v1, char v2) {
5999 return (v1 > v2 ? v1 : v2);
6000}
6001#endif
6002
6003#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6004/*
6005 * Return the maximum value from two arguments
6006 *
6007 * Suppored by API versions 9 - 19
6008 */
6009static uchar __attribute__((const, overloadable))max(uchar v1, uchar v2) {
6010 return (v1 > v2 ? v1 : v2);
6011}
6012#endif
6013
6014#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6015/*
6016 * Return the maximum value from two arguments
6017 *
6018 * Suppored by API versions 9 - 19
6019 */
6020static short __attribute__((const, overloadable))max(short v1, short v2) {
6021 return (v1 > v2 ? v1 : v2);
6022}
6023#endif
6024
6025#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6026/*
6027 * Return the maximum value from two arguments
6028 *
6029 * Suppored by API versions 9 - 19
6030 */
6031static ushort __attribute__((const, overloadable))max(ushort v1, ushort v2) {
6032 return (v1 > v2 ? v1 : v2);
6033}
6034#endif
6035
6036#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6037/*
6038 * Return the maximum value from two arguments
6039 *
6040 * Suppored by API versions 9 - 19
6041 */
6042static int __attribute__((const, overloadable))max(int v1, int v2) {
6043 return (v1 > v2 ? v1 : v2);
6044}
6045#endif
6046
6047#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6048/*
6049 * Return the maximum value from two arguments
6050 *
6051 * Suppored by API versions 9 - 19
6052 */
6053static uint __attribute__((const, overloadable))max(uint v1, uint v2) {
6054 return (v1 > v2 ? v1 : v2);
6055}
6056#endif
6057
6058#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6059/*
6060 * Return the maximum value from two arguments
6061 *
6062 * Suppored by API versions 9 - 19
6063 */
6064static char2 __attribute__((const, overloadable))max(char2 v1, char2 v2) {
6065 char2 tmp;
6066 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6067 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6068 return tmp;
6069}
6070#endif
6071
6072#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6073/*
6074 * Return the maximum value from two arguments
6075 *
6076 * Suppored by API versions 9 - 19
6077 */
6078static uchar2 __attribute__((const, overloadable))max(uchar2 v1, uchar2 v2) {
6079 uchar2 tmp;
6080 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6081 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6082 return tmp;
6083}
6084#endif
6085
6086#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6087/*
6088 * Return the maximum value from two arguments
6089 *
6090 * Suppored by API versions 9 - 19
6091 */
6092static short2 __attribute__((const, overloadable))max(short2 v1, short2 v2) {
6093 short2 tmp;
6094 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6095 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6096 return tmp;
6097}
6098#endif
6099
6100#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6101/*
6102 * Return the maximum value from two arguments
6103 *
6104 * Suppored by API versions 9 - 19
6105 */
6106static ushort2 __attribute__((const, overloadable))max(ushort2 v1, ushort2 v2) {
6107 ushort2 tmp;
6108 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6109 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6110 return tmp;
6111}
6112#endif
6113
6114#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6115/*
6116 * Return the maximum value from two arguments
6117 *
6118 * Suppored by API versions 9 - 19
6119 */
6120static int2 __attribute__((const, overloadable))max(int2 v1, int2 v2) {
6121 int2 tmp;
6122 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6123 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6124 return tmp;
6125}
6126#endif
6127
6128#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6129/*
6130 * Return the maximum value from two arguments
6131 *
6132 * Suppored by API versions 9 - 19
6133 */
6134static uint2 __attribute__((const, overloadable))max(uint2 v1, uint2 v2) {
6135 uint2 tmp;
6136 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6137 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6138 return tmp;
6139}
6140#endif
6141
6142#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6143/*
6144 * Return the maximum value from two arguments
6145 *
6146 * Suppored by API versions 9 - 19
6147 */
6148static char3 __attribute__((const, overloadable))max(char3 v1, char3 v2) {
6149 char3 tmp;
6150 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6151 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6152 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6153 return tmp;
6154}
6155#endif
6156
6157#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6158/*
6159 * Return the maximum value from two arguments
6160 *
6161 * Suppored by API versions 9 - 19
6162 */
6163static uchar3 __attribute__((const, overloadable))max(uchar3 v1, uchar3 v2) {
6164 uchar3 tmp;
6165 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6166 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6167 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6168 return tmp;
6169}
6170#endif
6171
6172#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6173/*
6174 * Return the maximum value from two arguments
6175 *
6176 * Suppored by API versions 9 - 19
6177 */
6178static short3 __attribute__((const, overloadable))max(short3 v1, short3 v2) {
6179 short3 tmp;
6180 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6181 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6182 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6183 return tmp;
6184}
6185#endif
6186
6187#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6188/*
6189 * Return the maximum value from two arguments
6190 *
6191 * Suppored by API versions 9 - 19
6192 */
6193static ushort3 __attribute__((const, overloadable))max(ushort3 v1, ushort3 v2) {
6194 ushort3 tmp;
6195 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6196 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6197 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6198 return tmp;
6199}
6200#endif
6201
6202#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6203/*
6204 * Return the maximum value from two arguments
6205 *
6206 * Suppored by API versions 9 - 19
6207 */
6208static int3 __attribute__((const, overloadable))max(int3 v1, int3 v2) {
6209 int3 tmp;
6210 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6211 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6212 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6213 return tmp;
6214}
6215#endif
6216
6217#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6218/*
6219 * Return the maximum value from two arguments
6220 *
6221 * Suppored by API versions 9 - 19
6222 */
6223static uint3 __attribute__((const, overloadable))max(uint3 v1, uint3 v2) {
6224 uint3 tmp;
6225 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6226 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6227 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6228 return tmp;
6229}
6230#endif
6231
6232#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6233/*
6234 * Return the maximum value from two arguments
6235 *
6236 * Suppored by API versions 9 - 19
6237 */
6238static char4 __attribute__((const, overloadable))max(char4 v1, char4 v2) {
6239 char4 tmp;
6240 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6241 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6242 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6243 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
6244 return tmp;
6245}
6246#endif
6247
6248#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6249/*
6250 * Return the maximum value from two arguments
6251 *
6252 * Suppored by API versions 9 - 19
6253 */
6254static uchar4 __attribute__((const, overloadable))max(uchar4 v1, uchar4 v2) {
6255 uchar4 tmp;
6256 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6257 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6258 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6259 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
6260 return tmp;
6261}
6262#endif
6263
6264#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6265/*
6266 * Return the maximum value from two arguments
6267 *
6268 * Suppored by API versions 9 - 19
6269 */
6270static short4 __attribute__((const, overloadable))max(short4 v1, short4 v2) {
6271 short4 tmp;
6272 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6273 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6274 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6275 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
6276 return tmp;
6277}
6278#endif
6279
6280#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6281/*
6282 * Return the maximum value from two arguments
6283 *
6284 * Suppored by API versions 9 - 19
6285 */
6286static ushort4 __attribute__((const, overloadable))max(ushort4 v1, ushort4 v2) {
6287 ushort4 tmp;
6288 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6289 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6290 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6291 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
6292 return tmp;
6293}
6294#endif
6295
6296#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6297/*
6298 * Return the maximum value from two arguments
6299 *
6300 * Suppored by API versions 9 - 19
6301 */
6302static int4 __attribute__((const, overloadable))max(int4 v1, int4 v2) {
6303 int4 tmp;
6304 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6305 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6306 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6307 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
6308 return tmp;
6309}
6310#endif
6311
6312#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
6313/*
6314 * Return the maximum value from two arguments
6315 *
6316 * Suppored by API versions 9 - 19
6317 */
6318static uint4 __attribute__((const, overloadable))max(uint4 v1, uint4 v2) {
6319 uint4 tmp;
6320 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
6321 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
6322 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
6323 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
6324 return tmp;
6325}
6326#endif
6327
6328#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6329/*
6330 * Return the maximum value from two arguments
6331 *
6332 * Supported by API versions 20 and newer.
6333 */
6334extern char __attribute__((const, overloadable))max(char v1, char v2);
6335#endif
6336
6337#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6338/*
6339 * Return the maximum value from two arguments
6340 *
6341 * Supported by API versions 20 and newer.
6342 */
6343extern char2 __attribute__((const, overloadable))max(char2 v1, char2 v2);
6344#endif
6345
6346#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6347/*
6348 * Return the maximum value from two arguments
6349 *
6350 * Supported by API versions 20 and newer.
6351 */
6352extern char3 __attribute__((const, overloadable))max(char3 v1, char3 v2);
6353#endif
6354
6355#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6356/*
6357 * Return the maximum value from two arguments
6358 *
6359 * Supported by API versions 20 and newer.
6360 */
6361extern char4 __attribute__((const, overloadable))max(char4 v1, char4 v2);
6362#endif
6363
6364#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6365/*
6366 * Return the maximum value from two arguments
6367 *
6368 * Supported by API versions 20 and newer.
6369 */
6370extern uchar __attribute__((const, overloadable))max(uchar v1, uchar v2);
6371#endif
6372
6373#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6374/*
6375 * Return the maximum value from two arguments
6376 *
6377 * Supported by API versions 20 and newer.
6378 */
6379extern uchar2 __attribute__((const, overloadable))max(uchar2 v1, uchar2 v2);
6380#endif
6381
6382#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6383/*
6384 * Return the maximum value from two arguments
6385 *
6386 * Supported by API versions 20 and newer.
6387 */
6388extern uchar3 __attribute__((const, overloadable))max(uchar3 v1, uchar3 v2);
6389#endif
6390
6391#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6392/*
6393 * Return the maximum value from two arguments
6394 *
6395 * Supported by API versions 20 and newer.
6396 */
6397extern uchar4 __attribute__((const, overloadable))max(uchar4 v1, uchar4 v2);
6398#endif
6399
6400#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6401/*
6402 * Return the maximum value from two arguments
6403 *
6404 * Supported by API versions 20 and newer.
6405 */
6406extern short __attribute__((const, overloadable))max(short v1, short v2);
6407#endif
6408
6409#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6410/*
6411 * Return the maximum value from two arguments
6412 *
6413 * Supported by API versions 20 and newer.
6414 */
6415extern short2 __attribute__((const, overloadable))max(short2 v1, short2 v2);
6416#endif
6417
6418#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6419/*
6420 * Return the maximum value from two arguments
6421 *
6422 * Supported by API versions 20 and newer.
6423 */
6424extern short3 __attribute__((const, overloadable))max(short3 v1, short3 v2);
6425#endif
6426
6427#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6428/*
6429 * Return the maximum value from two arguments
6430 *
6431 * Supported by API versions 20 and newer.
6432 */
6433extern short4 __attribute__((const, overloadable))max(short4 v1, short4 v2);
6434#endif
6435
6436#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6437/*
6438 * Return the maximum value from two arguments
6439 *
6440 * Supported by API versions 20 and newer.
6441 */
6442extern ushort __attribute__((const, overloadable))max(ushort v1, ushort v2);
6443#endif
6444
6445#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6446/*
6447 * Return the maximum value from two arguments
6448 *
6449 * Supported by API versions 20 and newer.
6450 */
6451extern ushort2 __attribute__((const, overloadable))max(ushort2 v1, ushort2 v2);
6452#endif
6453
6454#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6455/*
6456 * Return the maximum value from two arguments
6457 *
6458 * Supported by API versions 20 and newer.
6459 */
6460extern ushort3 __attribute__((const, overloadable))max(ushort3 v1, ushort3 v2);
6461#endif
6462
6463#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6464/*
6465 * Return the maximum value from two arguments
6466 *
6467 * Supported by API versions 20 and newer.
6468 */
6469extern ushort4 __attribute__((const, overloadable))max(ushort4 v1, ushort4 v2);
6470#endif
6471
6472#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6473/*
6474 * Return the maximum value from two arguments
6475 *
6476 * Supported by API versions 20 and newer.
6477 */
6478extern int __attribute__((const, overloadable))max(int v1, int v2);
6479#endif
6480
6481#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6482/*
6483 * Return the maximum value from two arguments
6484 *
6485 * Supported by API versions 20 and newer.
6486 */
6487extern int2 __attribute__((const, overloadable))max(int2 v1, int2 v2);
6488#endif
6489
6490#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6491/*
6492 * Return the maximum value from two arguments
6493 *
6494 * Supported by API versions 20 and newer.
6495 */
6496extern int3 __attribute__((const, overloadable))max(int3 v1, int3 v2);
6497#endif
6498
6499#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6500/*
6501 * Return the maximum value from two arguments
6502 *
6503 * Supported by API versions 20 and newer.
6504 */
6505extern int4 __attribute__((const, overloadable))max(int4 v1, int4 v2);
6506#endif
6507
6508#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6509/*
6510 * Return the maximum value from two arguments
6511 *
6512 * Supported by API versions 20 and newer.
6513 */
6514extern uint __attribute__((const, overloadable))max(uint v1, uint v2);
6515#endif
6516
6517#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6518/*
6519 * Return the maximum value from two arguments
6520 *
6521 * Supported by API versions 20 and newer.
6522 */
6523extern uint2 __attribute__((const, overloadable))max(uint2 v1, uint2 v2);
6524#endif
6525
6526#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6527/*
6528 * Return the maximum value from two arguments
6529 *
6530 * Supported by API versions 20 and newer.
6531 */
6532extern uint3 __attribute__((const, overloadable))max(uint3 v1, uint3 v2);
6533#endif
6534
6535#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6536/*
6537 * Return the maximum value from two arguments
6538 *
6539 * Supported by API versions 20 and newer.
6540 */
6541extern uint4 __attribute__((const, overloadable))max(uint4 v1, uint4 v2);
6542#endif
6543
6544#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6545/*
6546 * Return the maximum value from two arguments
6547 *
6548 * Supported by API versions 20 and newer.
6549 */
6550extern long __attribute__((const, overloadable))max(long v1, long v2);
6551#endif
6552
6553#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6554/*
6555 * Return the maximum value from two arguments
6556 *
6557 * Supported by API versions 20 and newer.
6558 */
6559extern long2 __attribute__((const, overloadable))max(long2 v1, long2 v2);
6560#endif
6561
6562#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6563/*
6564 * Return the maximum value from two arguments
6565 *
6566 * Supported by API versions 20 and newer.
6567 */
6568extern long3 __attribute__((const, overloadable))max(long3 v1, long3 v2);
6569#endif
6570
6571#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6572/*
6573 * Return the maximum value from two arguments
6574 *
6575 * Supported by API versions 20 and newer.
6576 */
6577extern long4 __attribute__((const, overloadable))max(long4 v1, long4 v2);
6578#endif
6579
6580#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6581/*
6582 * Return the maximum value from two arguments
6583 *
6584 * Supported by API versions 20 and newer.
6585 */
6586extern ulong __attribute__((const, overloadable))max(ulong v1, ulong v2);
6587#endif
6588
6589#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6590/*
6591 * Return the maximum value from two arguments
6592 *
6593 * Supported by API versions 20 and newer.
6594 */
6595extern ulong2 __attribute__((const, overloadable))max(ulong2 v1, ulong2 v2);
6596#endif
6597
6598#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6599/*
6600 * Return the maximum value from two arguments
6601 *
6602 * Supported by API versions 20 and newer.
6603 */
6604extern ulong3 __attribute__((const, overloadable))max(ulong3 v1, ulong3 v2);
6605#endif
6606
6607#if (defined(RS_VERSION) && (RS_VERSION >= 20))
6608/*
6609 * Return the maximum value from two arguments
6610 *
6611 * Supported by API versions 20 and newer.
6612 */
6613extern ulong4 __attribute__((const, overloadable))max(ulong4 v1, ulong4 v2);
6614#endif
6615
6616#if (defined(RS_VERSION) && (RS_VERSION >= 9))
6617/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006618 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006619 *
6620 * Supported by API versions 9 and newer.
6621 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006622extern float __attribute__((const, overloadable))min(float, float);
Jason Sams29087fa2014-01-09 17:06:17 -08006623#endif
6624
6625#if (defined(RS_VERSION) && (RS_VERSION >= 9))
6626/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006627 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006628 *
6629 * Supported by API versions 9 and newer.
6630 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006631extern float2 __attribute__((const, overloadable))min(float2, float2);
Jason Sams29087fa2014-01-09 17:06:17 -08006632#endif
6633
6634#if (defined(RS_VERSION) && (RS_VERSION >= 9))
6635/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006636 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006637 *
6638 * Supported by API versions 9 and newer.
6639 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006640extern float3 __attribute__((const, overloadable))min(float3, float3);
Jason Sams29087fa2014-01-09 17:06:17 -08006641#endif
6642
6643#if (defined(RS_VERSION) && (RS_VERSION >= 9))
6644/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006645 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006646 *
6647 * Supported by API versions 9 and newer.
6648 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006649extern float4 __attribute__((const, overloadable))min(float4, float4);
Jason Sams29087fa2014-01-09 17:06:17 -08006650#endif
6651
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006652#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006653/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006654 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006655 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006656 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006657 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006658static char __attribute__((const, overloadable))min(char v1, char v2) {
6659 return (v1 < v2 ? v1 : v2);
6660}
Jason Sams29087fa2014-01-09 17:06:17 -08006661#endif
6662
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006663#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006664/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006665 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006666 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006667 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006668 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006669static uchar __attribute__((const, overloadable))min(uchar v1, uchar v2) {
6670 return (v1 < v2 ? v1 : v2);
6671}
Jason Sams29087fa2014-01-09 17:06:17 -08006672#endif
6673
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006674#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006675/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006676 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006677 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006678 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006679 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006680static short __attribute__((const, overloadable))min(short v1, short v2) {
6681 return (v1 < v2 ? v1 : v2);
6682}
Jason Sams29087fa2014-01-09 17:06:17 -08006683#endif
6684
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006685#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006686/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006687 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006688 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006689 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006690 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006691static ushort __attribute__((const, overloadable))min(ushort v1, ushort v2) {
6692 return (v1 < v2 ? v1 : v2);
6693}
Jason Sams29087fa2014-01-09 17:06:17 -08006694#endif
6695
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006696#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006697/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006698 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006699 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006700 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006701 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006702static int __attribute__((const, overloadable))min(int v1, int v2) {
6703 return (v1 < v2 ? v1 : v2);
6704}
Jason Sams29087fa2014-01-09 17:06:17 -08006705#endif
6706
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006707#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006708/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006709 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006710 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006711 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006712 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006713static uint __attribute__((const, overloadable))min(uint v1, uint v2) {
6714 return (v1 < v2 ? v1 : v2);
6715}
Jason Sams29087fa2014-01-09 17:06:17 -08006716#endif
6717
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006718#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006719/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006720 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006721 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006722 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006723 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006724static char2 __attribute__((const, overloadable))min(char2 v1, char2 v2) {
6725 char2 tmp;
6726 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6727 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6728 return tmp;
6729}
Jason Sams29087fa2014-01-09 17:06:17 -08006730#endif
6731
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006732#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006733/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006734 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006735 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006736 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006737 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006738static uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2) {
6739 uchar2 tmp;
6740 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6741 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6742 return tmp;
6743}
Jason Sams29087fa2014-01-09 17:06:17 -08006744#endif
6745
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006746#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006747/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006748 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006749 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006750 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006751 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006752static short2 __attribute__((const, overloadable))min(short2 v1, short2 v2) {
6753 short2 tmp;
6754 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6755 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6756 return tmp;
6757}
Jason Sams29087fa2014-01-09 17:06:17 -08006758#endif
6759
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006760#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006761/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006762 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006763 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006764 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006765 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006766static ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2) {
6767 ushort2 tmp;
6768 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6769 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6770 return tmp;
6771}
Jason Sams29087fa2014-01-09 17:06:17 -08006772#endif
6773
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006774#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006775/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006776 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006777 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006778 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006779 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006780static int2 __attribute__((const, overloadable))min(int2 v1, int2 v2) {
6781 int2 tmp;
6782 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6783 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6784 return tmp;
6785}
Jason Sams29087fa2014-01-09 17:06:17 -08006786#endif
6787
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006788#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006789/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006790 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006791 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006792 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006793 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006794static uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2) {
6795 uint2 tmp;
6796 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6797 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6798 return tmp;
6799}
Jason Sams29087fa2014-01-09 17:06:17 -08006800#endif
6801
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006802#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006803/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006804 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006805 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006806 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006807 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006808static char3 __attribute__((const, overloadable))min(char3 v1, char3 v2) {
6809 char3 tmp;
6810 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6811 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6812 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6813 return tmp;
6814}
Jason Sams29087fa2014-01-09 17:06:17 -08006815#endif
6816
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006817#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006818/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006819 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006820 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006821 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006822 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006823static uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2) {
6824 uchar3 tmp;
6825 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6826 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6827 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6828 return tmp;
6829}
Jason Sams29087fa2014-01-09 17:06:17 -08006830#endif
6831
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006832#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006833/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006834 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006835 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006836 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006837 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006838static short3 __attribute__((const, overloadable))min(short3 v1, short3 v2) {
6839 short3 tmp;
6840 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6841 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6842 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6843 return tmp;
6844}
Jason Sams29087fa2014-01-09 17:06:17 -08006845#endif
6846
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006847#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006848/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006849 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006850 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006851 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006852 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006853static ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2) {
6854 ushort3 tmp;
6855 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6856 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6857 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6858 return tmp;
6859}
Jason Sams29087fa2014-01-09 17:06:17 -08006860#endif
6861
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006862#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006863/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006864 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006865 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006866 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006867 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006868static int3 __attribute__((const, overloadable))min(int3 v1, int3 v2) {
6869 int3 tmp;
6870 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6871 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6872 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6873 return tmp;
6874}
Jason Sams29087fa2014-01-09 17:06:17 -08006875#endif
6876
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006877#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006878/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006879 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006880 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006881 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006882 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006883static uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2) {
6884 uint3 tmp;
6885 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6886 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6887 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6888 return tmp;
6889}
Jason Sams29087fa2014-01-09 17:06:17 -08006890#endif
6891
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006892#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006893/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006894 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006895 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006896 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006897 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006898static char4 __attribute__((const, overloadable))min(char4 v1, char4 v2) {
6899 char4 tmp;
6900 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6901 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6902 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6903 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
6904 return tmp;
6905}
Jason Sams29087fa2014-01-09 17:06:17 -08006906#endif
6907
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006908#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006909/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006910 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006911 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006912 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006913 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006914static uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2) {
6915 uchar4 tmp;
6916 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6917 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6918 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6919 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
6920 return tmp;
6921}
Jason Sams29087fa2014-01-09 17:06:17 -08006922#endif
6923
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006924#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006925/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006926 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006927 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006928 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006929 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006930static short4 __attribute__((const, overloadable))min(short4 v1, short4 v2) {
6931 short4 tmp;
6932 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6933 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6934 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6935 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
6936 return tmp;
6937}
Jason Sams29087fa2014-01-09 17:06:17 -08006938#endif
6939
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006940#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006941/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006942 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006943 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006944 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006945 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006946static ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2) {
6947 ushort4 tmp;
6948 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6949 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6950 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6951 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
6952 return tmp;
6953}
Jason Sams29087fa2014-01-09 17:06:17 -08006954#endif
6955
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006956#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006957/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006958 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006959 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006960 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006961 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006962static int4 __attribute__((const, overloadable))min(int4 v1, int4 v2) {
6963 int4 tmp;
6964 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6965 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6966 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6967 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
6968 return tmp;
6969}
Jason Sams29087fa2014-01-09 17:06:17 -08006970#endif
6971
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006972#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jason Sams29087fa2014-01-09 17:06:17 -08006973/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006974 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006975 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006976 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08006977 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006978static uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2) {
6979 uint4 tmp;
6980 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
6981 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
6982 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
6983 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
6984 return tmp;
6985}
Jason Sams29087fa2014-01-09 17:06:17 -08006986#endif
6987
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006988#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08006989/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006990 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08006991 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006992 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08006993 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006994extern char __attribute__((const, overloadable))min(char v1, char v2);
Jason Sams29087fa2014-01-09 17:06:17 -08006995#endif
6996
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006997#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08006998/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006999 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007000 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007001 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007002 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007003extern char2 __attribute__((const, overloadable))min(char2 v1, char2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007004#endif
7005
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007006#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007007/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007008 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007009 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007010 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007011 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007012extern char3 __attribute__((const, overloadable))min(char3 v1, char3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007013#endif
7014
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007015#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007016/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007017 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007018 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007019 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007020 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007021extern char4 __attribute__((const, overloadable))min(char4 v1, char4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007022#endif
7023
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007024#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007025/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007026 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007027 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007028 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007029 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007030extern uchar __attribute__((const, overloadable))min(uchar v1, uchar v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007031#endif
7032
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007033#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007034/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007035 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007036 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007037 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007038 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007039extern uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007040#endif
7041
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007042#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007043/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007044 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007045 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007046 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007047 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007048extern uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007049#endif
7050
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007051#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007052/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007053 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007054 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007055 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007056 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007057extern uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007058#endif
7059
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007060#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007061/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007062 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007063 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007064 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007065 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007066extern short __attribute__((const, overloadable))min(short v1, short v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007067#endif
7068
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007069#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007070/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007071 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007072 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007073 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007074 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007075extern short2 __attribute__((const, overloadable))min(short2 v1, short2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007076#endif
7077
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007078#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007079/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007080 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007081 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007082 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007083 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007084extern short3 __attribute__((const, overloadable))min(short3 v1, short3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007085#endif
7086
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007087#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007088/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007089 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007090 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007091 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007092 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007093extern short4 __attribute__((const, overloadable))min(short4 v1, short4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007094#endif
7095
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007096#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007097/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007098 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007099 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007100 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007101 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007102extern ushort __attribute__((const, overloadable))min(ushort v1, ushort v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007103#endif
7104
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007105#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007106/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007107 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007108 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007109 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007110 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007111extern ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007112#endif
7113
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007114#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007115/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007116 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007117 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007118 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007119 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007120extern ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007121#endif
7122
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007123#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007124/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007125 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007126 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007127 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007128 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007129extern ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007130#endif
7131
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007132#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007133/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007134 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007135 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007136 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007137 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007138extern int __attribute__((const, overloadable))min(int v1, int v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007139#endif
7140
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007141#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007142/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007143 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007144 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007145 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007146 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007147extern int2 __attribute__((const, overloadable))min(int2 v1, int2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007148#endif
7149
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007150#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007151/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007152 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007153 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007154 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007155 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007156extern int3 __attribute__((const, overloadable))min(int3 v1, int3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007157#endif
7158
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007159#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007160/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007161 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007162 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007163 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007164 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007165extern int4 __attribute__((const, overloadable))min(int4 v1, int4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007166#endif
7167
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007168#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007169/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007170 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007171 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007172 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007173 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007174extern uint __attribute__((const, overloadable))min(uint v1, uint v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007175#endif
7176
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007177#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007178/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007179 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007180 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007181 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007182 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007183extern uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007184#endif
7185
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007186#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007187/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007188 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007189 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007190 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007191 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007192extern uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007193#endif
7194
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007195#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007196/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007197 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007198 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007199 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007200 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007201extern uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007202#endif
7203
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007204#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007205/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007206 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007207 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007208 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007209 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007210extern long __attribute__((const, overloadable))min(long v1, long v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007211#endif
7212
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007213#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007214/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007215 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007216 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007217 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007218 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007219extern long2 __attribute__((const, overloadable))min(long2 v1, long2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007220#endif
7221
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007222#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007223/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007224 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007225 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007226 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007227 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007228extern long3 __attribute__((const, overloadable))min(long3 v1, long3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007229#endif
7230
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007231#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007232/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007233 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007234 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007235 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007236 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007237extern long4 __attribute__((const, overloadable))min(long4 v1, long4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007238#endif
7239
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007240#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007241/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007242 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007243 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007244 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007245 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007246extern ulong __attribute__((const, overloadable))min(ulong v1, ulong v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007247#endif
7248
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007249#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007250/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007251 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007252 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007253 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007254 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007255extern ulong2 __attribute__((const, overloadable))min(ulong2 v1, ulong2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007256#endif
7257
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007258#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007259/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007260 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007261 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007262 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007263 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007264extern ulong3 __attribute__((const, overloadable))min(ulong3 v1, ulong3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007265#endif
7266
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007267#if (defined(RS_VERSION) && (RS_VERSION >= 20))
Jason Sams29087fa2014-01-09 17:06:17 -08007268/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007269 * Return the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007270 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007271 * Supported by API versions 20 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08007272 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007273extern ulong4 __attribute__((const, overloadable))min(ulong4 v1, ulong4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08007274#endif
7275
7276#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7277/*
7278 * return start + ((stop - start) * amount)
7279 *
7280 * Supported by API versions 9 and newer.
7281 */
7282extern float __attribute__((const, overloadable))mix(float start, float stop, float amount);
7283#endif
7284
7285#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7286/*
7287 * return start + ((stop - start) * amount)
7288 *
7289 * Supported by API versions 9 and newer.
7290 */
7291extern float2 __attribute__((const, overloadable))mix(float2 start, float2 stop, float2 amount);
7292#endif
7293
7294#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7295/*
7296 * return start + ((stop - start) * amount)
7297 *
7298 * Supported by API versions 9 and newer.
7299 */
7300extern float3 __attribute__((const, overloadable))mix(float3 start, float3 stop, float3 amount);
7301#endif
7302
7303#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7304/*
7305 * return start + ((stop - start) * amount)
7306 *
7307 * Supported by API versions 9 and newer.
7308 */
7309extern float4 __attribute__((const, overloadable))mix(float4 start, float4 stop, float4 amount);
7310#endif
7311
7312#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7313/*
7314 * return start + ((stop - start) * amount)
7315 *
7316 * Supported by API versions 9 and newer.
7317 */
Jason Sams29087fa2014-01-09 17:06:17 -08007318extern float2 __attribute__((const, overloadable))mix(float2 start, float2 stop, float amount);
7319#endif
7320
7321#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7322/*
7323 * return start + ((stop - start) * amount)
7324 *
7325 * Supported by API versions 9 and newer.
7326 */
7327extern float3 __attribute__((const, overloadable))mix(float3 start, float3 stop, float amount);
7328#endif
7329
7330#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7331/*
7332 * return start + ((stop - start) * amount)
7333 *
7334 * Supported by API versions 9 and newer.
7335 */
7336extern float4 __attribute__((const, overloadable))mix(float4 start, float4 stop, float amount);
7337#endif
7338
7339#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7340/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007341 * Return the integral and fractional components of a number.
7342 *
7343 * @param x Source value
7344 * @param iret iret[0] will be set to the integral portion of the number.
7345 * @return The floating point portion of the value.
7346 *
7347 * Supported by API versions 9 and newer.
7348 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08007349extern float __attribute__((overloadable))modf(float x, float* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007350#endif
7351
7352#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7353/*
7354 * Return the integral and fractional components of a number.
7355 *
7356 * @param x Source value
7357 * @param iret iret[0] will be set to the integral portion of the number.
7358 * @return The floating point portion of the value.
7359 *
7360 * Supported by API versions 9 and newer.
7361 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08007362extern float2 __attribute__((overloadable))modf(float2 x, float2* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007363#endif
7364
7365#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7366/*
7367 * Return the integral and fractional components of a number.
7368 *
7369 * @param x Source value
7370 * @param iret iret[0] will be set to the integral portion of the number.
7371 * @return The floating point portion of the value.
7372 *
7373 * Supported by API versions 9 and newer.
7374 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08007375extern float3 __attribute__((overloadable))modf(float3 x, float3* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007376#endif
7377
7378#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7379/*
7380 * Return the integral and fractional components of a number.
7381 *
7382 * @param x Source value
7383 * @param iret iret[0] will be set to the integral portion of the number.
7384 * @return The floating point portion of the value.
7385 *
7386 * Supported by API versions 9 and newer.
7387 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08007388extern float4 __attribute__((overloadable))modf(float4 x, float4* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007389#endif
7390
7391#if (defined(RS_VERSION) && (RS_VERSION >= 9))
7392/*
7393 * generate a nan
7394 *
7395 * Supported by API versions 9 and newer.
7396 */
7397extern float __attribute__((const, overloadable))nan(uint);
7398#endif
7399
Jason Samsa140d9d2014-07-17 18:41:25 -07007400#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7401/*
7402 * acos
7403 *
7404 * Supported by API versions 21 and newer.
7405 */
7406extern float __attribute__((const, overloadable))native_acos(float v);
7407#endif
7408
7409#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7410/*
7411 * acos
7412 *
7413 * Supported by API versions 21 and newer.
7414 */
7415extern float2 __attribute__((const, overloadable))native_acos(float2 v);
7416#endif
7417
7418#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7419/*
7420 * acos
7421 *
7422 * Supported by API versions 21 and newer.
7423 */
7424extern float3 __attribute__((const, overloadable))native_acos(float3 v);
7425#endif
7426
7427#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7428/*
7429 * acos
7430 *
7431 * Supported by API versions 21 and newer.
7432 */
7433extern float4 __attribute__((const, overloadable))native_acos(float4 v);
7434#endif
7435
7436#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7437/*
7438 * acosh
7439 *
7440 * Supported by API versions 21 and newer.
7441 */
7442extern float __attribute__((const, overloadable))native_acosh(float);
7443#endif
7444
7445#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7446/*
7447 * acosh
7448 *
7449 * Supported by API versions 21 and newer.
7450 */
7451extern float2 __attribute__((const, overloadable))native_acosh(float2);
7452#endif
7453
7454#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7455/*
7456 * acosh
7457 *
7458 * Supported by API versions 21 and newer.
7459 */
7460extern float3 __attribute__((const, overloadable))native_acosh(float3);
7461#endif
7462
7463#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7464/*
7465 * acosh
7466 *
7467 * Supported by API versions 21 and newer.
7468 */
7469extern float4 __attribute__((const, overloadable))native_acosh(float4);
7470#endif
7471
7472#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7473/*
7474 * acospi
7475 *
7476 * Supported by API versions 21 and newer.
7477 */
7478extern float __attribute__((const, overloadable))native_acospi(float v);
7479#endif
7480
7481#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7482/*
7483 * acospi
7484 *
7485 * Supported by API versions 21 and newer.
7486 */
7487extern float2 __attribute__((const, overloadable))native_acospi(float2 v);
7488#endif
7489
7490#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7491/*
7492 * acospi
7493 *
7494 * Supported by API versions 21 and newer.
7495 */
7496extern float3 __attribute__((const, overloadable))native_acospi(float3 v);
7497#endif
7498
7499#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7500/*
7501 * acospi
7502 *
7503 * Supported by API versions 21 and newer.
7504 */
7505extern float4 __attribute__((const, overloadable))native_acospi(float4 v);
7506#endif
7507
7508#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7509/*
7510 * asin
7511 *
7512 * Supported by API versions 21 and newer.
7513 */
7514extern float __attribute__((const, overloadable))native_asin(float v);
7515#endif
7516
7517#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7518/*
7519 * asin
7520 *
7521 * Supported by API versions 21 and newer.
7522 */
7523extern float2 __attribute__((const, overloadable))native_asin(float2 v);
7524#endif
7525
7526#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7527/*
7528 * asin
7529 *
7530 * Supported by API versions 21 and newer.
7531 */
7532extern float3 __attribute__((const, overloadable))native_asin(float3 v);
7533#endif
7534
7535#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7536/*
7537 * asin
7538 *
7539 * Supported by API versions 21 and newer.
7540 */
7541extern float4 __attribute__((const, overloadable))native_asin(float4 v);
7542#endif
7543
7544#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7545/*
7546 * asinh
7547 *
7548 * Supported by API versions 21 and newer.
7549 */
7550extern float __attribute__((const, overloadable))native_asinh(float);
7551#endif
7552
7553#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7554/*
7555 * asinh
7556 *
7557 * Supported by API versions 21 and newer.
7558 */
7559extern float2 __attribute__((const, overloadable))native_asinh(float2);
7560#endif
7561
7562#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7563/*
7564 * asinh
7565 *
7566 * Supported by API versions 21 and newer.
7567 */
7568extern float3 __attribute__((const, overloadable))native_asinh(float3);
7569#endif
7570
7571#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7572/*
7573 * asinh
7574 *
7575 * Supported by API versions 21 and newer.
7576 */
7577extern float4 __attribute__((const, overloadable))native_asinh(float4);
7578#endif
7579
7580#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7581/*
7582 * Return the inverse sine divided by PI.
7583 *
7584 * Supported by API versions 21 and newer.
7585 */
7586extern float __attribute__((const, overloadable))native_asinpi(float v);
7587#endif
7588
7589#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7590/*
7591 * Return the inverse sine divided by PI.
7592 *
7593 * Supported by API versions 21 and newer.
7594 */
7595extern float2 __attribute__((const, overloadable))native_asinpi(float2 v);
7596#endif
7597
7598#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7599/*
7600 * Return the inverse sine divided by PI.
7601 *
7602 * Supported by API versions 21 and newer.
7603 */
7604extern float3 __attribute__((const, overloadable))native_asinpi(float3 v);
7605#endif
7606
7607#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7608/*
7609 * Return the inverse sine divided by PI.
7610 *
7611 * Supported by API versions 21 and newer.
7612 */
7613extern float4 __attribute__((const, overloadable))native_asinpi(float4 v);
7614#endif
7615
7616#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7617/*
7618 * Return the inverse tangent.
7619 *
7620 * Supported by API versions 21 and newer.
7621 */
7622extern float __attribute__((const, overloadable))native_atan(float v);
7623#endif
7624
7625#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7626/*
7627 * Return the inverse tangent.
7628 *
7629 * Supported by API versions 21 and newer.
7630 */
7631extern float2 __attribute__((const, overloadable))native_atan(float2 v);
7632#endif
7633
7634#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7635/*
7636 * Return the inverse tangent.
7637 *
7638 * Supported by API versions 21 and newer.
7639 */
7640extern float3 __attribute__((const, overloadable))native_atan(float3 v);
7641#endif
7642
7643#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7644/*
7645 * Return the inverse tangent.
7646 *
7647 * Supported by API versions 21 and newer.
7648 */
7649extern float4 __attribute__((const, overloadable))native_atan(float4 v);
7650#endif
7651
7652#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7653/*
7654 * Return the inverse tangent of y / x.
7655 *
7656 * Supported by API versions 21 and newer.
7657 */
7658extern float __attribute__((const, overloadable))native_atan2(float y, float x);
7659#endif
7660
7661#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7662/*
7663 * Return the inverse tangent of y / x.
7664 *
7665 * Supported by API versions 21 and newer.
7666 */
7667extern float2 __attribute__((const, overloadable))native_atan2(float2 y, float2 x);
7668#endif
7669
7670#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7671/*
7672 * Return the inverse tangent of y / x.
7673 *
7674 * Supported by API versions 21 and newer.
7675 */
7676extern float3 __attribute__((const, overloadable))native_atan2(float3 y, float3 x);
7677#endif
7678
7679#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7680/*
7681 * Return the inverse tangent of y / x.
7682 *
7683 * Supported by API versions 21 and newer.
7684 */
7685extern float4 __attribute__((const, overloadable))native_atan2(float4 y, float4 x);
7686#endif
7687
7688#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7689/*
7690 * Return the inverse tangent of y / x, divided by PI.
7691 *
7692 * Supported by API versions 21 and newer.
7693 */
7694extern float __attribute__((const, overloadable))native_atan2pi(float y, float x);
7695#endif
7696
7697#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7698/*
7699 * Return the inverse tangent of y / x, divided by PI.
7700 *
7701 * Supported by API versions 21 and newer.
7702 */
7703extern float2 __attribute__((const, overloadable))native_atan2pi(float2 y, float2 x);
7704#endif
7705
7706#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7707/*
7708 * Return the inverse tangent of y / x, divided by PI.
7709 *
7710 * Supported by API versions 21 and newer.
7711 */
7712extern float3 __attribute__((const, overloadable))native_atan2pi(float3 y, float3 x);
7713#endif
7714
7715#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7716/*
7717 * Return the inverse tangent of y / x, divided by PI.
7718 *
7719 * Supported by API versions 21 and newer.
7720 */
7721extern float4 __attribute__((const, overloadable))native_atan2pi(float4 y, float4 x);
7722#endif
7723
7724#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7725/*
7726 * Return the inverse hyperbolic tangent.
7727 *
7728 * Supported by API versions 21 and newer.
7729 */
7730extern float __attribute__((const, overloadable))native_atanh(float);
7731#endif
7732
7733#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7734/*
7735 * Return the inverse hyperbolic tangent.
7736 *
7737 * Supported by API versions 21 and newer.
7738 */
7739extern float2 __attribute__((const, overloadable))native_atanh(float2);
7740#endif
7741
7742#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7743/*
7744 * Return the inverse hyperbolic tangent.
7745 *
7746 * Supported by API versions 21 and newer.
7747 */
7748extern float3 __attribute__((const, overloadable))native_atanh(float3);
7749#endif
7750
7751#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7752/*
7753 * Return the inverse hyperbolic tangent.
7754 *
7755 * Supported by API versions 21 and newer.
7756 */
7757extern float4 __attribute__((const, overloadable))native_atanh(float4);
7758#endif
7759
7760#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7761/*
7762 * Return the inverse tangent divided by PI.
7763 *
7764 * Supported by API versions 21 and newer.
7765 */
7766extern float __attribute__((const, overloadable))native_atanpi(float v);
7767#endif
7768
7769#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7770/*
7771 * Return the inverse tangent divided by PI.
7772 *
7773 * Supported by API versions 21 and newer.
7774 */
7775extern float2 __attribute__((const, overloadable))native_atanpi(float2 v);
7776#endif
7777
7778#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7779/*
7780 * Return the inverse tangent divided by PI.
7781 *
7782 * Supported by API versions 21 and newer.
7783 */
7784extern float3 __attribute__((const, overloadable))native_atanpi(float3 v);
7785#endif
7786
7787#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7788/*
7789 * Return the inverse tangent divided by PI.
7790 *
7791 * Supported by API versions 21 and newer.
7792 */
7793extern float4 __attribute__((const, overloadable))native_atanpi(float4 v);
7794#endif
7795
7796#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7797/*
7798 * Return the cube root.
7799 *
7800 * Supported by API versions 21 and newer.
7801 */
7802extern float __attribute__((const, overloadable))native_cbrt(float);
7803#endif
7804
7805#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7806/*
7807 * Return the cube root.
7808 *
7809 * Supported by API versions 21 and newer.
7810 */
7811extern float2 __attribute__((const, overloadable))native_cbrt(float2);
7812#endif
7813
7814#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7815/*
7816 * Return the cube root.
7817 *
7818 * Supported by API versions 21 and newer.
7819 */
7820extern float3 __attribute__((const, overloadable))native_cbrt(float3);
7821#endif
7822
7823#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7824/*
7825 * Return the cube root.
7826 *
7827 * Supported by API versions 21 and newer.
7828 */
7829extern float4 __attribute__((const, overloadable))native_cbrt(float4);
7830#endif
7831
7832#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7833/*
7834 * Return the cosine.
7835 *
7836 * Supported by API versions 21 and newer.
7837 */
7838extern float __attribute__((const, overloadable))native_cos(float);
7839#endif
7840
7841#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7842/*
7843 * Return the cosine.
7844 *
7845 * Supported by API versions 21 and newer.
7846 */
7847extern float2 __attribute__((const, overloadable))native_cos(float2);
7848#endif
7849
7850#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7851/*
7852 * Return the cosine.
7853 *
7854 * Supported by API versions 21 and newer.
7855 */
7856extern float3 __attribute__((const, overloadable))native_cos(float3);
7857#endif
7858
7859#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7860/*
7861 * Return the cosine.
7862 *
7863 * Supported by API versions 21 and newer.
7864 */
7865extern float4 __attribute__((const, overloadable))native_cos(float4);
7866#endif
7867
7868#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7869/*
7870 * Return the hypebolic cosine.
7871 *
7872 * Supported by API versions 21 and newer.
7873 */
7874extern float __attribute__((const, overloadable))native_cosh(float);
7875#endif
7876
7877#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7878/*
7879 * Return the hypebolic cosine.
7880 *
7881 * Supported by API versions 21 and newer.
7882 */
7883extern float2 __attribute__((const, overloadable))native_cosh(float2);
7884#endif
7885
7886#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7887/*
7888 * Return the hypebolic cosine.
7889 *
7890 * Supported by API versions 21 and newer.
7891 */
7892extern float3 __attribute__((const, overloadable))native_cosh(float3);
7893#endif
7894
7895#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7896/*
7897 * Return the hypebolic cosine.
7898 *
7899 * Supported by API versions 21 and newer.
7900 */
7901extern float4 __attribute__((const, overloadable))native_cosh(float4);
7902#endif
7903
7904#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7905/*
7906 * Return the cosine of the value * PI.
7907 *
7908 * Supported by API versions 21 and newer.
7909 */
7910extern float __attribute__((const, overloadable))native_cospi(float);
7911#endif
7912
7913#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7914/*
7915 * Return the cosine of the value * PI.
7916 *
7917 * Supported by API versions 21 and newer.
7918 */
7919extern float2 __attribute__((const, overloadable))native_cospi(float2);
7920#endif
7921
7922#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7923/*
7924 * Return the cosine of the value * PI.
7925 *
7926 * Supported by API versions 21 and newer.
7927 */
7928extern float3 __attribute__((const, overloadable))native_cospi(float3);
7929#endif
7930
7931#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7932/*
7933 * Return the cosine of the value * PI.
7934 *
7935 * Supported by API versions 21 and newer.
7936 */
7937extern float4 __attribute__((const, overloadable))native_cospi(float4);
7938#endif
7939
7940#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7941/*
7942 * Compute the approximate distance between two points.
7943 *
7944 * Supported by API versions 21 and newer.
7945 */
7946extern float __attribute__((const, overloadable))native_distance(float lhs, float rhs);
7947#endif
7948
7949#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7950/*
7951 * Compute the approximate distance between two points.
7952 *
7953 * Supported by API versions 21 and newer.
7954 */
7955extern float __attribute__((const, overloadable))native_distance(float2 lhs, float2 rhs);
7956#endif
7957
7958#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7959/*
7960 * Compute the approximate distance between two points.
7961 *
7962 * Supported by API versions 21 and newer.
7963 */
7964extern float __attribute__((const, overloadable))native_distance(float3 lhs, float3 rhs);
7965#endif
7966
7967#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7968/*
7969 * Compute the approximate distance between two points.
7970 *
7971 * Supported by API versions 21 and newer.
7972 */
7973extern float __attribute__((const, overloadable))native_distance(float4 lhs, float4 rhs);
7974#endif
7975
7976#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7977/*
7978 * Compute the approximate division result of two values.
7979 *
7980 * Supported by API versions 21 and newer.
7981 */
7982extern float __attribute__((const, overloadable))native_divide(float lhs, float rhs);
7983#endif
7984
7985#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7986/*
7987 * Compute the approximate division result of two values.
7988 *
7989 * Supported by API versions 21 and newer.
7990 */
7991extern float2 __attribute__((const, overloadable))native_divide(float2 lhs, float2 rhs);
7992#endif
7993
7994#if (defined(RS_VERSION) && (RS_VERSION >= 21))
7995/*
7996 * Compute the approximate division result of two values.
7997 *
7998 * Supported by API versions 21 and newer.
7999 */
8000extern float3 __attribute__((const, overloadable))native_divide(float3 lhs, float3 rhs);
8001#endif
8002
8003#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8004/*
8005 * Compute the approximate division result of two values.
8006 *
8007 * Supported by API versions 21 and newer.
8008 */
8009extern float4 __attribute__((const, overloadable))native_divide(float4 lhs, float4 rhs);
8010#endif
8011
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008012#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8013/*
8014 * Fast approximate exp
8015 * valid for inputs -86.f to 86.f
8016 * Max 8192 ulps of error
8017 *
8018 * Supported by API versions 18 and newer.
8019 */
8020extern float __attribute__((const, overloadable))native_exp(float v);
8021#endif
8022
8023#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8024/*
8025 * Fast approximate exp
8026 * valid for inputs -86.f to 86.f
8027 * Max 8192 ulps of error
8028 *
8029 * Supported by API versions 18 and newer.
8030 */
8031extern float2 __attribute__((const, overloadable))native_exp(float2 v);
8032#endif
8033
8034#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8035/*
8036 * Fast approximate exp
8037 * valid for inputs -86.f to 86.f
8038 * Max 8192 ulps of error
8039 *
8040 * Supported by API versions 18 and newer.
8041 */
8042extern float3 __attribute__((const, overloadable))native_exp(float3 v);
8043#endif
8044
8045#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8046/*
8047 * Fast approximate exp
8048 * valid for inputs -86.f to 86.f
8049 * Max 8192 ulps of error
8050 *
8051 * Supported by API versions 18 and newer.
8052 */
8053extern float4 __attribute__((const, overloadable))native_exp(float4 v);
8054#endif
8055
8056#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8057/*
8058 * Fast approximate exp10
8059 * valid for inputs -37.f to 37.f
8060 * Max 8192 ulps of error
8061 *
8062 * Supported by API versions 18 and newer.
8063 */
8064extern float __attribute__((const, overloadable))native_exp10(float v);
8065#endif
8066
8067#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8068/*
8069 * Fast approximate exp10
8070 * valid for inputs -37.f to 37.f
8071 * Max 8192 ulps of error
8072 *
8073 * Supported by API versions 18 and newer.
8074 */
8075extern float2 __attribute__((const, overloadable))native_exp10(float2 v);
8076#endif
8077
8078#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8079/*
8080 * Fast approximate exp10
8081 * valid for inputs -37.f to 37.f
8082 * Max 8192 ulps of error
8083 *
8084 * Supported by API versions 18 and newer.
8085 */
8086extern float3 __attribute__((const, overloadable))native_exp10(float3 v);
8087#endif
8088
8089#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8090/*
8091 * Fast approximate exp10
8092 * valid for inputs -37.f to 37.f
8093 * Max 8192 ulps of error
8094 *
8095 * Supported by API versions 18 and newer.
8096 */
8097extern float4 __attribute__((const, overloadable))native_exp10(float4 v);
8098#endif
8099
8100#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8101/*
8102 * Fast approximate exp2
8103 * valid for inputs -125.f to 125.f
8104 * Max 8192 ulps of error
8105 *
8106 * Supported by API versions 18 and newer.
8107 */
8108extern float __attribute__((const, overloadable))native_exp2(float v);
8109#endif
8110
8111#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8112/*
8113 * Fast approximate exp2
8114 * valid for inputs -125.f to 125.f
8115 * Max 8192 ulps of error
8116 *
8117 * Supported by API versions 18 and newer.
8118 */
8119extern float2 __attribute__((const, overloadable))native_exp2(float2 v);
8120#endif
8121
8122#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8123/*
8124 * Fast approximate exp2
8125 * valid for inputs -125.f to 125.f
8126 * Max 8192 ulps of error
8127 *
8128 * Supported by API versions 18 and newer.
8129 */
8130extern float3 __attribute__((const, overloadable))native_exp2(float3 v);
8131#endif
8132
8133#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8134/*
8135 * Fast approximate exp2
8136 * valid for inputs -125.f to 125.f
8137 * Max 8192 ulps of error
8138 *
8139 * Supported by API versions 18 and newer.
8140 */
8141extern float4 __attribute__((const, overloadable))native_exp2(float4 v);
8142#endif
8143
Jason Samsa140d9d2014-07-17 18:41:25 -07008144#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8145/*
8146 * Return (e ^ value) - 1.
8147 *
8148 * Supported by API versions 21 and newer.
8149 */
8150extern float __attribute__((const, overloadable))native_expm1(float);
8151#endif
8152
8153#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8154/*
8155 * Return (e ^ value) - 1.
8156 *
8157 * Supported by API versions 21 and newer.
8158 */
8159extern float2 __attribute__((const, overloadable))native_expm1(float2);
8160#endif
8161
8162#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8163/*
8164 * Return (e ^ value) - 1.
8165 *
8166 * Supported by API versions 21 and newer.
8167 */
8168extern float3 __attribute__((const, overloadable))native_expm1(float3);
8169#endif
8170
8171#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8172/*
8173 * Return (e ^ value) - 1.
8174 *
8175 * Supported by API versions 21 and newer.
8176 */
8177extern float4 __attribute__((const, overloadable))native_expm1(float4);
8178#endif
8179
8180#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8181/*
8182 * Return native_sqrt(x*x + y*y)
8183 *
8184 * Supported by API versions 21 and newer.
8185 */
8186extern float __attribute__((const, overloadable))native_hypot(float x, float y);
8187#endif
8188
8189#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8190/*
8191 * Return native_sqrt(x*x + y*y)
8192 *
8193 * Supported by API versions 21 and newer.
8194 */
8195extern float2 __attribute__((const, overloadable))native_hypot(float2 x, float2 y);
8196#endif
8197
8198#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8199/*
8200 * Return native_sqrt(x*x + y*y)
8201 *
8202 * Supported by API versions 21 and newer.
8203 */
8204extern float3 __attribute__((const, overloadable))native_hypot(float3 x, float3 y);
8205#endif
8206
8207#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8208/*
8209 * Return native_sqrt(x*x + y*y)
8210 *
8211 * Supported by API versions 21 and newer.
8212 */
8213extern float4 __attribute__((const, overloadable))native_hypot(float4 x, float4 y);
8214#endif
8215
8216#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8217/*
8218 * Compute the approximate length of a vector.
8219 *
8220 * Supported by API versions 21 and newer.
8221 */
8222extern float __attribute__((const, overloadable))native_length(float v);
8223#endif
8224
8225#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8226/*
8227 * Compute the approximate length of a vector.
8228 *
8229 * Supported by API versions 21 and newer.
8230 */
8231extern float __attribute__((const, overloadable))native_length(float2 v);
8232#endif
8233
8234#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8235/*
8236 * Compute the approximate length of a vector.
8237 *
8238 * Supported by API versions 21 and newer.
8239 */
8240extern float __attribute__((const, overloadable))native_length(float3 v);
8241#endif
8242
8243#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8244/*
8245 * Compute the approximate length of a vector.
8246 *
8247 * Supported by API versions 21 and newer.
8248 */
8249extern float __attribute__((const, overloadable))native_length(float4 v);
8250#endif
8251
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008252#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8253/*
8254 * Fast approximate log
8255 *
8256 * Supported by API versions 18 and newer.
8257 */
8258extern float __attribute__((const, overloadable))native_log(float v);
8259#endif
8260
8261#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8262/*
8263 * Fast approximate log
8264 *
8265 * Supported by API versions 18 and newer.
8266 */
8267extern float2 __attribute__((const, overloadable))native_log(float2 v);
8268#endif
8269
8270#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8271/*
8272 * Fast approximate log
8273 *
8274 * Supported by API versions 18 and newer.
8275 */
8276extern float3 __attribute__((const, overloadable))native_log(float3 v);
8277#endif
8278
8279#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8280/*
8281 * Fast approximate log
8282 *
8283 * Supported by API versions 18 and newer.
8284 */
8285extern float4 __attribute__((const, overloadable))native_log(float4 v);
8286#endif
8287
8288#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8289/*
8290 * Fast approximate log10
8291 *
8292 * Supported by API versions 18 and newer.
8293 */
8294extern float __attribute__((const, overloadable))native_log10(float v);
8295#endif
8296
8297#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8298/*
8299 * Fast approximate log10
8300 *
8301 * Supported by API versions 18 and newer.
8302 */
8303extern float2 __attribute__((const, overloadable))native_log10(float2 v);
8304#endif
8305
8306#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8307/*
8308 * Fast approximate log10
8309 *
8310 * Supported by API versions 18 and newer.
8311 */
8312extern float3 __attribute__((const, overloadable))native_log10(float3 v);
8313#endif
8314
8315#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8316/*
8317 * Fast approximate log10
8318 *
8319 * Supported by API versions 18 and newer.
8320 */
8321extern float4 __attribute__((const, overloadable))native_log10(float4 v);
8322#endif
8323
Jason Samsa140d9d2014-07-17 18:41:25 -07008324#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8325/*
8326 * Return the natural logarithm of (v + 1.0f)
8327 *
8328 * Supported by API versions 21 and newer.
8329 */
8330extern float __attribute__((const, overloadable))native_log1p(float);
8331#endif
8332
8333#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8334/*
8335 * Return the natural logarithm of (v + 1.0f)
8336 *
8337 * Supported by API versions 21 and newer.
8338 */
8339extern float2 __attribute__((const, overloadable))native_log1p(float2);
8340#endif
8341
8342#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8343/*
8344 * Return the natural logarithm of (v + 1.0f)
8345 *
8346 * Supported by API versions 21 and newer.
8347 */
8348extern float3 __attribute__((const, overloadable))native_log1p(float3);
8349#endif
8350
8351#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8352/*
8353 * Return the natural logarithm of (v + 1.0f)
8354 *
8355 * Supported by API versions 21 and newer.
8356 */
8357extern float4 __attribute__((const, overloadable))native_log1p(float4);
8358#endif
8359
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008360#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8361/*
8362 * Fast approximate log2
8363 *
8364 * Supported by API versions 18 and newer.
8365 */
8366extern float __attribute__((const, overloadable))native_log2(float v);
8367#endif
8368
8369#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8370/*
8371 * Fast approximate log2
8372 *
8373 * Supported by API versions 18 and newer.
8374 */
8375extern float2 __attribute__((const, overloadable))native_log2(float2 v);
8376#endif
8377
8378#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8379/*
8380 * Fast approximate log2
8381 *
8382 * Supported by API versions 18 and newer.
8383 */
8384extern float3 __attribute__((const, overloadable))native_log2(float3 v);
8385#endif
8386
8387#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8388/*
8389 * Fast approximate log2
8390 *
8391 * Supported by API versions 18 and newer.
8392 */
8393extern float4 __attribute__((const, overloadable))native_log2(float4 v);
8394#endif
8395
Jason Samsa140d9d2014-07-17 18:41:25 -07008396#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8397/*
8398 * Normalize a vector.
8399 *
8400 * Supported by API versions 21 and newer.
8401 */
8402extern float __attribute__((const, overloadable))native_normalize(float v);
8403#endif
8404
8405#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8406/*
8407 * Normalize a vector.
8408 *
8409 * Supported by API versions 21 and newer.
8410 */
8411extern float2 __attribute__((const, overloadable))native_normalize(float2 v);
8412#endif
8413
8414#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8415/*
8416 * Normalize a vector.
8417 *
8418 * Supported by API versions 21 and newer.
8419 */
8420extern float3 __attribute__((const, overloadable))native_normalize(float3 v);
8421#endif
8422
8423#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8424/*
8425 * Normalize a vector.
8426 *
8427 * Supported by API versions 21 and newer.
8428 */
8429extern float4 __attribute__((const, overloadable))native_normalize(float4 v);
8430#endif
8431
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008432#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8433/*
8434 * Fast approximate v ^ y
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08008435 * v must be between 0.f and 256.f
8436 * y must be between -15.f and 15.f
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008437 *
8438 * Supported by API versions 18 and newer.
8439 */
8440extern float __attribute__((const, overloadable))native_powr(float v, float y);
8441#endif
8442
8443#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8444/*
8445 * Fast approximate v ^ y
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08008446 * v must be between 0.f and 256.f
8447 * y must be between -15.f and 15.f
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008448 *
8449 * Supported by API versions 18 and newer.
8450 */
8451extern float2 __attribute__((const, overloadable))native_powr(float2 v, float2 y);
8452#endif
8453
8454#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8455/*
8456 * Fast approximate v ^ y
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08008457 * v must be between 0.f and 256.f
8458 * y must be between -15.f and 15.f
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008459 *
8460 * Supported by API versions 18 and newer.
8461 */
8462extern float3 __attribute__((const, overloadable))native_powr(float3 v, float3 y);
8463#endif
8464
8465#if (defined(RS_VERSION) && (RS_VERSION >= 18))
8466/*
8467 * Fast approximate v ^ y
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08008468 * v must be between 0.f and 256.f
8469 * y must be between -15.f and 15.f
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008470 *
8471 * Supported by API versions 18 and newer.
8472 */
8473extern float4 __attribute__((const, overloadable))native_powr(float4 v, float4 y);
8474#endif
8475
Jason Samsa140d9d2014-07-17 18:41:25 -07008476#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8477/*
8478 * Return the approximate reciprocal of a value.
8479 *
8480 * Supported by API versions 21 and newer.
8481 */
8482extern float __attribute__((const, overloadable))native_recip(float v);
8483#endif
8484
8485#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8486/*
8487 * Return the approximate reciprocal of a value.
8488 *
8489 * Supported by API versions 21 and newer.
8490 */
8491extern float2 __attribute__((const, overloadable))native_recip(float2 v);
8492#endif
8493
8494#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8495/*
8496 * Return the approximate reciprocal of a value.
8497 *
8498 * Supported by API versions 21 and newer.
8499 */
8500extern float3 __attribute__((const, overloadable))native_recip(float3 v);
8501#endif
8502
8503#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8504/*
8505 * Return the approximate reciprocal of a value.
8506 *
8507 * Supported by API versions 21 and newer.
8508 */
8509extern float4 __attribute__((const, overloadable))native_recip(float4 v);
8510#endif
8511
8512#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8513/*
8514 * Compute the Nth root of a value.
8515 *
8516 * Supported by API versions 21 and newer.
8517 */
8518extern float __attribute__((const, overloadable))native_rootn(float v, int n);
8519#endif
8520
8521#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8522/*
8523 * Compute the Nth root of a value.
8524 *
8525 * Supported by API versions 21 and newer.
8526 */
8527extern float2 __attribute__((const, overloadable))native_rootn(float2 v, int2 n);
8528#endif
8529
8530#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8531/*
8532 * Compute the Nth root of a value.
8533 *
8534 * Supported by API versions 21 and newer.
8535 */
8536extern float3 __attribute__((const, overloadable))native_rootn(float3 v, int3 n);
8537#endif
8538
8539#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8540/*
8541 * Compute the Nth root of a value.
8542 *
8543 * Supported by API versions 21 and newer.
8544 */
8545extern float4 __attribute__((const, overloadable))native_rootn(float4 v, int4 n);
8546#endif
8547
8548#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8549/*
8550 * Return (1 / sqrt(value)).
8551 *
8552 * Supported by API versions 21 and newer.
8553 */
8554extern float __attribute__((const, overloadable))native_rsqrt(float);
8555#endif
8556
8557#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8558/*
8559 * Return (1 / sqrt(value)).
8560 *
8561 * Supported by API versions 21 and newer.
8562 */
8563extern float2 __attribute__((const, overloadable))native_rsqrt(float2);
8564#endif
8565
8566#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8567/*
8568 * Return (1 / sqrt(value)).
8569 *
8570 * Supported by API versions 21 and newer.
8571 */
8572extern float3 __attribute__((const, overloadable))native_rsqrt(float3);
8573#endif
8574
8575#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8576/*
8577 * Return (1 / sqrt(value)).
8578 *
8579 * Supported by API versions 21 and newer.
8580 */
8581extern float4 __attribute__((const, overloadable))native_rsqrt(float4);
8582#endif
8583
8584#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8585/*
8586 * Return the sine of a value specified in radians.
8587 *
8588 * Supported by API versions 21 and newer.
8589 */
8590extern float __attribute__((const, overloadable))native_sin(float);
8591#endif
8592
8593#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8594/*
8595 * Return the sine of a value specified in radians.
8596 *
8597 * Supported by API versions 21 and newer.
8598 */
8599extern float2 __attribute__((const, overloadable))native_sin(float2);
8600#endif
8601
8602#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8603/*
8604 * Return the sine of a value specified in radians.
8605 *
8606 * Supported by API versions 21 and newer.
8607 */
8608extern float3 __attribute__((const, overloadable))native_sin(float3);
8609#endif
8610
8611#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8612/*
8613 * Return the sine of a value specified in radians.
8614 *
8615 * Supported by API versions 21 and newer.
8616 */
8617extern float4 __attribute__((const, overloadable))native_sin(float4);
8618#endif
8619
8620#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8621/*
8622 * Return the sine and cosine of a value.
8623 *
8624 * @return sine
8625 * @param v The incoming value in radians
8626 * @param *cosptr cosptr[0] will be set to the cosine value.
8627 *
8628 * Supported by API versions 21 and newer.
8629 */
8630extern float __attribute__((overloadable))native_sincos(float v, float* cosptr);
8631#endif
8632
8633#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8634/*
8635 * Return the sine and cosine of a value.
8636 *
8637 * @return sine
8638 * @param v The incoming value in radians
8639 * @param *cosptr cosptr[0] will be set to the cosine value.
8640 *
8641 * Supported by API versions 21 and newer.
8642 */
8643extern float2 __attribute__((overloadable))native_sincos(float2 v, float2* cosptr);
8644#endif
8645
8646#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8647/*
8648 * Return the sine and cosine of a value.
8649 *
8650 * @return sine
8651 * @param v The incoming value in radians
8652 * @param *cosptr cosptr[0] will be set to the cosine value.
8653 *
8654 * Supported by API versions 21 and newer.
8655 */
8656extern float3 __attribute__((overloadable))native_sincos(float3 v, float3* cosptr);
8657#endif
8658
8659#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8660/*
8661 * Return the sine and cosine of a value.
8662 *
8663 * @return sine
8664 * @param v The incoming value in radians
8665 * @param *cosptr cosptr[0] will be set to the cosine value.
8666 *
8667 * Supported by API versions 21 and newer.
8668 */
8669extern float4 __attribute__((overloadable))native_sincos(float4 v, float4* cosptr);
8670#endif
8671
8672#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8673/*
8674 * Return the hyperbolic sine of a value specified in radians.
8675 *
8676 * Supported by API versions 21 and newer.
8677 */
8678extern float __attribute__((const, overloadable))native_sinh(float);
8679#endif
8680
8681#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8682/*
8683 * Return the hyperbolic sine of a value specified in radians.
8684 *
8685 * Supported by API versions 21 and newer.
8686 */
8687extern float2 __attribute__((const, overloadable))native_sinh(float2);
8688#endif
8689
8690#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8691/*
8692 * Return the hyperbolic sine of a value specified in radians.
8693 *
8694 * Supported by API versions 21 and newer.
8695 */
8696extern float3 __attribute__((const, overloadable))native_sinh(float3);
8697#endif
8698
8699#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8700/*
8701 * Return the hyperbolic sine of a value specified in radians.
8702 *
8703 * Supported by API versions 21 and newer.
8704 */
8705extern float4 __attribute__((const, overloadable))native_sinh(float4);
8706#endif
8707
8708#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8709/*
8710 * Return the sin(v * PI).
8711 *
8712 * Supported by API versions 21 and newer.
8713 */
8714extern float __attribute__((const, overloadable))native_sinpi(float);
8715#endif
8716
8717#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8718/*
8719 * Return the sin(v * PI).
8720 *
8721 * Supported by API versions 21 and newer.
8722 */
8723extern float2 __attribute__((const, overloadable))native_sinpi(float2);
8724#endif
8725
8726#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8727/*
8728 * Return the sin(v * PI).
8729 *
8730 * Supported by API versions 21 and newer.
8731 */
8732extern float3 __attribute__((const, overloadable))native_sinpi(float3);
8733#endif
8734
8735#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8736/*
8737 * Return the sin(v * PI).
8738 *
8739 * Supported by API versions 21 and newer.
8740 */
8741extern float4 __attribute__((const, overloadable))native_sinpi(float4);
8742#endif
8743
8744#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8745/*
Jason Samsa140d9d2014-07-17 18:41:25 -07008746 * Return the aproximate sqrt(v).
8747 *
8748 * Supported by API versions 21 and newer.
8749 */
8750extern float __attribute__((const, overloadable))native_sqrt(float);
8751#endif
8752
8753#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8754/*
8755 * Return the aproximate sqrt(v).
8756 *
8757 * Supported by API versions 21 and newer.
8758 */
8759extern float2 __attribute__((const, overloadable))native_sqrt(float2);
8760#endif
8761
8762#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8763/*
8764 * Return the aproximate sqrt(v).
8765 *
8766 * Supported by API versions 21 and newer.
8767 */
8768extern float3 __attribute__((const, overloadable))native_sqrt(float3);
8769#endif
8770
8771#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8772/*
8773 * Return the aproximate sqrt(v).
8774 *
8775 * Supported by API versions 21 and newer.
8776 */
8777extern float4 __attribute__((const, overloadable))native_sqrt(float4);
8778#endif
8779
8780#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8781/*
8782 * Return the tangent of a value.
8783 *
8784 * Supported by API versions 21 and newer.
8785 */
8786extern float __attribute__((const, overloadable))native_tan(float);
8787#endif
8788
8789#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8790/*
8791 * Return the tangent of a value.
8792 *
8793 * Supported by API versions 21 and newer.
8794 */
8795extern float2 __attribute__((const, overloadable))native_tan(float2);
8796#endif
8797
8798#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8799/*
8800 * Return the tangent of a value.
8801 *
8802 * Supported by API versions 21 and newer.
8803 */
8804extern float3 __attribute__((const, overloadable))native_tan(float3);
8805#endif
8806
8807#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8808/*
8809 * Return the tangent of a value.
8810 *
8811 * Supported by API versions 21 and newer.
8812 */
8813extern float4 __attribute__((const, overloadable))native_tan(float4);
8814#endif
8815
8816#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8817/*
8818 * Return the hyperbolic tangent of a value.
8819 *
8820 * Supported by API versions 21 and newer.
8821 */
8822extern float __attribute__((const, overloadable))native_tanh(float);
8823#endif
8824
8825#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8826/*
8827 * Return the hyperbolic tangent of a value.
8828 *
8829 * Supported by API versions 21 and newer.
8830 */
8831extern float2 __attribute__((const, overloadable))native_tanh(float2);
8832#endif
8833
8834#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8835/*
8836 * Return the hyperbolic tangent of a value.
8837 *
8838 * Supported by API versions 21 and newer.
8839 */
8840extern float3 __attribute__((const, overloadable))native_tanh(float3);
8841#endif
8842
8843#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8844/*
8845 * Return the hyperbolic tangent of a value.
8846 *
8847 * Supported by API versions 21 and newer.
8848 */
8849extern float4 __attribute__((const, overloadable))native_tanh(float4);
8850#endif
8851
8852#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8853/*
8854 * Return tan(v * PI)
8855 *
8856 * Supported by API versions 21 and newer.
8857 */
8858extern float __attribute__((const, overloadable))native_tanpi(float);
8859#endif
8860
8861#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8862/*
8863 * Return tan(v * PI)
8864 *
8865 * Supported by API versions 21 and newer.
8866 */
8867extern float2 __attribute__((const, overloadable))native_tanpi(float2);
8868#endif
8869
8870#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8871/*
8872 * Return tan(v * PI)
8873 *
8874 * Supported by API versions 21 and newer.
8875 */
8876extern float3 __attribute__((const, overloadable))native_tanpi(float3);
8877#endif
8878
8879#if (defined(RS_VERSION) && (RS_VERSION >= 21))
8880/*
8881 * Return tan(v * PI)
8882 *
8883 * Supported by API versions 21 and newer.
8884 */
8885extern float4 __attribute__((const, overloadable))native_tanpi(float4);
8886#endif
8887
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008888#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8889/*
8890 * Return the next floating point number from x towards y.
8891 *
8892 * Supported by API versions 9 and newer.
8893 */
8894extern float __attribute__((const, overloadable))nextafter(float x, float y);
8895#endif
8896
8897#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8898/*
8899 * Return the next floating point number from x towards y.
8900 *
8901 * Supported by API versions 9 and newer.
8902 */
8903extern float2 __attribute__((const, overloadable))nextafter(float2 x, float2 y);
8904#endif
8905
8906#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8907/*
8908 * Return the next floating point number from x towards y.
8909 *
8910 * Supported by API versions 9 and newer.
8911 */
8912extern float3 __attribute__((const, overloadable))nextafter(float3 x, float3 y);
8913#endif
8914
8915#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8916/*
8917 * Return the next floating point number from x towards y.
8918 *
8919 * Supported by API versions 9 and newer.
8920 */
8921extern float4 __attribute__((const, overloadable))nextafter(float4 x, float4 y);
8922#endif
8923
8924#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8925/*
8926 * Normalize a vector.
8927 *
8928 * Supported by API versions 9 and newer.
8929 */
8930extern float __attribute__((const, overloadable))normalize(float v);
8931#endif
8932
8933#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8934/*
8935 * Normalize a vector.
8936 *
8937 * Supported by API versions 9 and newer.
8938 */
8939extern float2 __attribute__((const, overloadable))normalize(float2 v);
8940#endif
8941
8942#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8943/*
8944 * Normalize a vector.
8945 *
8946 * Supported by API versions 9 and newer.
8947 */
8948extern float3 __attribute__((const, overloadable))normalize(float3 v);
8949#endif
8950
8951#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8952/*
8953 * Normalize a vector.
8954 *
8955 * Supported by API versions 9 and newer.
8956 */
8957extern float4 __attribute__((const, overloadable))normalize(float4 v);
8958#endif
8959
8960#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8961/*
8962 * Return x ^ y.
8963 *
8964 * Supported by API versions 9 and newer.
8965 */
8966extern float __attribute__((const, overloadable))pow(float x, float y);
8967#endif
8968
8969#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8970/*
8971 * Return x ^ y.
8972 *
8973 * Supported by API versions 9 and newer.
8974 */
8975extern float2 __attribute__((const, overloadable))pow(float2 x, float2 y);
8976#endif
8977
8978#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8979/*
8980 * Return x ^ y.
8981 *
8982 * Supported by API versions 9 and newer.
8983 */
8984extern float3 __attribute__((const, overloadable))pow(float3 x, float3 y);
8985#endif
8986
8987#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8988/*
8989 * Return x ^ y.
8990 *
8991 * Supported by API versions 9 and newer.
8992 */
8993extern float4 __attribute__((const, overloadable))pow(float4 x, float4 y);
8994#endif
8995
8996#if (defined(RS_VERSION) && (RS_VERSION >= 9))
8997/*
8998 * Return x ^ y.
8999 *
9000 * Supported by API versions 9 and newer.
9001 */
9002extern float __attribute__((const, overloadable))pown(float x, int y);
9003#endif
9004
9005#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9006/*
9007 * Return x ^ y.
9008 *
9009 * Supported by API versions 9 and newer.
9010 */
9011extern float2 __attribute__((const, overloadable))pown(float2 x, int2 y);
9012#endif
9013
9014#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9015/*
9016 * Return x ^ y.
9017 *
9018 * Supported by API versions 9 and newer.
9019 */
9020extern float3 __attribute__((const, overloadable))pown(float3 x, int3 y);
9021#endif
9022
9023#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9024/*
9025 * Return x ^ y.
9026 *
9027 * Supported by API versions 9 and newer.
9028 */
9029extern float4 __attribute__((const, overloadable))pown(float4 x, int4 y);
9030#endif
9031
9032#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9033/*
9034 * Return x ^ y.
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009035 * x must be >= 0
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009036 *
9037 * Supported by API versions 9 and newer.
9038 */
9039extern float __attribute__((const, overloadable))powr(float x, float y);
9040#endif
9041
9042#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9043/*
9044 * Return x ^ y.
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009045 * x must be >= 0
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009046 *
9047 * Supported by API versions 9 and newer.
9048 */
9049extern float2 __attribute__((const, overloadable))powr(float2 x, float2 y);
9050#endif
9051
9052#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9053/*
9054 * Return x ^ y.
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009055 * x must be >= 0
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009056 *
9057 * Supported by API versions 9 and newer.
9058 */
9059extern float3 __attribute__((const, overloadable))powr(float3 x, float3 y);
9060#endif
9061
9062#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9063/*
9064 * Return x ^ y.
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009065 * x must be >= 0
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009066 *
9067 * Supported by API versions 9 and newer.
9068 */
9069extern float4 __attribute__((const, overloadable))powr(float4 x, float4 y);
9070#endif
9071
9072#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9073/*
Jason Sams29087fa2014-01-09 17:06:17 -08009074 * Convert from degrees to radians.
9075 *
9076 * Supported by API versions 9 and newer.
9077 */
9078extern float __attribute__((const, overloadable))radians(float value);
9079#endif
9080
9081#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9082/*
9083 * Convert from degrees to radians.
9084 *
9085 * Supported by API versions 9 and newer.
9086 */
9087extern float2 __attribute__((const, overloadable))radians(float2 value);
9088#endif
9089
9090#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9091/*
9092 * Convert from degrees to radians.
9093 *
9094 * Supported by API versions 9 and newer.
9095 */
9096extern float3 __attribute__((const, overloadable))radians(float3 value);
9097#endif
9098
9099#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9100/*
9101 * Convert from degrees to radians.
9102 *
9103 * Supported by API versions 9 and newer.
9104 */
9105extern float4 __attribute__((const, overloadable))radians(float4 value);
9106#endif
9107
9108#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9109/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009110 * Return round x/y to the nearest integer then compute the remainder.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009111 *
9112 * Supported by API versions 9 and newer.
9113 */
9114extern float __attribute__((const, overloadable))remainder(float x, float y);
9115#endif
9116
9117#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9118/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009119 * Return round x/y to the nearest integer then compute the remainder.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009120 *
9121 * Supported by API versions 9 and newer.
9122 */
9123extern float2 __attribute__((const, overloadable))remainder(float2 x, float2 y);
9124#endif
9125
9126#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9127/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009128 * Return round x/y to the nearest integer then compute the remainder.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009129 *
9130 * Supported by API versions 9 and newer.
9131 */
9132extern float3 __attribute__((const, overloadable))remainder(float3 x, float3 y);
9133#endif
9134
9135#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9136/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009137 * Return round x/y to the nearest integer then compute the remainder.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009138 *
9139 * Supported by API versions 9 and newer.
9140 */
9141extern float4 __attribute__((const, overloadable))remainder(float4 x, float4 y);
9142#endif
9143
9144#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9145/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009146 * Return the quotient and the remainder of b/c
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009147 *
9148 * Supported by API versions 9 and newer.
9149 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009150extern float __attribute__((overloadable))remquo(float b, float c, int* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009151#endif
9152
9153#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9154/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009155 * Return the quotient and the remainder of b/c
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009156 *
9157 * Supported by API versions 9 and newer.
9158 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009159extern float2 __attribute__((overloadable))remquo(float2 b, float2 c, int2* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009160#endif
9161
9162#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9163/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009164 * Return the quotient and the remainder of b/c
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009165 *
9166 * Supported by API versions 9 and newer.
9167 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009168extern float3 __attribute__((overloadable))remquo(float3 b, float3 c, int3* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009169#endif
9170
9171#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9172/*
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009173 * Return the quotient and the remainder of b/c
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009174 *
9175 * Supported by API versions 9 and newer.
9176 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009177extern float4 __attribute__((overloadable))remquo(float4 b, float4 c, int4* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009178#endif
9179
9180#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9181/*
9182 * Round to the nearest integral value.
9183 *
9184 * Supported by API versions 9 and newer.
9185 */
9186extern float __attribute__((const, overloadable))rint(float);
9187#endif
9188
9189#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9190/*
9191 * Round to the nearest integral value.
9192 *
9193 * Supported by API versions 9 and newer.
9194 */
9195extern float2 __attribute__((const, overloadable))rint(float2);
9196#endif
9197
9198#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9199/*
9200 * Round to the nearest integral value.
9201 *
9202 * Supported by API versions 9 and newer.
9203 */
9204extern float3 __attribute__((const, overloadable))rint(float3);
9205#endif
9206
9207#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9208/*
9209 * Round to the nearest integral value.
9210 *
9211 * Supported by API versions 9 and newer.
9212 */
9213extern float4 __attribute__((const, overloadable))rint(float4);
9214#endif
9215
9216#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9217/*
9218 * Compute the Nth root of a value.
9219 *
9220 * Supported by API versions 9 and newer.
9221 */
9222extern float __attribute__((const, overloadable))rootn(float v, int n);
9223#endif
9224
9225#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9226/*
9227 * Compute the Nth root of a value.
9228 *
9229 * Supported by API versions 9 and newer.
9230 */
9231extern float2 __attribute__((const, overloadable))rootn(float2 v, int2 n);
9232#endif
9233
9234#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9235/*
9236 * Compute the Nth root of a value.
9237 *
9238 * Supported by API versions 9 and newer.
9239 */
9240extern float3 __attribute__((const, overloadable))rootn(float3 v, int3 n);
9241#endif
9242
9243#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9244/*
9245 * Compute the Nth root of a value.
9246 *
9247 * Supported by API versions 9 and newer.
9248 */
9249extern float4 __attribute__((const, overloadable))rootn(float4 v, int4 n);
9250#endif
9251
9252#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9253/*
9254 * Round to the nearest integral value. Half values are rounded away from zero.
9255 *
9256 * Supported by API versions 9 and newer.
9257 */
9258extern float __attribute__((const, overloadable))round(float);
9259#endif
9260
9261#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9262/*
9263 * Round to the nearest integral value. Half values are rounded away from zero.
9264 *
9265 * Supported by API versions 9 and newer.
9266 */
9267extern float2 __attribute__((const, overloadable))round(float2);
9268#endif
9269
9270#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9271/*
9272 * Round to the nearest integral value. Half values are rounded away from zero.
9273 *
9274 * Supported by API versions 9 and newer.
9275 */
9276extern float3 __attribute__((const, overloadable))round(float3);
9277#endif
9278
9279#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9280/*
9281 * Round to the nearest integral value. Half values are rounded away from zero.
9282 *
9283 * Supported by API versions 9 and newer.
9284 */
9285extern float4 __attribute__((const, overloadable))round(float4);
9286#endif
9287
9288#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9289/*
9290 * Return (1 / sqrt(value)).
9291 *
9292 * Supported by API versions 9 and newer.
9293 */
9294extern float __attribute__((const, overloadable))rsqrt(float);
9295#endif
9296
9297#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9298/*
9299 * Return (1 / sqrt(value)).
9300 *
9301 * Supported by API versions 9 and newer.
9302 */
9303extern float2 __attribute__((const, overloadable))rsqrt(float2);
9304#endif
9305
9306#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9307/*
9308 * Return (1 / sqrt(value)).
9309 *
9310 * Supported by API versions 9 and newer.
9311 */
9312extern float3 __attribute__((const, overloadable))rsqrt(float3);
9313#endif
9314
9315#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9316/*
9317 * Return (1 / sqrt(value)).
9318 *
9319 * Supported by API versions 9 and newer.
9320 */
9321extern float4 __attribute__((const, overloadable))rsqrt(float4);
9322#endif
9323
9324#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9325/*
9326 * Return the sign of a value.
9327 *
9328 * if (v < 0) return -1.f;
9329 * else if (v > 0) return 1.f;
9330 * else return 0.f;
9331 *
9332 * Supported by API versions 9 and newer.
9333 */
9334extern float __attribute__((const, overloadable))sign(float v);
9335#endif
9336
9337#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9338/*
9339 * Return the sign of a value.
9340 *
9341 * if (v < 0) return -1.f;
9342 * else if (v > 0) return 1.f;
9343 * else return 0.f;
9344 *
9345 * Supported by API versions 9 and newer.
9346 */
9347extern float2 __attribute__((const, overloadable))sign(float2 v);
9348#endif
9349
9350#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9351/*
9352 * Return the sign of a value.
9353 *
9354 * if (v < 0) return -1.f;
9355 * else if (v > 0) return 1.f;
9356 * else return 0.f;
9357 *
9358 * Supported by API versions 9 and newer.
9359 */
9360extern float3 __attribute__((const, overloadable))sign(float3 v);
9361#endif
9362
9363#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9364/*
9365 * Return the sign of a value.
9366 *
9367 * if (v < 0) return -1.f;
9368 * else if (v > 0) return 1.f;
9369 * else return 0.f;
9370 *
9371 * Supported by API versions 9 and newer.
9372 */
9373extern float4 __attribute__((const, overloadable))sign(float4 v);
9374#endif
9375
9376#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9377/*
9378 * Return the sine of a value specified in radians.
9379 *
9380 * Supported by API versions 9 and newer.
9381 */
9382extern float __attribute__((const, overloadable))sin(float);
9383#endif
9384
9385#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9386/*
9387 * Return the sine of a value specified in radians.
9388 *
9389 * Supported by API versions 9 and newer.
9390 */
9391extern float2 __attribute__((const, overloadable))sin(float2);
9392#endif
9393
9394#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9395/*
9396 * Return the sine of a value specified in radians.
9397 *
9398 * Supported by API versions 9 and newer.
9399 */
9400extern float3 __attribute__((const, overloadable))sin(float3);
9401#endif
9402
9403#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9404/*
9405 * Return the sine of a value specified in radians.
9406 *
9407 * Supported by API versions 9 and newer.
9408 */
9409extern float4 __attribute__((const, overloadable))sin(float4);
9410#endif
9411
9412#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9413/*
9414 * Return the sine and cosine of a value.
9415 *
9416 * @return sine
9417 * @param v The incoming value in radians
9418 * @param *cosptr cosptr[0] will be set to the cosine value.
9419 *
9420 * Supported by API versions 9 and newer.
9421 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009422extern float __attribute__((overloadable))sincos(float v, float* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009423#endif
9424
9425#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9426/*
9427 * Return the sine and cosine of a value.
9428 *
9429 * @return sine
9430 * @param v The incoming value in radians
9431 * @param *cosptr cosptr[0] will be set to the cosine value.
9432 *
9433 * Supported by API versions 9 and newer.
9434 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009435extern float2 __attribute__((overloadable))sincos(float2 v, float2* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009436#endif
9437
9438#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9439/*
9440 * Return the sine and cosine of a value.
9441 *
9442 * @return sine
9443 * @param v The incoming value in radians
9444 * @param *cosptr cosptr[0] will be set to the cosine value.
9445 *
9446 * Supported by API versions 9 and newer.
9447 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009448extern float3 __attribute__((overloadable))sincos(float3 v, float3* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009449#endif
9450
9451#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9452/*
9453 * Return the sine and cosine of a value.
9454 *
9455 * @return sine
9456 * @param v The incoming value in radians
9457 * @param *cosptr cosptr[0] will be set to the cosine value.
9458 *
9459 * Supported by API versions 9 and newer.
9460 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009461extern float4 __attribute__((overloadable))sincos(float4 v, float4* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009462#endif
9463
9464#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9465/*
9466 * Return the hyperbolic sine of a value specified in radians.
9467 *
9468 * Supported by API versions 9 and newer.
9469 */
9470extern float __attribute__((const, overloadable))sinh(float);
9471#endif
9472
9473#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9474/*
9475 * Return the hyperbolic sine of a value specified in radians.
9476 *
9477 * Supported by API versions 9 and newer.
9478 */
9479extern float2 __attribute__((const, overloadable))sinh(float2);
9480#endif
9481
9482#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9483/*
9484 * Return the hyperbolic sine of a value specified in radians.
9485 *
9486 * Supported by API versions 9 and newer.
9487 */
9488extern float3 __attribute__((const, overloadable))sinh(float3);
9489#endif
9490
9491#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9492/*
9493 * Return the hyperbolic sine of a value specified in radians.
9494 *
9495 * Supported by API versions 9 and newer.
9496 */
9497extern float4 __attribute__((const, overloadable))sinh(float4);
9498#endif
9499
9500#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9501/*
9502 * Return the sin(v * PI).
9503 *
9504 * Supported by API versions 9 and newer.
9505 */
9506extern float __attribute__((const, overloadable))sinpi(float);
9507#endif
9508
9509#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9510/*
9511 * Return the sin(v * PI).
9512 *
9513 * Supported by API versions 9 and newer.
9514 */
9515extern float2 __attribute__((const, overloadable))sinpi(float2);
9516#endif
9517
9518#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9519/*
9520 * Return the sin(v * PI).
9521 *
9522 * Supported by API versions 9 and newer.
9523 */
9524extern float3 __attribute__((const, overloadable))sinpi(float3);
9525#endif
9526
9527#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9528/*
9529 * Return the sin(v * PI).
9530 *
9531 * Supported by API versions 9 and newer.
9532 */
9533extern float4 __attribute__((const, overloadable))sinpi(float4);
9534#endif
9535
9536#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9537/*
9538 * Return the square root of a value.
9539 *
9540 * Supported by API versions 9 and newer.
9541 */
9542extern float __attribute__((const, overloadable))sqrt(float);
9543#endif
9544
9545#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9546/*
9547 * Return the square root of a value.
9548 *
9549 * Supported by API versions 9 and newer.
9550 */
9551extern float2 __attribute__((const, overloadable))sqrt(float2);
9552#endif
9553
9554#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9555/*
9556 * Return the square root of a value.
9557 *
9558 * Supported by API versions 9 and newer.
9559 */
9560extern float3 __attribute__((const, overloadable))sqrt(float3);
9561#endif
9562
9563#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9564/*
9565 * Return the square root of a value.
9566 *
9567 * Supported by API versions 9 and newer.
9568 */
9569extern float4 __attribute__((const, overloadable))sqrt(float4);
9570#endif
9571
9572#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9573/*
Jason Sams29087fa2014-01-09 17:06:17 -08009574 * if (v < edge)
9575 * return 0.f;
9576 * else
9577 * return 1.f;
9578 *
9579 * Supported by API versions 9 and newer.
9580 */
9581extern float __attribute__((const, overloadable))step(float edge, float v);
9582#endif
9583
9584#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9585/*
9586 * if (v < edge)
9587 * return 0.f;
9588 * else
9589 * return 1.f;
9590 *
9591 * Supported by API versions 9 and newer.
9592 */
9593extern float2 __attribute__((const, overloadable))step(float2 edge, float2 v);
9594#endif
9595
9596#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9597/*
9598 * if (v < edge)
9599 * return 0.f;
9600 * else
9601 * return 1.f;
9602 *
9603 * Supported by API versions 9 and newer.
9604 */
9605extern float3 __attribute__((const, overloadable))step(float3 edge, float3 v);
9606#endif
9607
9608#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9609/*
9610 * if (v < edge)
9611 * return 0.f;
9612 * else
9613 * return 1.f;
9614 *
9615 * Supported by API versions 9 and newer.
9616 */
9617extern float4 __attribute__((const, overloadable))step(float4 edge, float4 v);
9618#endif
9619
9620#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9621/*
9622 * if (v < edge)
9623 * return 0.f;
9624 * else
9625 * return 1.f;
9626 *
9627 * Supported by API versions 9 and newer.
9628 */
9629extern float2 __attribute__((const, overloadable))step(float2 edge, float v);
9630#endif
9631
9632#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9633/*
9634 * if (v < edge)
9635 * return 0.f;
9636 * else
9637 * return 1.f;
9638 *
9639 * Supported by API versions 9 and newer.
9640 */
9641extern float3 __attribute__((const, overloadable))step(float3 edge, float v);
9642#endif
9643
9644#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9645/*
9646 * if (v < edge)
9647 * return 0.f;
9648 * else
9649 * return 1.f;
9650 *
9651 * Supported by API versions 9 and newer.
9652 */
9653extern float4 __attribute__((const, overloadable))step(float4 edge, float v);
9654#endif
9655
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -08009656#if (defined(RS_VERSION) && (RS_VERSION >= 20))
9657/*
9658 * if (v < edge)
9659 * return 0.f;
9660 * else
9661 * return 1.f;
9662 *
9663 * Supported by API versions 20 and newer.
9664 */
9665extern float2 __attribute__((const, overloadable))step(float edge, float2 v);
9666#endif
9667
9668#if (defined(RS_VERSION) && (RS_VERSION >= 20))
9669/*
9670 * if (v < edge)
9671 * return 0.f;
9672 * else
9673 * return 1.f;
9674 *
9675 * Supported by API versions 20 and newer.
9676 */
9677extern float3 __attribute__((const, overloadable))step(float edge, float3 v);
9678#endif
9679
9680#if (defined(RS_VERSION) && (RS_VERSION >= 20))
9681/*
9682 * if (v < edge)
9683 * return 0.f;
9684 * else
9685 * return 1.f;
9686 *
9687 * Supported by API versions 20 and newer.
9688 */
9689extern float4 __attribute__((const, overloadable))step(float edge, float4 v);
9690#endif
9691
Jason Sams29087fa2014-01-09 17:06:17 -08009692#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9693/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009694 * Return the tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009695 *
9696 * Supported by API versions 9 and newer.
9697 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009698extern float __attribute__((const, overloadable))tan(float);
Jason Sams29087fa2014-01-09 17:06:17 -08009699#endif
9700
9701#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9702/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009703 * Return the tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009704 *
9705 * Supported by API versions 9 and newer.
9706 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009707extern float2 __attribute__((const, overloadable))tan(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08009708#endif
9709
9710#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9711/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009712 * Return the tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009713 *
9714 * Supported by API versions 9 and newer.
9715 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009716extern float3 __attribute__((const, overloadable))tan(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08009717#endif
9718
9719#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9720/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009721 * Return the tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009722 *
9723 * Supported by API versions 9 and newer.
9724 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009725extern float4 __attribute__((const, overloadable))tan(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08009726#endif
9727
9728#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9729/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009730 * Return the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009731 *
9732 * Supported by API versions 9 and newer.
9733 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009734extern float __attribute__((const, overloadable))tanh(float);
Jason Sams29087fa2014-01-09 17:06:17 -08009735#endif
9736
9737#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9738/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009739 * Return the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009740 *
9741 * Supported by API versions 9 and newer.
9742 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009743extern float2 __attribute__((const, overloadable))tanh(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08009744#endif
9745
9746#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9747/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009748 * Return the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009749 *
9750 * Supported by API versions 9 and newer.
9751 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009752extern float3 __attribute__((const, overloadable))tanh(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08009753#endif
9754
9755#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9756/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009757 * Return the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009758 *
9759 * Supported by API versions 9 and newer.
9760 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009761extern float4 __attribute__((const, overloadable))tanh(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08009762#endif
9763
9764#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9765/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009766 * Return tan(v * PI)
Jason Sams29087fa2014-01-09 17:06:17 -08009767 *
9768 * Supported by API versions 9 and newer.
9769 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009770extern float __attribute__((const, overloadable))tanpi(float);
Jason Sams29087fa2014-01-09 17:06:17 -08009771#endif
9772
9773#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9774/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009775 * Return tan(v * PI)
Jason Sams29087fa2014-01-09 17:06:17 -08009776 *
9777 * Supported by API versions 9 and newer.
9778 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009779extern float2 __attribute__((const, overloadable))tanpi(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08009780#endif
9781
9782#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9783/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009784 * Return tan(v * PI)
Jason Sams29087fa2014-01-09 17:06:17 -08009785 *
9786 * Supported by API versions 9 and newer.
9787 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009788extern float3 __attribute__((const, overloadable))tanpi(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08009789#endif
9790
9791#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9792/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009793 * Return tan(v * PI)
Jason Sams29087fa2014-01-09 17:06:17 -08009794 *
9795 * Supported by API versions 9 and newer.
9796 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009797extern float4 __attribute__((const, overloadable))tanpi(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08009798#endif
9799
9800#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9801/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009802 * Compute the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009803 *
9804 * Supported by API versions 9 and newer.
9805 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009806extern float __attribute__((const, overloadable))tgamma(float);
Jason Sams29087fa2014-01-09 17:06:17 -08009807#endif
9808
9809#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9810/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009811 * Compute the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009812 *
9813 * Supported by API versions 9 and newer.
9814 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009815extern float2 __attribute__((const, overloadable))tgamma(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08009816#endif
9817
9818#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9819/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009820 * Compute the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009821 *
9822 * Supported by API versions 9 and newer.
9823 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009824extern float3 __attribute__((const, overloadable))tgamma(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08009825#endif
9826
9827#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9828/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009829 * Compute the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -08009830 *
9831 * Supported by API versions 9 and newer.
9832 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009833extern float4 __attribute__((const, overloadable))tgamma(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08009834#endif
9835
9836#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9837/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009838 * ound to integral using truncation.
Jason Sams29087fa2014-01-09 17:06:17 -08009839 *
9840 * Supported by API versions 9 and newer.
9841 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009842extern float __attribute__((const, overloadable))trunc(float);
Jason Sams29087fa2014-01-09 17:06:17 -08009843#endif
9844
9845#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9846/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009847 * ound to integral using truncation.
Jason Sams29087fa2014-01-09 17:06:17 -08009848 *
9849 * Supported by API versions 9 and newer.
9850 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009851extern float2 __attribute__((const, overloadable))trunc(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08009852#endif
9853
9854#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9855/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009856 * ound to integral using truncation.
Jason Sams29087fa2014-01-09 17:06:17 -08009857 *
9858 * Supported by API versions 9 and newer.
9859 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009860extern float3 __attribute__((const, overloadable))trunc(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08009861#endif
9862
9863#if (defined(RS_VERSION) && (RS_VERSION >= 9))
9864/*
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009865 * ound to integral using truncation.
Jason Sams29087fa2014-01-09 17:06:17 -08009866 *
9867 * Supported by API versions 9 and newer.
9868 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009869extern float4 __attribute__((const, overloadable))trunc(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08009870#endif
9871
9872#endif // __rs_core_math_rsh__