blob: ab1f7ee0e74b93eb22c5cfabd7eb67b44f822391 [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
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080019/** @file
20 *
21 */
22
Jason Sams29087fa2014-01-09 17:06:17 -080023#ifndef __rs_core_math_rsh__
24#define __rs_core_math_rsh__
25#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080026/**
27 * Returns the absolute value of the integer n.
28 *
29 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080030 *
31 * Supported by API versions 9 and newer.
32 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080033extern uchar __attribute__((const, overloadable))abs(char n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080034#endif
35
36#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080037/**
38 * Returns the absolute value of the integer n.
39 *
40 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080041 *
42 * Supported by API versions 9 and newer.
43 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080044extern uchar2 __attribute__((const, overloadable))abs(char2 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080045#endif
46
47#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080048/**
49 * Returns the absolute value of the integer n.
50 *
51 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080052 *
53 * Supported by API versions 9 and newer.
54 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080055extern uchar3 __attribute__((const, overloadable))abs(char3 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080056#endif
57
58#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080059/**
60 * Returns the absolute value of the integer n.
61 *
62 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080063 *
64 * Supported by API versions 9 and newer.
65 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080066extern uchar4 __attribute__((const, overloadable))abs(char4 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080067#endif
68
69#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080070/**
71 * Returns the absolute value of the integer n.
72 *
73 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080074 *
75 * Supported by API versions 9 and newer.
76 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080077extern ushort __attribute__((const, overloadable))abs(short n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080078#endif
79
80#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080081/**
82 * Returns the absolute value of the integer n.
83 *
84 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080085 *
86 * Supported by API versions 9 and newer.
87 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080088extern ushort2 __attribute__((const, overloadable))abs(short2 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080089#endif
90
91#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080092/**
93 * Returns the absolute value of the integer n.
94 *
95 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080096 *
97 * Supported by API versions 9 and newer.
98 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080099extern ushort3 __attribute__((const, overloadable))abs(short3 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800100#endif
101
102#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800103/**
104 * Returns the absolute value of the integer n.
105 *
106 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800107 *
108 * Supported by API versions 9 and newer.
109 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800110extern ushort4 __attribute__((const, overloadable))abs(short4 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800111#endif
112
113#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800114/**
115 * Returns the absolute value of the integer n.
116 *
117 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800118 *
119 * Supported by API versions 9 and newer.
120 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800121extern uint __attribute__((const, overloadable))abs(int n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800122#endif
123
124#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800125/**
126 * Returns the absolute value of the integer n.
127 *
128 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800129 *
130 * Supported by API versions 9 and newer.
131 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800132extern uint2 __attribute__((const, overloadable))abs(int2 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800133#endif
134
135#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800136/**
137 * Returns the absolute value of the integer n.
138 *
139 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800140 *
141 * Supported by API versions 9 and newer.
142 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800143extern uint3 __attribute__((const, overloadable))abs(int3 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800144#endif
145
146#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800147/**
148 * Returns the absolute value of the integer n.
149 *
150 * For floats, use fabs().
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800151 *
152 * Supported by API versions 9 and newer.
153 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800154extern uint4 __attribute__((const, overloadable))abs(int4 n);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800155#endif
156
157#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800158/**
159 * Returns the inverse cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800160 *
161 * Supported by API versions 9 and newer.
162 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800163extern float __attribute__((const, overloadable))acos(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800164#endif
165
166#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800167/**
168 * Returns the inverse cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800169 *
170 * Supported by API versions 9 and newer.
171 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800172extern float2 __attribute__((const, overloadable))acos(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800173#endif
174
175#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800176/**
177 * Returns the inverse cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800178 *
179 * Supported by API versions 9 and newer.
180 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800181extern float3 __attribute__((const, overloadable))acos(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800182#endif
183
184#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800185/**
186 * Returns the inverse cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800187 *
188 * Supported by API versions 9 and newer.
189 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800190extern float4 __attribute__((const, overloadable))acos(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800191#endif
192
193#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800194/**
195 * Returns the inverse hyperbolic cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800196 *
197 * Supported by API versions 9 and newer.
198 */
199extern float __attribute__((const, overloadable))acosh(float);
200#endif
201
202#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800203/**
204 * Returns the inverse hyperbolic cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800205 *
206 * Supported by API versions 9 and newer.
207 */
208extern float2 __attribute__((const, overloadable))acosh(float2);
209#endif
210
211#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800212/**
213 * Returns the inverse hyperbolic cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800214 *
215 * Supported by API versions 9 and newer.
216 */
217extern float3 __attribute__((const, overloadable))acosh(float3);
218#endif
219
220#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800221/**
222 * Returns the inverse hyperbolic cosine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800223 *
224 * Supported by API versions 9 and newer.
225 */
226extern float4 __attribute__((const, overloadable))acosh(float4);
227#endif
228
229#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800230/**
231 * Returns the inverse cosine in radians, divided by pi.
232 *
233 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800234 *
235 * Supported by API versions 9 and newer.
236 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800237extern float __attribute__((const, overloadable))acospi(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800238#endif
239
240#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800241/**
242 * Returns the inverse cosine in radians, divided by pi.
243 *
244 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800245 *
246 * Supported by API versions 9 and newer.
247 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800248extern float2 __attribute__((const, overloadable))acospi(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800249#endif
250
251#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800252/**
253 * Returns the inverse cosine in radians, divided by pi.
254 *
255 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800256 *
257 * Supported by API versions 9 and newer.
258 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800259extern float3 __attribute__((const, overloadable))acospi(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800260#endif
261
262#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800263/**
264 * Returns the inverse cosine in radians, divided by pi.
265 *
266 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800267 *
268 * Supported by API versions 9 and newer.
269 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800270extern float4 __attribute__((const, overloadable))acospi(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800271#endif
272
273#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800274/**
275 * Returns the inverse sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800276 *
277 * Supported by API versions 9 and newer.
278 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800279extern float __attribute__((const, overloadable))asin(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800280#endif
281
282#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800283/**
284 * Returns the inverse sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800285 *
286 * Supported by API versions 9 and newer.
287 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800288extern float2 __attribute__((const, overloadable))asin(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800289#endif
290
291#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800292/**
293 * Returns the inverse sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800294 *
295 * Supported by API versions 9 and newer.
296 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800297extern float3 __attribute__((const, overloadable))asin(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800298#endif
299
300#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800301/**
302 * Returns the inverse sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800303 *
304 * Supported by API versions 9 and newer.
305 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800306extern float4 __attribute__((const, overloadable))asin(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800307#endif
308
309#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800310/**
311 * Returns the inverse hyperbolic sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800312 *
313 * Supported by API versions 9 and newer.
314 */
315extern float __attribute__((const, overloadable))asinh(float);
316#endif
317
318#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800319/**
320 * Returns the inverse hyperbolic sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800321 *
322 * Supported by API versions 9 and newer.
323 */
324extern float2 __attribute__((const, overloadable))asinh(float2);
325#endif
326
327#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800328/**
329 * Returns the inverse hyperbolic sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800330 *
331 * Supported by API versions 9 and newer.
332 */
333extern float3 __attribute__((const, overloadable))asinh(float3);
334#endif
335
336#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800337/**
338 * Returns the inverse hyperbolic sine, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800339 *
340 * Supported by API versions 9 and newer.
341 */
342extern float4 __attribute__((const, overloadable))asinh(float4);
343#endif
344
345#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800346/**
347 * Returns the inverse sine in radians, divided by pi.
348 *
349 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800350 *
351 * Supported by API versions 9 and newer.
352 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800353extern float __attribute__((const, overloadable))asinpi(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800354#endif
355
356#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800357/**
358 * Returns the inverse sine in radians, divided by pi.
359 *
360 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800361 *
362 * Supported by API versions 9 and newer.
363 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800364extern float2 __attribute__((const, overloadable))asinpi(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800365#endif
366
367#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800368/**
369 * Returns the inverse sine in radians, divided by pi.
370 *
371 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800372 *
373 * Supported by API versions 9 and newer.
374 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800375extern float3 __attribute__((const, overloadable))asinpi(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800376#endif
377
378#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800379/**
380 * Returns the inverse sine in radians, divided by pi.
381 *
382 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800383 *
384 * Supported by API versions 9 and newer.
385 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800386extern float4 __attribute__((const, overloadable))asinpi(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800387#endif
388
389#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800390/**
391 * Returns the inverse tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800392 *
393 * Supported by API versions 9 and newer.
394 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800395extern float __attribute__((const, overloadable))atan(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800396#endif
397
398#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800399/**
400 * Returns the inverse tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800401 *
402 * Supported by API versions 9 and newer.
403 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800404extern float2 __attribute__((const, overloadable))atan(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800405#endif
406
407#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800408/**
409 * Returns the inverse tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800410 *
411 * Supported by API versions 9 and newer.
412 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800413extern float3 __attribute__((const, overloadable))atan(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800414#endif
415
416#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800417/**
418 * Returns the inverse tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800419 *
420 * Supported by API versions 9 and newer.
421 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800422extern float4 __attribute__((const, overloadable))atan(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800423#endif
424
425#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800426/**
427 * Returns the inverse tangent of y / x, in radians.
428 *
429 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800430 *
431 * Supported by API versions 9 and newer.
432 */
433extern float __attribute__((const, overloadable))atan2(float y, float x);
434#endif
435
436#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800437/**
438 * Returns the inverse tangent of y / x, in radians.
439 *
440 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800441 *
442 * Supported by API versions 9 and newer.
443 */
444extern float2 __attribute__((const, overloadable))atan2(float2 y, float2 x);
445#endif
446
447#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800448/**
449 * Returns the inverse tangent of y / x, in radians.
450 *
451 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800452 *
453 * Supported by API versions 9 and newer.
454 */
455extern float3 __attribute__((const, overloadable))atan2(float3 y, float3 x);
456#endif
457
458#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800459/**
460 * Returns the inverse tangent of y / x, in radians.
461 *
462 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800463 *
464 * Supported by API versions 9 and newer.
465 */
466extern float4 __attribute__((const, overloadable))atan2(float4 y, float4 x);
467#endif
468
469#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800470/**
471 * Returns the inverse tangent of y / x, in radians, divided by pi.
472 *
473 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
474 *
475 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800476 *
477 * Supported by API versions 9 and newer.
478 */
479extern float __attribute__((const, overloadable))atan2pi(float y, float x);
480#endif
481
482#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800483/**
484 * Returns the inverse tangent of y / x, in radians, divided by pi.
485 *
486 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
487 *
488 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800489 *
490 * Supported by API versions 9 and newer.
491 */
492extern float2 __attribute__((const, overloadable))atan2pi(float2 y, float2 x);
493#endif
494
495#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800496/**
497 * Returns the inverse tangent of y / x, in radians, divided by pi.
498 *
499 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
500 *
501 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800502 *
503 * Supported by API versions 9 and newer.
504 */
505extern float3 __attribute__((const, overloadable))atan2pi(float3 y, float3 x);
506#endif
507
508#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800509/**
510 * Returns the inverse tangent of y / x, in radians, divided by pi.
511 *
512 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
513 *
514 * x can be 0.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800515 *
516 * Supported by API versions 9 and newer.
517 */
518extern float4 __attribute__((const, overloadable))atan2pi(float4 y, float4 x);
519#endif
520
521#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800522/**
523 * Returns the inverse hyperbolic tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800524 *
525 * Supported by API versions 9 and newer.
526 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -0700527extern float __attribute__((const, overloadable))atanh(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800528#endif
529
530#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800531/**
532 * Returns the inverse hyperbolic tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800533 *
534 * Supported by API versions 9 and newer.
535 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -0700536extern float2 __attribute__((const, overloadable))atanh(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800537#endif
538
539#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800540/**
541 * Returns the inverse hyperbolic tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800542 *
543 * Supported by API versions 9 and newer.
544 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -0700545extern float3 __attribute__((const, overloadable))atanh(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800546#endif
547
548#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800549/**
550 * Returns the inverse hyperbolic tangent, in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800551 *
552 * Supported by API versions 9 and newer.
553 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -0700554extern float4 __attribute__((const, overloadable))atanh(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800555#endif
556
557#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800558/**
559 * Returns the inverse tangent in radians, divided by pi.
560 *
561 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800562 *
563 * Supported by API versions 9 and newer.
564 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800565extern float __attribute__((const, overloadable))atanpi(float v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800566#endif
567
568#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800569/**
570 * Returns the inverse tangent in radians, divided by pi.
571 *
572 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800573 *
574 * Supported by API versions 9 and newer.
575 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800576extern float2 __attribute__((const, overloadable))atanpi(float2 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800577#endif
578
579#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800580/**
581 * Returns the inverse tangent in radians, divided by pi.
582 *
583 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800584 *
585 * Supported by API versions 9 and newer.
586 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800587extern float3 __attribute__((const, overloadable))atanpi(float3 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800588#endif
589
590#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800591/**
592 * Returns the inverse tangent in radians, divided by pi.
593 *
594 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800595 *
596 * Supported by API versions 9 and newer.
597 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -0800598extern float4 __attribute__((const, overloadable))atanpi(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800599#endif
600
601#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800602/**
603 * Returns the cube root.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800604 *
605 * Supported by API versions 9 and newer.
606 */
607extern float __attribute__((const, overloadable))cbrt(float);
608#endif
609
610#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800611/**
612 * Returns the cube root.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800613 *
614 * Supported by API versions 9 and newer.
615 */
616extern float2 __attribute__((const, overloadable))cbrt(float2);
617#endif
618
619#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800620/**
621 * Returns the cube root.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800622 *
623 * Supported by API versions 9 and newer.
624 */
625extern float3 __attribute__((const, overloadable))cbrt(float3);
626#endif
627
628#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800629/**
630 * Returns the cube root.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800631 *
632 * Supported by API versions 9 and newer.
633 */
634extern float4 __attribute__((const, overloadable))cbrt(float4);
635#endif
636
637#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800638/**
639 * Returns the smallest integer not less than a value.
640 *
641 * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800642 *
643 * Supported by API versions 9 and newer.
644 */
645extern float __attribute__((const, overloadable))ceil(float);
646#endif
647
648#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800649/**
650 * Returns the smallest integer not less than a value.
651 *
652 * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800653 *
654 * Supported by API versions 9 and newer.
655 */
656extern float2 __attribute__((const, overloadable))ceil(float2);
657#endif
658
659#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800660/**
661 * Returns the smallest integer not less than a value.
662 *
663 * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800664 *
665 * Supported by API versions 9 and newer.
666 */
667extern float3 __attribute__((const, overloadable))ceil(float3);
668#endif
669
670#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800671/**
672 * Returns the smallest integer not less than a value.
673 *
674 * For example, ceil(1.2f) returns 2.f, and ceil(-1.2f) returns -1.f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800675 *
676 * Supported by API versions 9 and newer.
677 */
678extern float4 __attribute__((const, overloadable))ceil(float4);
679#endif
680
681#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800682/**
683 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800684 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800685 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
686 *
687 * If min_value is greater than max_value, the results are undefined.
688 *
689 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800690 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800691 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800692 *
693 * Supported by API versions 9 and newer.
694 */
695extern float __attribute__((const, overloadable))clamp(float value, float min_value, float max_value);
696#endif
697
698#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800699/**
700 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800701 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800702 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
703 *
704 * If min_value is greater than max_value, the results are undefined.
705 *
706 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800707 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800708 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800709 *
710 * Supported by API versions 9 and newer.
711 */
712extern float2 __attribute__((const, overloadable))clamp(float2 value, float2 min_value, float2 max_value);
713#endif
714
715#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800716/**
717 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800718 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800719 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
720 *
721 * If min_value is greater than max_value, the results are undefined.
722 *
723 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800724 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800725 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800726 *
727 * Supported by API versions 9 and newer.
728 */
729extern float3 __attribute__((const, overloadable))clamp(float3 value, float3 min_value, float3 max_value);
730#endif
731
732#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800733/**
734 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800735 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800736 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
737 *
738 * If min_value is greater than max_value, the results are undefined.
739 *
740 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800741 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800742 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800743 *
744 * Supported by API versions 9 and newer.
745 */
746extern float4 __attribute__((const, overloadable))clamp(float4 value, float4 min_value, float4 max_value);
747#endif
748
749#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800750/**
751 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800752 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800753 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
754 *
755 * If min_value is greater than max_value, the results are undefined.
756 *
757 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800758 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800759 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800760 *
761 * Supported by API versions 9 and newer.
762 */
763extern float2 __attribute__((const, overloadable))clamp(float2 value, float min_value, float max_value);
764#endif
765
766#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800767/**
768 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800769 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800770 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
771 *
772 * If min_value is greater than max_value, the results are undefined.
773 *
774 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800775 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800776 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800777 *
778 * Supported by API versions 9 and newer.
779 */
780extern float3 __attribute__((const, overloadable))clamp(float3 value, float min_value, float max_value);
781#endif
782
783#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800784/**
785 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800786 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800787 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
788 *
789 * If min_value is greater than max_value, the results are undefined.
790 *
791 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800792 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800793 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800794 *
795 * Supported by API versions 9 and newer.
796 */
797extern float4 __attribute__((const, overloadable))clamp(float4 value, float min_value, float max_value);
798#endif
799
800#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800801/**
802 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800803 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800804 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
805 *
806 * If min_value is greater than max_value, the results are undefined.
807 *
808 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800809 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800810 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800811 *
812 * Supported by API versions 19 and newer.
813 */
814extern char __attribute__((const, overloadable))clamp(char value, char min_value, char max_value);
815#endif
816
817#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800818/**
819 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800820 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800821 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
822 *
823 * If min_value is greater than max_value, the results are undefined.
824 *
825 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800826 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800827 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800828 *
829 * Supported by API versions 19 and newer.
830 */
831extern char2 __attribute__((const, overloadable))clamp(char2 value, char2 min_value, char2 max_value);
832#endif
833
834#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800835/**
836 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800837 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800838 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
839 *
840 * If min_value is greater than max_value, the results are undefined.
841 *
842 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800843 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800844 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800845 *
846 * Supported by API versions 19 and newer.
847 */
848extern char3 __attribute__((const, overloadable))clamp(char3 value, char3 min_value, char3 max_value);
849#endif
850
851#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800852/**
853 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800854 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800855 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
856 *
857 * If min_value is greater than max_value, the results are undefined.
858 *
859 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800860 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800861 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800862 *
863 * Supported by API versions 19 and newer.
864 */
865extern char4 __attribute__((const, overloadable))clamp(char4 value, char4 min_value, char4 max_value);
866#endif
867
868#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800869/**
870 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800871 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800872 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
873 *
874 * If min_value is greater than max_value, the results are undefined.
875 *
876 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800877 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800878 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800879 *
880 * Supported by API versions 19 and newer.
881 */
882extern uchar __attribute__((const, overloadable))clamp(uchar value, uchar min_value, uchar max_value);
883#endif
884
885#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800886/**
887 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800888 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800889 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
890 *
891 * If min_value is greater than max_value, the results are undefined.
892 *
893 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800894 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800895 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800896 *
897 * Supported by API versions 19 and newer.
898 */
899extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
900#endif
901
902#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800903/**
904 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800905 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800906 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
907 *
908 * If min_value is greater than max_value, the results are undefined.
909 *
910 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800911 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800912 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800913 *
914 * Supported by API versions 19 and newer.
915 */
916extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
917#endif
918
919#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800920/**
921 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800922 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800923 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
924 *
925 * If min_value is greater than max_value, the results are undefined.
926 *
927 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800928 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800929 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800930 *
931 * Supported by API versions 19 and newer.
932 */
933extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
934#endif
935
936#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800937/**
938 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800939 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800940 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
941 *
942 * If min_value is greater than max_value, the results are undefined.
943 *
944 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800945 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800946 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800947 *
948 * Supported by API versions 19 and newer.
949 */
950extern short __attribute__((const, overloadable))clamp(short value, short min_value, short max_value);
951#endif
952
953#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800954/**
955 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800956 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800957 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
958 *
959 * If min_value is greater than max_value, the results are undefined.
960 *
961 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800962 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800963 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800964 *
965 * Supported by API versions 19 and newer.
966 */
967extern short2 __attribute__((const, overloadable))clamp(short2 value, short2 min_value, short2 max_value);
968#endif
969
970#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800971/**
972 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800973 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800974 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
975 *
976 * If min_value is greater than max_value, the results are undefined.
977 *
978 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800979 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800980 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800981 *
982 * Supported by API versions 19 and newer.
983 */
984extern short3 __attribute__((const, overloadable))clamp(short3 value, short3 min_value, short3 max_value);
985#endif
986
987#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800988/**
989 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800990 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800991 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
992 *
993 * If min_value is greater than max_value, the results are undefined.
994 *
995 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800996 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -0800997 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -0800998 *
999 * Supported by API versions 19 and newer.
1000 */
1001extern short4 __attribute__((const, overloadable))clamp(short4 value, short4 min_value, short4 max_value);
1002#endif
1003
1004#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001005/**
1006 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001007 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001008 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1009 *
1010 * If min_value is greater than max_value, the results are undefined.
1011 *
1012 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001013 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001014 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001015 *
1016 * Supported by API versions 19 and newer.
1017 */
1018extern ushort __attribute__((const, overloadable))clamp(ushort value, ushort min_value, ushort max_value);
1019#endif
1020
1021#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001022/**
1023 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001024 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001025 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1026 *
1027 * If min_value is greater than max_value, the results are undefined.
1028 *
1029 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001030 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001031 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001032 *
1033 * Supported by API versions 19 and newer.
1034 */
1035extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
1036#endif
1037
1038#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001039/**
1040 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001041 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001042 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1043 *
1044 * If min_value is greater than max_value, the results are undefined.
1045 *
1046 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001047 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001048 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001049 *
1050 * Supported by API versions 19 and newer.
1051 */
1052extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
1053#endif
1054
1055#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001056/**
1057 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001058 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001059 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1060 *
1061 * If min_value is greater than max_value, the results are undefined.
1062 *
1063 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001064 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001065 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001066 *
1067 * Supported by API versions 19 and newer.
1068 */
1069extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
1070#endif
1071
1072#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001073/**
1074 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001075 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001076 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1077 *
1078 * If min_value is greater than max_value, the results are undefined.
1079 *
1080 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001081 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001082 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001083 *
1084 * Supported by API versions 19 and newer.
1085 */
1086extern int __attribute__((const, overloadable))clamp(int value, int min_value, int max_value);
1087#endif
1088
1089#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001090/**
1091 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001092 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001093 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1094 *
1095 * If min_value is greater than max_value, the results are undefined.
1096 *
1097 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001098 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001099 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001100 *
1101 * Supported by API versions 19 and newer.
1102 */
1103extern int2 __attribute__((const, overloadable))clamp(int2 value, int2 min_value, int2 max_value);
1104#endif
1105
1106#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001107/**
1108 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001109 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001110 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1111 *
1112 * If min_value is greater than max_value, the results are undefined.
1113 *
1114 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001115 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001116 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001117 *
1118 * Supported by API versions 19 and newer.
1119 */
1120extern int3 __attribute__((const, overloadable))clamp(int3 value, int3 min_value, int3 max_value);
1121#endif
1122
1123#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001124/**
1125 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001126 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001127 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1128 *
1129 * If min_value is greater than max_value, the results are undefined.
1130 *
1131 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001132 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001133 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001134 *
1135 * Supported by API versions 19 and newer.
1136 */
1137extern int4 __attribute__((const, overloadable))clamp(int4 value, int4 min_value, int4 max_value);
1138#endif
1139
1140#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001141/**
1142 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001143 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001144 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1145 *
1146 * If min_value is greater than max_value, the results are undefined.
1147 *
1148 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001149 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001150 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001151 *
1152 * Supported by API versions 19 and newer.
1153 */
1154extern uint __attribute__((const, overloadable))clamp(uint value, uint min_value, uint max_value);
1155#endif
1156
1157#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001158/**
1159 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001160 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001161 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1162 *
1163 * If min_value is greater than max_value, the results are undefined.
1164 *
1165 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001166 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001167 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001168 *
1169 * Supported by API versions 19 and newer.
1170 */
1171extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint2 min_value, uint2 max_value);
1172#endif
1173
1174#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001175/**
1176 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001177 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001178 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1179 *
1180 * If min_value is greater than max_value, the results are undefined.
1181 *
1182 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001183 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001184 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001185 *
1186 * Supported by API versions 19 and newer.
1187 */
1188extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint3 min_value, uint3 max_value);
1189#endif
1190
1191#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001192/**
1193 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001194 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001195 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1196 *
1197 * If min_value is greater than max_value, the results are undefined.
1198 *
1199 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001200 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001201 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001202 *
1203 * Supported by API versions 19 and newer.
1204 */
1205extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint4 min_value, uint4 max_value);
1206#endif
1207
1208#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001209/**
1210 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001211 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001212 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1213 *
1214 * If min_value is greater than max_value, the results are undefined.
1215 *
1216 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001217 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001218 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001219 *
1220 * Supported by API versions 19 and newer.
1221 */
1222extern long __attribute__((const, overloadable))clamp(long value, long min_value, long max_value);
1223#endif
1224
1225#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001226/**
1227 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001228 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001229 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1230 *
1231 * If min_value is greater than max_value, the results are undefined.
1232 *
1233 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001234 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001235 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001236 *
1237 * Supported by API versions 19 and newer.
1238 */
1239extern long2 __attribute__((const, overloadable))clamp(long2 value, long2 min_value, long2 max_value);
1240#endif
1241
1242#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001243/**
1244 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001245 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001246 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1247 *
1248 * If min_value is greater than max_value, the results are undefined.
1249 *
1250 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001251 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001252 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001253 *
1254 * Supported by API versions 19 and newer.
1255 */
1256extern long3 __attribute__((const, overloadable))clamp(long3 value, long3 min_value, long3 max_value);
1257#endif
1258
1259#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001260/**
1261 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001262 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001263 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1264 *
1265 * If min_value is greater than max_value, the results are undefined.
1266 *
1267 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001268 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001269 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001270 *
1271 * Supported by API versions 19 and newer.
1272 */
1273extern long4 __attribute__((const, overloadable))clamp(long4 value, long4 min_value, long4 max_value);
1274#endif
1275
1276#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001277/**
1278 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001279 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001280 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1281 *
1282 * If min_value is greater than max_value, the results are undefined.
1283 *
1284 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001285 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001286 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001287 *
1288 * Supported by API versions 19 and newer.
1289 */
1290extern ulong __attribute__((const, overloadable))clamp(ulong value, ulong min_value, ulong max_value);
1291#endif
1292
1293#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001294/**
1295 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001296 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001297 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1298 *
1299 * If min_value is greater than max_value, the results are undefined.
1300 *
1301 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001302 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001303 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001304 *
1305 * Supported by API versions 19 and newer.
1306 */
1307extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
1308#endif
1309
1310#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001311/**
1312 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001313 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001314 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1315 *
1316 * If min_value is greater than max_value, the results are undefined.
1317 *
1318 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001319 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001320 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001321 *
1322 * Supported by API versions 19 and newer.
1323 */
1324extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
1325#endif
1326
1327#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001328/**
1329 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001330 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001331 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1332 *
1333 * If min_value is greater than max_value, the results are undefined.
1334 *
1335 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001336 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001337 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001338 *
1339 * Supported by API versions 19 and newer.
1340 */
1341extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
1342#endif
1343
1344#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001345/**
1346 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001347 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001348 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1349 *
1350 * If min_value is greater than max_value, the results are undefined.
1351 *
1352 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001353 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001354 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001355 *
1356 * Supported by API versions 19 and newer.
1357 */
1358extern char2 __attribute__((const, overloadable))clamp(char2 value, char min_value, char max_value);
1359#endif
1360
1361#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001362/**
1363 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001364 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001365 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1366 *
1367 * If min_value is greater than max_value, the results are undefined.
1368 *
1369 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001370 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001371 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001372 *
1373 * Supported by API versions 19 and newer.
1374 */
1375extern char3 __attribute__((const, overloadable))clamp(char3 value, char min_value, char max_value);
1376#endif
1377
1378#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001379/**
1380 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001381 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001382 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1383 *
1384 * If min_value is greater than max_value, the results are undefined.
1385 *
1386 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001387 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001388 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001389 *
1390 * Supported by API versions 19 and newer.
1391 */
1392extern char4 __attribute__((const, overloadable))clamp(char4 value, char min_value, char max_value);
1393#endif
1394
1395#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001396/**
1397 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001398 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001399 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1400 *
1401 * If min_value is greater than max_value, the results are undefined.
1402 *
1403 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001404 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001405 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001406 *
1407 * Supported by API versions 19 and newer.
1408 */
1409extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar min_value, uchar max_value);
1410#endif
1411
1412#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001413/**
1414 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001415 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001416 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1417 *
1418 * If min_value is greater than max_value, the results are undefined.
1419 *
1420 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001421 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001422 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001423 *
1424 * Supported by API versions 19 and newer.
1425 */
1426extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar min_value, uchar max_value);
1427#endif
1428
1429#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001430/**
1431 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001432 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001433 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1434 *
1435 * If min_value is greater than max_value, the results are undefined.
1436 *
1437 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001438 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001439 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001440 *
1441 * Supported by API versions 19 and newer.
1442 */
1443extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar min_value, uchar max_value);
1444#endif
1445
1446#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001447/**
1448 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001449 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001450 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1451 *
1452 * If min_value is greater than max_value, the results are undefined.
1453 *
1454 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001455 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001456 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001457 *
1458 * Supported by API versions 19 and newer.
1459 */
1460extern short2 __attribute__((const, overloadable))clamp(short2 value, short min_value, short max_value);
1461#endif
1462
1463#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001464/**
1465 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001466 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001467 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1468 *
1469 * If min_value is greater than max_value, the results are undefined.
1470 *
1471 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001472 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001473 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001474 *
1475 * Supported by API versions 19 and newer.
1476 */
1477extern short3 __attribute__((const, overloadable))clamp(short3 value, short min_value, short max_value);
1478#endif
1479
1480#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001481/**
1482 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001483 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001484 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1485 *
1486 * If min_value is greater than max_value, the results are undefined.
1487 *
1488 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001489 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001490 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001491 *
1492 * Supported by API versions 19 and newer.
1493 */
1494extern short4 __attribute__((const, overloadable))clamp(short4 value, short min_value, short max_value);
1495#endif
1496
1497#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001498/**
1499 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001500 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001501 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1502 *
1503 * If min_value is greater than max_value, the results are undefined.
1504 *
1505 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001506 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001507 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001508 *
1509 * Supported by API versions 19 and newer.
1510 */
1511extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort min_value, ushort max_value);
1512#endif
1513
1514#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001515/**
1516 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001517 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001518 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1519 *
1520 * If min_value is greater than max_value, the results are undefined.
1521 *
1522 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001523 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001524 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001525 *
1526 * Supported by API versions 19 and newer.
1527 */
1528extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort min_value, ushort max_value);
1529#endif
1530
1531#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001532/**
1533 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001534 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001535 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1536 *
1537 * If min_value is greater than max_value, the results are undefined.
1538 *
1539 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001540 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001541 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001542 *
1543 * Supported by API versions 19 and newer.
1544 */
1545extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort min_value, ushort max_value);
1546#endif
1547
1548#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001549/**
1550 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001551 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001552 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1553 *
1554 * If min_value is greater than max_value, the results are undefined.
1555 *
1556 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001557 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001558 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001559 *
1560 * Supported by API versions 19 and newer.
1561 */
1562extern int2 __attribute__((const, overloadable))clamp(int2 value, int min_value, int max_value);
1563#endif
1564
1565#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001566/**
1567 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001568 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001569 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1570 *
1571 * If min_value is greater than max_value, the results are undefined.
1572 *
1573 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001574 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001575 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001576 *
1577 * Supported by API versions 19 and newer.
1578 */
1579extern int3 __attribute__((const, overloadable))clamp(int3 value, int min_value, int max_value);
1580#endif
1581
1582#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001583/**
1584 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001585 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001586 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1587 *
1588 * If min_value is greater than max_value, the results are undefined.
1589 *
1590 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001591 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001592 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001593 *
1594 * Supported by API versions 19 and newer.
1595 */
1596extern int4 __attribute__((const, overloadable))clamp(int4 value, int min_value, int max_value);
1597#endif
1598
1599#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001600/**
1601 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001602 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001603 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1604 *
1605 * If min_value is greater than max_value, the results are undefined.
1606 *
1607 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001608 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001609 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001610 *
1611 * Supported by API versions 19 and newer.
1612 */
1613extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint min_value, uint max_value);
1614#endif
1615
1616#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001617/**
1618 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001619 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001620 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1621 *
1622 * If min_value is greater than max_value, the results are undefined.
1623 *
1624 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001625 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001626 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001627 *
1628 * Supported by API versions 19 and newer.
1629 */
1630extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint min_value, uint max_value);
1631#endif
1632
1633#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001634/**
1635 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001636 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001637 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1638 *
1639 * If min_value is greater than max_value, the results are undefined.
1640 *
1641 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001642 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001643 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001644 *
1645 * Supported by API versions 19 and newer.
1646 */
1647extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint min_value, uint max_value);
1648#endif
1649
1650#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001651/**
1652 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001653 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001654 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1655 *
1656 * If min_value is greater than max_value, the results are undefined.
1657 *
1658 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001659 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001660 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001661 *
1662 * Supported by API versions 19 and newer.
1663 */
1664extern long2 __attribute__((const, overloadable))clamp(long2 value, long min_value, long max_value);
1665#endif
1666
1667#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001668/**
1669 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001670 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001671 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1672 *
1673 * If min_value is greater than max_value, the results are undefined.
1674 *
1675 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001676 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001677 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001678 *
1679 * Supported by API versions 19 and newer.
1680 */
1681extern long3 __attribute__((const, overloadable))clamp(long3 value, long min_value, long max_value);
1682#endif
1683
1684#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001685/**
1686 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001687 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001688 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1689 *
1690 * If min_value is greater than max_value, the results are undefined.
1691 *
1692 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001693 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001694 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001695 *
1696 * Supported by API versions 19 and newer.
1697 */
1698extern long4 __attribute__((const, overloadable))clamp(long4 value, long min_value, long max_value);
1699#endif
1700
1701#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001702/**
1703 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001704 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001705 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1706 *
1707 * If min_value is greater than max_value, the results are undefined.
1708 *
1709 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001710 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001711 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001712 *
1713 * Supported by API versions 19 and newer.
1714 */
1715extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong min_value, ulong max_value);
1716#endif
1717
1718#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001719/**
1720 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001721 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001722 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1723 *
1724 * If min_value is greater than max_value, the results are undefined.
1725 *
1726 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001727 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001728 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001729 *
1730 * Supported by API versions 19 and newer.
1731 */
1732extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong min_value, ulong max_value);
1733#endif
1734
1735#if (defined(RS_VERSION) && (RS_VERSION >= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001736/**
1737 * Clamps a value to a specified high and low bound.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001738 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001739 * clamp() returns min_value if value < min_value, max_value if value > max_value, otherwise value.
1740 *
1741 * If min_value is greater than max_value, the results are undefined.
1742 *
1743 * @param value Value to be clamped. Supports 1, 2, 3, 4 components.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001744 * @param min_value Lower bound, must be scalar or matching vector.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001745 * @param max_value High bound, must match the type of low.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001746 *
1747 * Supported by API versions 19 and newer.
1748 */
1749extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong min_value, ulong max_value);
1750#endif
1751
1752#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001753/**
1754 * Returns the number of leading 0-bits in a value.
1755 *
1756 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001757 *
1758 * Supported by API versions 9 and newer.
1759 */
1760extern char __attribute__((const, overloadable))clz(char value);
1761#endif
1762
1763#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001764/**
1765 * Returns the number of leading 0-bits in a value.
1766 *
1767 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001768 *
1769 * Supported by API versions 9 and newer.
1770 */
1771extern char2 __attribute__((const, overloadable))clz(char2 value);
1772#endif
1773
1774#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001775/**
1776 * Returns the number of leading 0-bits in a value.
1777 *
1778 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001779 *
1780 * Supported by API versions 9 and newer.
1781 */
1782extern char3 __attribute__((const, overloadable))clz(char3 value);
1783#endif
1784
1785#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001786/**
1787 * Returns the number of leading 0-bits in a value.
1788 *
1789 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001790 *
1791 * Supported by API versions 9 and newer.
1792 */
1793extern char4 __attribute__((const, overloadable))clz(char4 value);
1794#endif
1795
1796#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001797/**
1798 * Returns the number of leading 0-bits in a value.
1799 *
1800 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001801 *
1802 * Supported by API versions 9 and newer.
1803 */
1804extern uchar __attribute__((const, overloadable))clz(uchar value);
1805#endif
1806
1807#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001808/**
1809 * Returns the number of leading 0-bits in a value.
1810 *
1811 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001812 *
1813 * Supported by API versions 9 and newer.
1814 */
1815extern uchar2 __attribute__((const, overloadable))clz(uchar2 value);
1816#endif
1817
1818#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001819/**
1820 * Returns the number of leading 0-bits in a value.
1821 *
1822 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001823 *
1824 * Supported by API versions 9 and newer.
1825 */
1826extern uchar3 __attribute__((const, overloadable))clz(uchar3 value);
1827#endif
1828
1829#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001830/**
1831 * Returns the number of leading 0-bits in a value.
1832 *
1833 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001834 *
1835 * Supported by API versions 9 and newer.
1836 */
1837extern uchar4 __attribute__((const, overloadable))clz(uchar4 value);
1838#endif
1839
1840#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001841/**
1842 * Returns the number of leading 0-bits in a value.
1843 *
1844 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001845 *
1846 * Supported by API versions 9 and newer.
1847 */
1848extern short __attribute__((const, overloadable))clz(short value);
1849#endif
1850
1851#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001852/**
1853 * Returns the number of leading 0-bits in a value.
1854 *
1855 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001856 *
1857 * Supported by API versions 9 and newer.
1858 */
1859extern short2 __attribute__((const, overloadable))clz(short2 value);
1860#endif
1861
1862#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001863/**
1864 * Returns the number of leading 0-bits in a value.
1865 *
1866 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001867 *
1868 * Supported by API versions 9 and newer.
1869 */
1870extern short3 __attribute__((const, overloadable))clz(short3 value);
1871#endif
1872
1873#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001874/**
1875 * Returns the number of leading 0-bits in a value.
1876 *
1877 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001878 *
1879 * Supported by API versions 9 and newer.
1880 */
1881extern short4 __attribute__((const, overloadable))clz(short4 value);
1882#endif
1883
1884#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001885/**
1886 * Returns the number of leading 0-bits in a value.
1887 *
1888 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001889 *
1890 * Supported by API versions 9 and newer.
1891 */
1892extern ushort __attribute__((const, overloadable))clz(ushort value);
1893#endif
1894
1895#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001896/**
1897 * Returns the number of leading 0-bits in a value.
1898 *
1899 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001900 *
1901 * Supported by API versions 9 and newer.
1902 */
1903extern ushort2 __attribute__((const, overloadable))clz(ushort2 value);
1904#endif
1905
1906#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001907/**
1908 * Returns the number of leading 0-bits in a value.
1909 *
1910 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001911 *
1912 * Supported by API versions 9 and newer.
1913 */
1914extern ushort3 __attribute__((const, overloadable))clz(ushort3 value);
1915#endif
1916
1917#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001918/**
1919 * Returns the number of leading 0-bits in a value.
1920 *
1921 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001922 *
1923 * Supported by API versions 9 and newer.
1924 */
1925extern ushort4 __attribute__((const, overloadable))clz(ushort4 value);
1926#endif
1927
1928#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001929/**
1930 * Returns the number of leading 0-bits in a value.
1931 *
1932 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001933 *
1934 * Supported by API versions 9 and newer.
1935 */
1936extern int __attribute__((const, overloadable))clz(int value);
1937#endif
1938
1939#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001940/**
1941 * Returns the number of leading 0-bits in a value.
1942 *
1943 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001944 *
1945 * Supported by API versions 9 and newer.
1946 */
1947extern int2 __attribute__((const, overloadable))clz(int2 value);
1948#endif
1949
1950#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001951/**
1952 * Returns the number of leading 0-bits in a value.
1953 *
1954 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001955 *
1956 * Supported by API versions 9 and newer.
1957 */
1958extern int3 __attribute__((const, overloadable))clz(int3 value);
1959#endif
1960
1961#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001962/**
1963 * Returns the number of leading 0-bits in a value.
1964 *
1965 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001966 *
1967 * Supported by API versions 9 and newer.
1968 */
1969extern int4 __attribute__((const, overloadable))clz(int4 value);
1970#endif
1971
1972#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001973/**
1974 * Returns the number of leading 0-bits in a value.
1975 *
1976 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001977 *
1978 * Supported by API versions 9 and newer.
1979 */
1980extern uint __attribute__((const, overloadable))clz(uint value);
1981#endif
1982
1983#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001984/**
1985 * Returns the number of leading 0-bits in a value.
1986 *
1987 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001988 *
1989 * Supported by API versions 9 and newer.
1990 */
1991extern uint2 __attribute__((const, overloadable))clz(uint2 value);
1992#endif
1993
1994#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08001995/**
1996 * Returns the number of leading 0-bits in a value.
1997 *
1998 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08001999 *
2000 * Supported by API versions 9 and newer.
2001 */
2002extern uint3 __attribute__((const, overloadable))clz(uint3 value);
2003#endif
2004
2005#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002006/**
2007 * Returns the number of leading 0-bits in a value.
2008 *
2009 * For example, clz((char)0x03) returns 5.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08002010 *
2011 * Supported by API versions 9 and newer.
2012 */
2013extern uint4 __attribute__((const, overloadable))clz(uint4 value);
2014#endif
2015
2016#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002017/**
2018 * Component wise conversion from float2 to float2.
2019 *
2020 * For the convert_* functions, conversions of floating point values to integer will truncate.
2021 * Conversions of numbers too large to fit the destination type yield undefined results.
2022 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002023 *
2024 * Supported by API versions 9 and newer.
2025 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002026extern float2 __attribute__((const, overloadable))convert_float2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002027#endif
2028
2029#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002030/**
2031 * Component wise conversion from float3 to float3.
2032 *
2033 * For the convert_* functions, conversions of floating point values to integer will truncate.
2034 * Conversions of numbers too large to fit the destination type yield undefined results.
2035 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002036 *
2037 * Supported by API versions 9 and newer.
2038 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002039extern float3 __attribute__((const, overloadable))convert_float3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002040#endif
2041
2042#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002043/**
2044 * Component wise conversion from float4 to float4.
2045 *
2046 * For the convert_* functions, conversions of floating point values to integer will truncate.
2047 * Conversions of numbers too large to fit the destination type yield undefined results.
2048 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002049 *
2050 * Supported by API versions 9 and newer.
2051 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002052extern float4 __attribute__((const, overloadable))convert_float4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002053#endif
2054
2055#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002056/**
2057 * Component wise conversion from char2 to float2.
2058 *
2059 * For the convert_* functions, conversions of floating point values to integer will truncate.
2060 * Conversions of numbers too large to fit the destination type yield undefined results.
2061 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002062 *
2063 * Supported by API versions 9 and newer.
2064 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002065extern float2 __attribute__((const, overloadable))convert_float2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002066#endif
2067
2068#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002069/**
2070 * Component wise conversion from char3 to float3.
2071 *
2072 * For the convert_* functions, conversions of floating point values to integer will truncate.
2073 * Conversions of numbers too large to fit the destination type yield undefined results.
2074 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002075 *
2076 * Supported by API versions 9 and newer.
2077 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002078extern float3 __attribute__((const, overloadable))convert_float3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002079#endif
2080
2081#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002082/**
2083 * Component wise conversion from char4 to float4.
2084 *
2085 * For the convert_* functions, conversions of floating point values to integer will truncate.
2086 * Conversions of numbers too large to fit the destination type yield undefined results.
2087 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002088 *
2089 * Supported by API versions 9 and newer.
2090 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002091extern float4 __attribute__((const, overloadable))convert_float4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002092#endif
2093
2094#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002095/**
2096 * Component wise conversion from uchar2 to float2.
2097 *
2098 * For the convert_* functions, conversions of floating point values to integer will truncate.
2099 * Conversions of numbers too large to fit the destination type yield undefined results.
2100 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002101 *
2102 * Supported by API versions 9 and newer.
2103 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002104extern float2 __attribute__((const, overloadable))convert_float2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002105#endif
2106
2107#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002108/**
2109 * Component wise conversion from uchar3 to float3.
2110 *
2111 * For the convert_* functions, conversions of floating point values to integer will truncate.
2112 * Conversions of numbers too large to fit the destination type yield undefined results.
2113 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002114 *
2115 * Supported by API versions 9 and newer.
2116 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002117extern float3 __attribute__((const, overloadable))convert_float3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002118#endif
2119
2120#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002121/**
2122 * Component wise conversion from uchar4 to float4.
2123 *
2124 * For the convert_* functions, conversions of floating point values to integer will truncate.
2125 * Conversions of numbers too large to fit the destination type yield undefined results.
2126 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002127 *
2128 * Supported by API versions 9 and newer.
2129 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002130extern float4 __attribute__((const, overloadable))convert_float4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002131#endif
2132
2133#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002134/**
2135 * Component wise conversion from short2 to float2.
2136 *
2137 * For the convert_* functions, conversions of floating point values to integer will truncate.
2138 * Conversions of numbers too large to fit the destination type yield undefined results.
2139 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002140 *
2141 * Supported by API versions 9 and newer.
2142 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002143extern float2 __attribute__((const, overloadable))convert_float2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002144#endif
2145
2146#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002147/**
2148 * Component wise conversion from short3 to float3.
2149 *
2150 * For the convert_* functions, conversions of floating point values to integer will truncate.
2151 * Conversions of numbers too large to fit the destination type yield undefined results.
2152 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002153 *
2154 * Supported by API versions 9 and newer.
2155 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002156extern float3 __attribute__((const, overloadable))convert_float3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002157#endif
2158
2159#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002160/**
2161 * Component wise conversion from short4 to float4.
2162 *
2163 * For the convert_* functions, conversions of floating point values to integer will truncate.
2164 * Conversions of numbers too large to fit the destination type yield undefined results.
2165 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002166 *
2167 * Supported by API versions 9 and newer.
2168 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002169extern float4 __attribute__((const, overloadable))convert_float4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002170#endif
2171
2172#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002173/**
2174 * Component wise conversion from ushort2 to float2.
2175 *
2176 * For the convert_* functions, conversions of floating point values to integer will truncate.
2177 * Conversions of numbers too large to fit the destination type yield undefined results.
2178 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002179 *
2180 * Supported by API versions 9 and newer.
2181 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002182extern float2 __attribute__((const, overloadable))convert_float2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002183#endif
2184
2185#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002186/**
2187 * Component wise conversion from ushort3 to float3.
2188 *
2189 * For the convert_* functions, conversions of floating point values to integer will truncate.
2190 * Conversions of numbers too large to fit the destination type yield undefined results.
2191 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002192 *
2193 * Supported by API versions 9 and newer.
2194 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002195extern float3 __attribute__((const, overloadable))convert_float3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002196#endif
2197
2198#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002199/**
2200 * Component wise conversion from ushort4 to float4.
2201 *
2202 * For the convert_* functions, conversions of floating point values to integer will truncate.
2203 * Conversions of numbers too large to fit the destination type yield undefined results.
2204 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002205 *
2206 * Supported by API versions 9 and newer.
2207 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002208extern float4 __attribute__((const, overloadable))convert_float4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002209#endif
2210
2211#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002212/**
2213 * Component wise conversion from int2 to float2.
2214 *
2215 * For the convert_* functions, conversions of floating point values to integer will truncate.
2216 * Conversions of numbers too large to fit the destination type yield undefined results.
2217 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002218 *
2219 * Supported by API versions 9 and newer.
2220 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002221extern float2 __attribute__((const, overloadable))convert_float2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002222#endif
2223
2224#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002225/**
2226 * Component wise conversion from int3 to float3.
2227 *
2228 * For the convert_* functions, conversions of floating point values to integer will truncate.
2229 * Conversions of numbers too large to fit the destination type yield undefined results.
2230 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002231 *
2232 * Supported by API versions 9 and newer.
2233 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002234extern float3 __attribute__((const, overloadable))convert_float3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002235#endif
2236
2237#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002238/**
2239 * Component wise conversion from int4 to float4.
2240 *
2241 * For the convert_* functions, conversions of floating point values to integer will truncate.
2242 * Conversions of numbers too large to fit the destination type yield undefined results.
2243 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002244 *
2245 * Supported by API versions 9 and newer.
2246 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002247extern float4 __attribute__((const, overloadable))convert_float4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002248#endif
2249
2250#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002251/**
2252 * Component wise conversion from uint2 to float2.
2253 *
2254 * For the convert_* functions, conversions of floating point values to integer will truncate.
2255 * Conversions of numbers too large to fit the destination type yield undefined results.
2256 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002257 *
2258 * Supported by API versions 9 and newer.
2259 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002260extern float2 __attribute__((const, overloadable))convert_float2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002261#endif
2262
2263#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002264/**
2265 * Component wise conversion from uint3 to float3.
2266 *
2267 * For the convert_* functions, conversions of floating point values to integer will truncate.
2268 * Conversions of numbers too large to fit the destination type yield undefined results.
2269 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002270 *
2271 * Supported by API versions 9 and newer.
2272 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002273extern float3 __attribute__((const, overloadable))convert_float3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002274#endif
2275
2276#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002277/**
2278 * Component wise conversion from uint4 to float4.
2279 *
2280 * For the convert_* functions, conversions of floating point values to integer will truncate.
2281 * Conversions of numbers too large to fit the destination type yield undefined results.
2282 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002283 *
2284 * Supported by API versions 9 and newer.
2285 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002286extern float4 __attribute__((const, overloadable))convert_float4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002287#endif
2288
2289#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002290/**
2291 * Component wise conversion from float2 to char2.
2292 *
2293 * For the convert_* functions, conversions of floating point values to integer will truncate.
2294 * Conversions of numbers too large to fit the destination type yield undefined results.
2295 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002296 *
2297 * Supported by API versions 9 and newer.
2298 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002299extern char2 __attribute__((const, overloadable))convert_char2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002300#endif
2301
2302#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002303/**
2304 * Component wise conversion from float3 to char3.
2305 *
2306 * For the convert_* functions, conversions of floating point values to integer will truncate.
2307 * Conversions of numbers too large to fit the destination type yield undefined results.
2308 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002309 *
2310 * Supported by API versions 9 and newer.
2311 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002312extern char3 __attribute__((const, overloadable))convert_char3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002313#endif
2314
2315#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002316/**
2317 * Component wise conversion from float4 to char4.
2318 *
2319 * For the convert_* functions, conversions of floating point values to integer will truncate.
2320 * Conversions of numbers too large to fit the destination type yield undefined results.
2321 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002322 *
2323 * Supported by API versions 9 and newer.
2324 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002325extern char4 __attribute__((const, overloadable))convert_char4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002326#endif
2327
2328#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002329/**
2330 * Component wise conversion from char2 to char2.
2331 *
2332 * For the convert_* functions, conversions of floating point values to integer will truncate.
2333 * Conversions of numbers too large to fit the destination type yield undefined results.
2334 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002335 *
2336 * Supported by API versions 9 and newer.
2337 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002338extern char2 __attribute__((const, overloadable))convert_char2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002339#endif
2340
2341#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002342/**
2343 * Component wise conversion from char3 to char3.
2344 *
2345 * For the convert_* functions, conversions of floating point values to integer will truncate.
2346 * Conversions of numbers too large to fit the destination type yield undefined results.
2347 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002348 *
2349 * Supported by API versions 9 and newer.
2350 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002351extern char3 __attribute__((const, overloadable))convert_char3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002352#endif
2353
2354#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002355/**
2356 * Component wise conversion from char4 to char4.
2357 *
2358 * For the convert_* functions, conversions of floating point values to integer will truncate.
2359 * Conversions of numbers too large to fit the destination type yield undefined results.
2360 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002361 *
2362 * Supported by API versions 9 and newer.
2363 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002364extern char4 __attribute__((const, overloadable))convert_char4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002365#endif
2366
2367#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002368/**
2369 * Component wise conversion from uchar2 to char2.
2370 *
2371 * For the convert_* functions, conversions of floating point values to integer will truncate.
2372 * Conversions of numbers too large to fit the destination type yield undefined results.
2373 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002374 *
2375 * Supported by API versions 9 and newer.
2376 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002377extern char2 __attribute__((const, overloadable))convert_char2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002378#endif
2379
2380#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002381/**
2382 * Component wise conversion from uchar3 to char3.
2383 *
2384 * For the convert_* functions, conversions of floating point values to integer will truncate.
2385 * Conversions of numbers too large to fit the destination type yield undefined results.
2386 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002387 *
2388 * Supported by API versions 9 and newer.
2389 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002390extern char3 __attribute__((const, overloadable))convert_char3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002391#endif
2392
2393#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002394/**
2395 * Component wise conversion from uchar4 to char4.
2396 *
2397 * For the convert_* functions, conversions of floating point values to integer will truncate.
2398 * Conversions of numbers too large to fit the destination type yield undefined results.
2399 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002400 *
2401 * Supported by API versions 9 and newer.
2402 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002403extern char4 __attribute__((const, overloadable))convert_char4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002404#endif
2405
2406#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002407/**
2408 * Component wise conversion from short2 to char2.
2409 *
2410 * For the convert_* functions, conversions of floating point values to integer will truncate.
2411 * Conversions of numbers too large to fit the destination type yield undefined results.
2412 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002413 *
2414 * Supported by API versions 9 and newer.
2415 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002416extern char2 __attribute__((const, overloadable))convert_char2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002417#endif
2418
2419#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002420/**
2421 * Component wise conversion from short3 to char3.
2422 *
2423 * For the convert_* functions, conversions of floating point values to integer will truncate.
2424 * Conversions of numbers too large to fit the destination type yield undefined results.
2425 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002426 *
2427 * Supported by API versions 9 and newer.
2428 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002429extern char3 __attribute__((const, overloadable))convert_char3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002430#endif
2431
2432#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002433/**
2434 * Component wise conversion from short4 to char4.
2435 *
2436 * For the convert_* functions, conversions of floating point values to integer will truncate.
2437 * Conversions of numbers too large to fit the destination type yield undefined results.
2438 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002439 *
2440 * Supported by API versions 9 and newer.
2441 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002442extern char4 __attribute__((const, overloadable))convert_char4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002443#endif
2444
2445#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002446/**
2447 * Component wise conversion from ushort2 to char2.
2448 *
2449 * For the convert_* functions, conversions of floating point values to integer will truncate.
2450 * Conversions of numbers too large to fit the destination type yield undefined results.
2451 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002452 *
2453 * Supported by API versions 9 and newer.
2454 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002455extern char2 __attribute__((const, overloadable))convert_char2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002456#endif
2457
2458#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002459/**
2460 * Component wise conversion from ushort3 to char3.
2461 *
2462 * For the convert_* functions, conversions of floating point values to integer will truncate.
2463 * Conversions of numbers too large to fit the destination type yield undefined results.
2464 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002465 *
2466 * Supported by API versions 9 and newer.
2467 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002468extern char3 __attribute__((const, overloadable))convert_char3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002469#endif
2470
2471#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002472/**
2473 * Component wise conversion from ushort4 to char4.
2474 *
2475 * For the convert_* functions, conversions of floating point values to integer will truncate.
2476 * Conversions of numbers too large to fit the destination type yield undefined results.
2477 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002478 *
2479 * Supported by API versions 9 and newer.
2480 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002481extern char4 __attribute__((const, overloadable))convert_char4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002482#endif
2483
2484#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002485/**
2486 * Component wise conversion from int2 to char2.
2487 *
2488 * For the convert_* functions, conversions of floating point values to integer will truncate.
2489 * Conversions of numbers too large to fit the destination type yield undefined results.
2490 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002491 *
2492 * Supported by API versions 9 and newer.
2493 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002494extern char2 __attribute__((const, overloadable))convert_char2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002495#endif
2496
2497#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002498/**
2499 * Component wise conversion from int3 to char3.
2500 *
2501 * For the convert_* functions, conversions of floating point values to integer will truncate.
2502 * Conversions of numbers too large to fit the destination type yield undefined results.
2503 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002504 *
2505 * Supported by API versions 9 and newer.
2506 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002507extern char3 __attribute__((const, overloadable))convert_char3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002508#endif
2509
2510#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002511/**
2512 * Component wise conversion from int4 to char4.
2513 *
2514 * For the convert_* functions, conversions of floating point values to integer will truncate.
2515 * Conversions of numbers too large to fit the destination type yield undefined results.
2516 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002517 *
2518 * Supported by API versions 9 and newer.
2519 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002520extern char4 __attribute__((const, overloadable))convert_char4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002521#endif
2522
2523#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002524/**
2525 * Component wise conversion from uint2 to char2.
2526 *
2527 * For the convert_* functions, conversions of floating point values to integer will truncate.
2528 * Conversions of numbers too large to fit the destination type yield undefined results.
2529 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002530 *
2531 * Supported by API versions 9 and newer.
2532 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002533extern char2 __attribute__((const, overloadable))convert_char2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002534#endif
2535
2536#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002537/**
2538 * Component wise conversion from uint3 to char3.
2539 *
2540 * For the convert_* functions, conversions of floating point values to integer will truncate.
2541 * Conversions of numbers too large to fit the destination type yield undefined results.
2542 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002543 *
2544 * Supported by API versions 9 and newer.
2545 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002546extern char3 __attribute__((const, overloadable))convert_char3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002547#endif
2548
2549#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002550/**
2551 * Component wise conversion from uint4 to char4.
2552 *
2553 * For the convert_* functions, conversions of floating point values to integer will truncate.
2554 * Conversions of numbers too large to fit the destination type yield undefined results.
2555 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002556 *
2557 * Supported by API versions 9 and newer.
2558 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002559extern char4 __attribute__((const, overloadable))convert_char4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002560#endif
2561
2562#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002563/**
2564 * Component wise conversion from float2 to uchar2.
2565 *
2566 * For the convert_* functions, conversions of floating point values to integer will truncate.
2567 * Conversions of numbers too large to fit the destination type yield undefined results.
2568 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002569 *
2570 * Supported by API versions 9 and newer.
2571 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002572extern uchar2 __attribute__((const, overloadable))convert_uchar2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002573#endif
2574
2575#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002576/**
2577 * Component wise conversion from float3 to uchar3.
2578 *
2579 * For the convert_* functions, conversions of floating point values to integer will truncate.
2580 * Conversions of numbers too large to fit the destination type yield undefined results.
2581 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002582 *
2583 * Supported by API versions 9 and newer.
2584 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002585extern uchar3 __attribute__((const, overloadable))convert_uchar3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002586#endif
2587
2588#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002589/**
2590 * Component wise conversion from float4 to uchar4.
2591 *
2592 * For the convert_* functions, conversions of floating point values to integer will truncate.
2593 * Conversions of numbers too large to fit the destination type yield undefined results.
2594 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002595 *
2596 * Supported by API versions 9 and newer.
2597 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002598extern uchar4 __attribute__((const, overloadable))convert_uchar4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002599#endif
2600
2601#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002602/**
2603 * Component wise conversion from char2 to uchar2.
2604 *
2605 * For the convert_* functions, conversions of floating point values to integer will truncate.
2606 * Conversions of numbers too large to fit the destination type yield undefined results.
2607 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002608 *
2609 * Supported by API versions 9 and newer.
2610 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002611extern uchar2 __attribute__((const, overloadable))convert_uchar2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002612#endif
2613
2614#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002615/**
2616 * Component wise conversion from char3 to uchar3.
2617 *
2618 * For the convert_* functions, conversions of floating point values to integer will truncate.
2619 * Conversions of numbers too large to fit the destination type yield undefined results.
2620 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002621 *
2622 * Supported by API versions 9 and newer.
2623 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002624extern uchar3 __attribute__((const, overloadable))convert_uchar3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002625#endif
2626
2627#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002628/**
2629 * Component wise conversion from char4 to uchar4.
2630 *
2631 * For the convert_* functions, conversions of floating point values to integer will truncate.
2632 * Conversions of numbers too large to fit the destination type yield undefined results.
2633 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002634 *
2635 * Supported by API versions 9 and newer.
2636 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002637extern uchar4 __attribute__((const, overloadable))convert_uchar4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002638#endif
2639
2640#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002641/**
2642 * Component wise conversion from uchar2 to uchar2.
2643 *
2644 * For the convert_* functions, conversions of floating point values to integer will truncate.
2645 * Conversions of numbers too large to fit the destination type yield undefined results.
2646 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002647 *
2648 * Supported by API versions 9 and newer.
2649 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002650extern uchar2 __attribute__((const, overloadable))convert_uchar2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002651#endif
2652
2653#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002654/**
2655 * Component wise conversion from uchar3 to uchar3.
2656 *
2657 * For the convert_* functions, conversions of floating point values to integer will truncate.
2658 * Conversions of numbers too large to fit the destination type yield undefined results.
2659 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002660 *
2661 * Supported by API versions 9 and newer.
2662 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002663extern uchar3 __attribute__((const, overloadable))convert_uchar3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002664#endif
2665
2666#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002667/**
2668 * Component wise conversion from uchar4 to uchar4.
2669 *
2670 * For the convert_* functions, conversions of floating point values to integer will truncate.
2671 * Conversions of numbers too large to fit the destination type yield undefined results.
2672 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002673 *
2674 * Supported by API versions 9 and newer.
2675 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002676extern uchar4 __attribute__((const, overloadable))convert_uchar4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002677#endif
2678
2679#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002680/**
2681 * Component wise conversion from short2 to uchar2.
2682 *
2683 * For the convert_* functions, conversions of floating point values to integer will truncate.
2684 * Conversions of numbers too large to fit the destination type yield undefined results.
2685 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002686 *
2687 * Supported by API versions 9 and newer.
2688 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002689extern uchar2 __attribute__((const, overloadable))convert_uchar2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002690#endif
2691
2692#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002693/**
2694 * Component wise conversion from short3 to uchar3.
2695 *
2696 * For the convert_* functions, conversions of floating point values to integer will truncate.
2697 * Conversions of numbers too large to fit the destination type yield undefined results.
2698 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002699 *
2700 * Supported by API versions 9 and newer.
2701 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002702extern uchar3 __attribute__((const, overloadable))convert_uchar3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002703#endif
2704
2705#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002706/**
2707 * Component wise conversion from short4 to uchar4.
2708 *
2709 * For the convert_* functions, conversions of floating point values to integer will truncate.
2710 * Conversions of numbers too large to fit the destination type yield undefined results.
2711 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002712 *
2713 * Supported by API versions 9 and newer.
2714 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002715extern uchar4 __attribute__((const, overloadable))convert_uchar4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002716#endif
2717
2718#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002719/**
2720 * Component wise conversion from ushort2 to uchar2.
2721 *
2722 * For the convert_* functions, conversions of floating point values to integer will truncate.
2723 * Conversions of numbers too large to fit the destination type yield undefined results.
2724 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002725 *
2726 * Supported by API versions 9 and newer.
2727 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002728extern uchar2 __attribute__((const, overloadable))convert_uchar2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002729#endif
2730
2731#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002732/**
2733 * Component wise conversion from ushort3 to uchar3.
2734 *
2735 * For the convert_* functions, conversions of floating point values to integer will truncate.
2736 * Conversions of numbers too large to fit the destination type yield undefined results.
2737 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002738 *
2739 * Supported by API versions 9 and newer.
2740 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002741extern uchar3 __attribute__((const, overloadable))convert_uchar3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002742#endif
2743
2744#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002745/**
2746 * Component wise conversion from ushort4 to uchar4.
2747 *
2748 * For the convert_* functions, conversions of floating point values to integer will truncate.
2749 * Conversions of numbers too large to fit the destination type yield undefined results.
2750 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002751 *
2752 * Supported by API versions 9 and newer.
2753 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002754extern uchar4 __attribute__((const, overloadable))convert_uchar4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002755#endif
2756
2757#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002758/**
2759 * Component wise conversion from int2 to uchar2.
2760 *
2761 * For the convert_* functions, conversions of floating point values to integer will truncate.
2762 * Conversions of numbers too large to fit the destination type yield undefined results.
2763 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002764 *
2765 * Supported by API versions 9 and newer.
2766 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002767extern uchar2 __attribute__((const, overloadable))convert_uchar2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002768#endif
2769
2770#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002771/**
2772 * Component wise conversion from int3 to uchar3.
2773 *
2774 * For the convert_* functions, conversions of floating point values to integer will truncate.
2775 * Conversions of numbers too large to fit the destination type yield undefined results.
2776 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002777 *
2778 * Supported by API versions 9 and newer.
2779 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002780extern uchar3 __attribute__((const, overloadable))convert_uchar3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002781#endif
2782
2783#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002784/**
2785 * Component wise conversion from int4 to uchar4.
2786 *
2787 * For the convert_* functions, conversions of floating point values to integer will truncate.
2788 * Conversions of numbers too large to fit the destination type yield undefined results.
2789 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002790 *
2791 * Supported by API versions 9 and newer.
2792 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002793extern uchar4 __attribute__((const, overloadable))convert_uchar4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002794#endif
2795
2796#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002797/**
2798 * Component wise conversion from uint2 to uchar2.
2799 *
2800 * For the convert_* functions, conversions of floating point values to integer will truncate.
2801 * Conversions of numbers too large to fit the destination type yield undefined results.
2802 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002803 *
2804 * Supported by API versions 9 and newer.
2805 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002806extern uchar2 __attribute__((const, overloadable))convert_uchar2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002807#endif
2808
2809#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002810/**
2811 * Component wise conversion from uint3 to uchar3.
2812 *
2813 * For the convert_* functions, conversions of floating point values to integer will truncate.
2814 * Conversions of numbers too large to fit the destination type yield undefined results.
2815 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002816 *
2817 * Supported by API versions 9 and newer.
2818 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002819extern uchar3 __attribute__((const, overloadable))convert_uchar3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002820#endif
2821
2822#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002823/**
2824 * Component wise conversion from uint4 to uchar4.
2825 *
2826 * For the convert_* functions, conversions of floating point values to integer will truncate.
2827 * Conversions of numbers too large to fit the destination type yield undefined results.
2828 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002829 *
2830 * Supported by API versions 9 and newer.
2831 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002832extern uchar4 __attribute__((const, overloadable))convert_uchar4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002833#endif
2834
2835#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002836/**
2837 * Component wise conversion from float2 to short2.
2838 *
2839 * For the convert_* functions, conversions of floating point values to integer will truncate.
2840 * Conversions of numbers too large to fit the destination type yield undefined results.
2841 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002842 *
2843 * Supported by API versions 9 and newer.
2844 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002845extern short2 __attribute__((const, overloadable))convert_short2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002846#endif
2847
2848#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002849/**
2850 * Component wise conversion from float3 to short3.
2851 *
2852 * For the convert_* functions, conversions of floating point values to integer will truncate.
2853 * Conversions of numbers too large to fit the destination type yield undefined results.
2854 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002855 *
2856 * Supported by API versions 9 and newer.
2857 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002858extern short3 __attribute__((const, overloadable))convert_short3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002859#endif
2860
2861#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002862/**
2863 * Component wise conversion from float4 to short4.
2864 *
2865 * For the convert_* functions, conversions of floating point values to integer will truncate.
2866 * Conversions of numbers too large to fit the destination type yield undefined results.
2867 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002868 *
2869 * Supported by API versions 9 and newer.
2870 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002871extern short4 __attribute__((const, overloadable))convert_short4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002872#endif
2873
2874#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002875/**
2876 * Component wise conversion from char2 to short2.
2877 *
2878 * For the convert_* functions, conversions of floating point values to integer will truncate.
2879 * Conversions of numbers too large to fit the destination type yield undefined results.
2880 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002881 *
2882 * Supported by API versions 9 and newer.
2883 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002884extern short2 __attribute__((const, overloadable))convert_short2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002885#endif
2886
2887#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002888/**
2889 * Component wise conversion from char3 to short3.
2890 *
2891 * For the convert_* functions, conversions of floating point values to integer will truncate.
2892 * Conversions of numbers too large to fit the destination type yield undefined results.
2893 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002894 *
2895 * Supported by API versions 9 and newer.
2896 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002897extern short3 __attribute__((const, overloadable))convert_short3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002898#endif
2899
2900#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002901/**
2902 * Component wise conversion from char4 to short4.
2903 *
2904 * For the convert_* functions, conversions of floating point values to integer will truncate.
2905 * Conversions of numbers too large to fit the destination type yield undefined results.
2906 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002907 *
2908 * Supported by API versions 9 and newer.
2909 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002910extern short4 __attribute__((const, overloadable))convert_short4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002911#endif
2912
2913#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002914/**
2915 * Component wise conversion from uchar2 to short2.
2916 *
2917 * For the convert_* functions, conversions of floating point values to integer will truncate.
2918 * Conversions of numbers too large to fit the destination type yield undefined results.
2919 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002920 *
2921 * Supported by API versions 9 and newer.
2922 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002923extern short2 __attribute__((const, overloadable))convert_short2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002924#endif
2925
2926#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002927/**
2928 * Component wise conversion from uchar3 to short3.
2929 *
2930 * For the convert_* functions, conversions of floating point values to integer will truncate.
2931 * Conversions of numbers too large to fit the destination type yield undefined results.
2932 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002933 *
2934 * Supported by API versions 9 and newer.
2935 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002936extern short3 __attribute__((const, overloadable))convert_short3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002937#endif
2938
2939#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002940/**
2941 * Component wise conversion from uchar4 to short4.
2942 *
2943 * For the convert_* functions, conversions of floating point values to integer will truncate.
2944 * Conversions of numbers too large to fit the destination type yield undefined results.
2945 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002946 *
2947 * Supported by API versions 9 and newer.
2948 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002949extern short4 __attribute__((const, overloadable))convert_short4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002950#endif
2951
2952#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002953/**
2954 * Component wise conversion from short2 to short2.
2955 *
2956 * For the convert_* functions, conversions of floating point values to integer will truncate.
2957 * Conversions of numbers too large to fit the destination type yield undefined results.
2958 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002959 *
2960 * Supported by API versions 9 and newer.
2961 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002962extern short2 __attribute__((const, overloadable))convert_short2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002963#endif
2964
2965#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002966/**
2967 * Component wise conversion from short3 to short3.
2968 *
2969 * For the convert_* functions, conversions of floating point values to integer will truncate.
2970 * Conversions of numbers too large to fit the destination type yield undefined results.
2971 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002972 *
2973 * Supported by API versions 9 and newer.
2974 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002975extern short3 __attribute__((const, overloadable))convert_short3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002976#endif
2977
2978#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002979/**
2980 * Component wise conversion from short4 to short4.
2981 *
2982 * For the convert_* functions, conversions of floating point values to integer will truncate.
2983 * Conversions of numbers too large to fit the destination type yield undefined results.
2984 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002985 *
2986 * Supported by API versions 9 and newer.
2987 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08002988extern short4 __attribute__((const, overloadable))convert_short4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08002989#endif
2990
2991#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08002992/**
2993 * Component wise conversion from ushort2 to short2.
2994 *
2995 * For the convert_* functions, conversions of floating point values to integer will truncate.
2996 * Conversions of numbers too large to fit the destination type yield undefined results.
2997 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08002998 *
2999 * Supported by API versions 9 and newer.
3000 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003001extern short2 __attribute__((const, overloadable))convert_short2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003002#endif
3003
3004#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003005/**
3006 * Component wise conversion from ushort3 to short3.
3007 *
3008 * For the convert_* functions, conversions of floating point values to integer will truncate.
3009 * Conversions of numbers too large to fit the destination type yield undefined results.
3010 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003011 *
3012 * Supported by API versions 9 and newer.
3013 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003014extern short3 __attribute__((const, overloadable))convert_short3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003015#endif
3016
3017#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003018/**
3019 * Component wise conversion from ushort4 to short4.
3020 *
3021 * For the convert_* functions, conversions of floating point values to integer will truncate.
3022 * Conversions of numbers too large to fit the destination type yield undefined results.
3023 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003024 *
3025 * Supported by API versions 9 and newer.
3026 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003027extern short4 __attribute__((const, overloadable))convert_short4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003028#endif
3029
3030#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003031/**
3032 * Component wise conversion from int2 to short2.
3033 *
3034 * For the convert_* functions, conversions of floating point values to integer will truncate.
3035 * Conversions of numbers too large to fit the destination type yield undefined results.
3036 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003037 *
3038 * Supported by API versions 9 and newer.
3039 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003040extern short2 __attribute__((const, overloadable))convert_short2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003041#endif
3042
3043#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003044/**
3045 * Component wise conversion from int3 to short3.
3046 *
3047 * For the convert_* functions, conversions of floating point values to integer will truncate.
3048 * Conversions of numbers too large to fit the destination type yield undefined results.
3049 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003050 *
3051 * Supported by API versions 9 and newer.
3052 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003053extern short3 __attribute__((const, overloadable))convert_short3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003054#endif
3055
3056#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003057/**
3058 * Component wise conversion from int4 to short4.
3059 *
3060 * For the convert_* functions, conversions of floating point values to integer will truncate.
3061 * Conversions of numbers too large to fit the destination type yield undefined results.
3062 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003063 *
3064 * Supported by API versions 9 and newer.
3065 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003066extern short4 __attribute__((const, overloadable))convert_short4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003067#endif
3068
3069#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003070/**
3071 * Component wise conversion from uint2 to short2.
3072 *
3073 * For the convert_* functions, conversions of floating point values to integer will truncate.
3074 * Conversions of numbers too large to fit the destination type yield undefined results.
3075 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003076 *
3077 * Supported by API versions 9 and newer.
3078 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003079extern short2 __attribute__((const, overloadable))convert_short2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003080#endif
3081
3082#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003083/**
3084 * Component wise conversion from uint3 to short3.
3085 *
3086 * For the convert_* functions, conversions of floating point values to integer will truncate.
3087 * Conversions of numbers too large to fit the destination type yield undefined results.
3088 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003089 *
3090 * Supported by API versions 9 and newer.
3091 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003092extern short3 __attribute__((const, overloadable))convert_short3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003093#endif
3094
3095#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003096/**
3097 * Component wise conversion from uint4 to short4.
3098 *
3099 * For the convert_* functions, conversions of floating point values to integer will truncate.
3100 * Conversions of numbers too large to fit the destination type yield undefined results.
3101 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003102 *
3103 * Supported by API versions 9 and newer.
3104 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003105extern short4 __attribute__((const, overloadable))convert_short4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003106#endif
3107
3108#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003109/**
3110 * Component wise conversion from float2 to ushort2.
3111 *
3112 * For the convert_* functions, conversions of floating point values to integer will truncate.
3113 * Conversions of numbers too large to fit the destination type yield undefined results.
3114 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003115 *
3116 * Supported by API versions 9 and newer.
3117 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003118extern ushort2 __attribute__((const, overloadable))convert_ushort2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003119#endif
3120
3121#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003122/**
3123 * Component wise conversion from float3 to ushort3.
3124 *
3125 * For the convert_* functions, conversions of floating point values to integer will truncate.
3126 * Conversions of numbers too large to fit the destination type yield undefined results.
3127 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003128 *
3129 * Supported by API versions 9 and newer.
3130 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003131extern ushort3 __attribute__((const, overloadable))convert_ushort3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003132#endif
3133
3134#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003135/**
3136 * Component wise conversion from float4 to ushort4.
3137 *
3138 * For the convert_* functions, conversions of floating point values to integer will truncate.
3139 * Conversions of numbers too large to fit the destination type yield undefined results.
3140 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003141 *
3142 * Supported by API versions 9 and newer.
3143 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003144extern ushort4 __attribute__((const, overloadable))convert_ushort4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003145#endif
3146
3147#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003148/**
3149 * Component wise conversion from char2 to ushort2.
3150 *
3151 * For the convert_* functions, conversions of floating point values to integer will truncate.
3152 * Conversions of numbers too large to fit the destination type yield undefined results.
3153 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003154 *
3155 * Supported by API versions 9 and newer.
3156 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003157extern ushort2 __attribute__((const, overloadable))convert_ushort2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003158#endif
3159
3160#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003161/**
3162 * Component wise conversion from char3 to ushort3.
3163 *
3164 * For the convert_* functions, conversions of floating point values to integer will truncate.
3165 * Conversions of numbers too large to fit the destination type yield undefined results.
3166 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003167 *
3168 * Supported by API versions 9 and newer.
3169 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003170extern ushort3 __attribute__((const, overloadable))convert_ushort3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003171#endif
3172
3173#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003174/**
3175 * Component wise conversion from char4 to ushort4.
3176 *
3177 * For the convert_* functions, conversions of floating point values to integer will truncate.
3178 * Conversions of numbers too large to fit the destination type yield undefined results.
3179 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003180 *
3181 * Supported by API versions 9 and newer.
3182 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003183extern ushort4 __attribute__((const, overloadable))convert_ushort4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003184#endif
3185
3186#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003187/**
3188 * Component wise conversion from uchar2 to ushort2.
3189 *
3190 * For the convert_* functions, conversions of floating point values to integer will truncate.
3191 * Conversions of numbers too large to fit the destination type yield undefined results.
3192 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003193 *
3194 * Supported by API versions 9 and newer.
3195 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003196extern ushort2 __attribute__((const, overloadable))convert_ushort2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003197#endif
3198
3199#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003200/**
3201 * Component wise conversion from uchar3 to ushort3.
3202 *
3203 * For the convert_* functions, conversions of floating point values to integer will truncate.
3204 * Conversions of numbers too large to fit the destination type yield undefined results.
3205 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003206 *
3207 * Supported by API versions 9 and newer.
3208 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003209extern ushort3 __attribute__((const, overloadable))convert_ushort3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003210#endif
3211
3212#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003213/**
3214 * Component wise conversion from uchar4 to ushort4.
3215 *
3216 * For the convert_* functions, conversions of floating point values to integer will truncate.
3217 * Conversions of numbers too large to fit the destination type yield undefined results.
3218 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003219 *
3220 * Supported by API versions 9 and newer.
3221 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003222extern ushort4 __attribute__((const, overloadable))convert_ushort4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003223#endif
3224
3225#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003226/**
3227 * Component wise conversion from short2 to ushort2.
3228 *
3229 * For the convert_* functions, conversions of floating point values to integer will truncate.
3230 * Conversions of numbers too large to fit the destination type yield undefined results.
3231 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003232 *
3233 * Supported by API versions 9 and newer.
3234 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003235extern ushort2 __attribute__((const, overloadable))convert_ushort2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003236#endif
3237
3238#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003239/**
3240 * Component wise conversion from short3 to ushort3.
3241 *
3242 * For the convert_* functions, conversions of floating point values to integer will truncate.
3243 * Conversions of numbers too large to fit the destination type yield undefined results.
3244 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003245 *
3246 * Supported by API versions 9 and newer.
3247 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003248extern ushort3 __attribute__((const, overloadable))convert_ushort3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003249#endif
3250
3251#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003252/**
3253 * Component wise conversion from short4 to ushort4.
3254 *
3255 * For the convert_* functions, conversions of floating point values to integer will truncate.
3256 * Conversions of numbers too large to fit the destination type yield undefined results.
3257 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003258 *
3259 * Supported by API versions 9 and newer.
3260 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003261extern ushort4 __attribute__((const, overloadable))convert_ushort4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003262#endif
3263
3264#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003265/**
3266 * Component wise conversion from ushort2 to ushort2.
3267 *
3268 * For the convert_* functions, conversions of floating point values to integer will truncate.
3269 * Conversions of numbers too large to fit the destination type yield undefined results.
3270 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003271 *
3272 * Supported by API versions 9 and newer.
3273 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003274extern ushort2 __attribute__((const, overloadable))convert_ushort2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003275#endif
3276
3277#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003278/**
3279 * Component wise conversion from ushort3 to ushort3.
3280 *
3281 * For the convert_* functions, conversions of floating point values to integer will truncate.
3282 * Conversions of numbers too large to fit the destination type yield undefined results.
3283 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003284 *
3285 * Supported by API versions 9 and newer.
3286 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003287extern ushort3 __attribute__((const, overloadable))convert_ushort3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003288#endif
3289
3290#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003291/**
3292 * Component wise conversion from ushort4 to ushort4.
3293 *
3294 * For the convert_* functions, conversions of floating point values to integer will truncate.
3295 * Conversions of numbers too large to fit the destination type yield undefined results.
3296 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003297 *
3298 * Supported by API versions 9 and newer.
3299 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003300extern ushort4 __attribute__((const, overloadable))convert_ushort4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003301#endif
3302
3303#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003304/**
3305 * Component wise conversion from int2 to ushort2.
3306 *
3307 * For the convert_* functions, conversions of floating point values to integer will truncate.
3308 * Conversions of numbers too large to fit the destination type yield undefined results.
3309 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003310 *
3311 * Supported by API versions 9 and newer.
3312 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003313extern ushort2 __attribute__((const, overloadable))convert_ushort2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003314#endif
3315
3316#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003317/**
3318 * Component wise conversion from int3 to ushort3.
3319 *
3320 * For the convert_* functions, conversions of floating point values to integer will truncate.
3321 * Conversions of numbers too large to fit the destination type yield undefined results.
3322 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003323 *
3324 * Supported by API versions 9 and newer.
3325 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003326extern ushort3 __attribute__((const, overloadable))convert_ushort3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003327#endif
3328
3329#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003330/**
3331 * Component wise conversion from int4 to ushort4.
3332 *
3333 * For the convert_* functions, conversions of floating point values to integer will truncate.
3334 * Conversions of numbers too large to fit the destination type yield undefined results.
3335 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003336 *
3337 * Supported by API versions 9 and newer.
3338 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003339extern ushort4 __attribute__((const, overloadable))convert_ushort4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003340#endif
3341
3342#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003343/**
3344 * Component wise conversion from uint2 to ushort2.
3345 *
3346 * For the convert_* functions, conversions of floating point values to integer will truncate.
3347 * Conversions of numbers too large to fit the destination type yield undefined results.
3348 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003349 *
3350 * Supported by API versions 9 and newer.
3351 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003352extern ushort2 __attribute__((const, overloadable))convert_ushort2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003353#endif
3354
3355#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003356/**
3357 * Component wise conversion from uint3 to ushort3.
3358 *
3359 * For the convert_* functions, conversions of floating point values to integer will truncate.
3360 * Conversions of numbers too large to fit the destination type yield undefined results.
3361 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003362 *
3363 * Supported by API versions 9 and newer.
3364 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003365extern ushort3 __attribute__((const, overloadable))convert_ushort3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003366#endif
3367
3368#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003369/**
3370 * Component wise conversion from uint4 to ushort4.
3371 *
3372 * For the convert_* functions, conversions of floating point values to integer will truncate.
3373 * Conversions of numbers too large to fit the destination type yield undefined results.
3374 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003375 *
3376 * Supported by API versions 9 and newer.
3377 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003378extern ushort4 __attribute__((const, overloadable))convert_ushort4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003379#endif
3380
3381#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003382/**
3383 * Component wise conversion from float2 to int2.
3384 *
3385 * For the convert_* functions, conversions of floating point values to integer will truncate.
3386 * Conversions of numbers too large to fit the destination type yield undefined results.
3387 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003388 *
3389 * Supported by API versions 9 and newer.
3390 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003391extern int2 __attribute__((const, overloadable))convert_int2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003392#endif
3393
3394#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003395/**
3396 * Component wise conversion from float3 to int3.
3397 *
3398 * For the convert_* functions, conversions of floating point values to integer will truncate.
3399 * Conversions of numbers too large to fit the destination type yield undefined results.
3400 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003401 *
3402 * Supported by API versions 9 and newer.
3403 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003404extern int3 __attribute__((const, overloadable))convert_int3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003405#endif
3406
3407#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003408/**
3409 * Component wise conversion from float4 to int4.
3410 *
3411 * For the convert_* functions, conversions of floating point values to integer will truncate.
3412 * Conversions of numbers too large to fit the destination type yield undefined results.
3413 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003414 *
3415 * Supported by API versions 9 and newer.
3416 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003417extern int4 __attribute__((const, overloadable))convert_int4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003418#endif
3419
3420#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003421/**
3422 * Component wise conversion from char2 to int2.
3423 *
3424 * For the convert_* functions, conversions of floating point values to integer will truncate.
3425 * Conversions of numbers too large to fit the destination type yield undefined results.
3426 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003427 *
3428 * Supported by API versions 9 and newer.
3429 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003430extern int2 __attribute__((const, overloadable))convert_int2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003431#endif
3432
3433#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003434/**
3435 * Component wise conversion from char3 to int3.
3436 *
3437 * For the convert_* functions, conversions of floating point values to integer will truncate.
3438 * Conversions of numbers too large to fit the destination type yield undefined results.
3439 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003440 *
3441 * Supported by API versions 9 and newer.
3442 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003443extern int3 __attribute__((const, overloadable))convert_int3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003444#endif
3445
3446#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003447/**
3448 * Component wise conversion from char4 to int4.
3449 *
3450 * For the convert_* functions, conversions of floating point values to integer will truncate.
3451 * Conversions of numbers too large to fit the destination type yield undefined results.
3452 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003453 *
3454 * Supported by API versions 9 and newer.
3455 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003456extern int4 __attribute__((const, overloadable))convert_int4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003457#endif
3458
3459#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003460/**
3461 * Component wise conversion from uchar2 to int2.
3462 *
3463 * For the convert_* functions, conversions of floating point values to integer will truncate.
3464 * Conversions of numbers too large to fit the destination type yield undefined results.
3465 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003466 *
3467 * Supported by API versions 9 and newer.
3468 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003469extern int2 __attribute__((const, overloadable))convert_int2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003470#endif
3471
3472#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003473/**
3474 * Component wise conversion from uchar3 to int3.
3475 *
3476 * For the convert_* functions, conversions of floating point values to integer will truncate.
3477 * Conversions of numbers too large to fit the destination type yield undefined results.
3478 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003479 *
3480 * Supported by API versions 9 and newer.
3481 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003482extern int3 __attribute__((const, overloadable))convert_int3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003483#endif
3484
3485#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003486/**
3487 * Component wise conversion from uchar4 to int4.
3488 *
3489 * For the convert_* functions, conversions of floating point values to integer will truncate.
3490 * Conversions of numbers too large to fit the destination type yield undefined results.
3491 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003492 *
3493 * Supported by API versions 9 and newer.
3494 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003495extern int4 __attribute__((const, overloadable))convert_int4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003496#endif
3497
3498#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003499/**
3500 * Component wise conversion from short2 to int2.
3501 *
3502 * For the convert_* functions, conversions of floating point values to integer will truncate.
3503 * Conversions of numbers too large to fit the destination type yield undefined results.
3504 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003505 *
3506 * Supported by API versions 9 and newer.
3507 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003508extern int2 __attribute__((const, overloadable))convert_int2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003509#endif
3510
3511#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003512/**
3513 * Component wise conversion from short3 to int3.
3514 *
3515 * For the convert_* functions, conversions of floating point values to integer will truncate.
3516 * Conversions of numbers too large to fit the destination type yield undefined results.
3517 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003518 *
3519 * Supported by API versions 9 and newer.
3520 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003521extern int3 __attribute__((const, overloadable))convert_int3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003522#endif
3523
3524#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003525/**
3526 * Component wise conversion from short4 to int4.
3527 *
3528 * For the convert_* functions, conversions of floating point values to integer will truncate.
3529 * Conversions of numbers too large to fit the destination type yield undefined results.
3530 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003531 *
3532 * Supported by API versions 9 and newer.
3533 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003534extern int4 __attribute__((const, overloadable))convert_int4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003535#endif
3536
3537#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003538/**
3539 * Component wise conversion from ushort2 to int2.
3540 *
3541 * For the convert_* functions, conversions of floating point values to integer will truncate.
3542 * Conversions of numbers too large to fit the destination type yield undefined results.
3543 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003544 *
3545 * Supported by API versions 9 and newer.
3546 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003547extern int2 __attribute__((const, overloadable))convert_int2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003548#endif
3549
3550#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003551/**
3552 * Component wise conversion from ushort3 to int3.
3553 *
3554 * For the convert_* functions, conversions of floating point values to integer will truncate.
3555 * Conversions of numbers too large to fit the destination type yield undefined results.
3556 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003557 *
3558 * Supported by API versions 9 and newer.
3559 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003560extern int3 __attribute__((const, overloadable))convert_int3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003561#endif
3562
3563#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003564/**
3565 * Component wise conversion from ushort4 to int4.
3566 *
3567 * For the convert_* functions, conversions of floating point values to integer will truncate.
3568 * Conversions of numbers too large to fit the destination type yield undefined results.
3569 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003570 *
3571 * Supported by API versions 9 and newer.
3572 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003573extern int4 __attribute__((const, overloadable))convert_int4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003574#endif
3575
3576#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003577/**
3578 * Component wise conversion from int2 to int2.
3579 *
3580 * For the convert_* functions, conversions of floating point values to integer will truncate.
3581 * Conversions of numbers too large to fit the destination type yield undefined results.
3582 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003583 *
3584 * Supported by API versions 9 and newer.
3585 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003586extern int2 __attribute__((const, overloadable))convert_int2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003587#endif
3588
3589#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003590/**
3591 * Component wise conversion from int3 to int3.
3592 *
3593 * For the convert_* functions, conversions of floating point values to integer will truncate.
3594 * Conversions of numbers too large to fit the destination type yield undefined results.
3595 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003596 *
3597 * Supported by API versions 9 and newer.
3598 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003599extern int3 __attribute__((const, overloadable))convert_int3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003600#endif
3601
3602#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003603/**
3604 * Component wise conversion from int4 to int4.
3605 *
3606 * For the convert_* functions, conversions of floating point values to integer will truncate.
3607 * Conversions of numbers too large to fit the destination type yield undefined results.
3608 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003609 *
3610 * Supported by API versions 9 and newer.
3611 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003612extern int4 __attribute__((const, overloadable))convert_int4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003613#endif
3614
3615#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003616/**
3617 * Component wise conversion from uint2 to int2.
3618 *
3619 * For the convert_* functions, conversions of floating point values to integer will truncate.
3620 * Conversions of numbers too large to fit the destination type yield undefined results.
3621 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003622 *
3623 * Supported by API versions 9 and newer.
3624 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003625extern int2 __attribute__((const, overloadable))convert_int2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003626#endif
3627
3628#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003629/**
3630 * Component wise conversion from uint3 to int3.
3631 *
3632 * For the convert_* functions, conversions of floating point values to integer will truncate.
3633 * Conversions of numbers too large to fit the destination type yield undefined results.
3634 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003635 *
3636 * Supported by API versions 9 and newer.
3637 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003638extern int3 __attribute__((const, overloadable))convert_int3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003639#endif
3640
3641#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003642/**
3643 * Component wise conversion from uint4 to int4.
3644 *
3645 * For the convert_* functions, conversions of floating point values to integer will truncate.
3646 * Conversions of numbers too large to fit the destination type yield undefined results.
3647 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003648 *
3649 * Supported by API versions 9 and newer.
3650 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003651extern int4 __attribute__((const, overloadable))convert_int4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003652#endif
3653
3654#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003655/**
3656 * Component wise conversion from float2 to uint2.
3657 *
3658 * For the convert_* functions, conversions of floating point values to integer will truncate.
3659 * Conversions of numbers too large to fit the destination type yield undefined results.
3660 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003661 *
3662 * Supported by API versions 9 and newer.
3663 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003664extern uint2 __attribute__((const, overloadable))convert_uint2(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003665#endif
3666
3667#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003668/**
3669 * Component wise conversion from float3 to uint3.
3670 *
3671 * For the convert_* functions, conversions of floating point values to integer will truncate.
3672 * Conversions of numbers too large to fit the destination type yield undefined results.
3673 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003674 *
3675 * Supported by API versions 9 and newer.
3676 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003677extern uint3 __attribute__((const, overloadable))convert_uint3(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003678#endif
3679
3680#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003681/**
3682 * Component wise conversion from float4 to uint4.
3683 *
3684 * For the convert_* functions, conversions of floating point values to integer will truncate.
3685 * Conversions of numbers too large to fit the destination type yield undefined results.
3686 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003687 *
3688 * Supported by API versions 9 and newer.
3689 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003690extern uint4 __attribute__((const, overloadable))convert_uint4(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003691#endif
3692
3693#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003694/**
3695 * Component wise conversion from char2 to uint2.
3696 *
3697 * For the convert_* functions, conversions of floating point values to integer will truncate.
3698 * Conversions of numbers too large to fit the destination type yield undefined results.
3699 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003700 *
3701 * Supported by API versions 9 and newer.
3702 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003703extern uint2 __attribute__((const, overloadable))convert_uint2(char2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003704#endif
3705
3706#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003707/**
3708 * Component wise conversion from char3 to uint3.
3709 *
3710 * For the convert_* functions, conversions of floating point values to integer will truncate.
3711 * Conversions of numbers too large to fit the destination type yield undefined results.
3712 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003713 *
3714 * Supported by API versions 9 and newer.
3715 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003716extern uint3 __attribute__((const, overloadable))convert_uint3(char3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003717#endif
3718
3719#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003720/**
3721 * Component wise conversion from char4 to uint4.
3722 *
3723 * For the convert_* functions, conversions of floating point values to integer will truncate.
3724 * Conversions of numbers too large to fit the destination type yield undefined results.
3725 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003726 *
3727 * Supported by API versions 9 and newer.
3728 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003729extern uint4 __attribute__((const, overloadable))convert_uint4(char4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003730#endif
3731
3732#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003733/**
3734 * Component wise conversion from uchar2 to uint2.
3735 *
3736 * For the convert_* functions, conversions of floating point values to integer will truncate.
3737 * Conversions of numbers too large to fit the destination type yield undefined results.
3738 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003739 *
3740 * Supported by API versions 9 and newer.
3741 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003742extern uint2 __attribute__((const, overloadable))convert_uint2(uchar2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003743#endif
3744
3745#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003746/**
3747 * Component wise conversion from uchar3 to uint3.
3748 *
3749 * For the convert_* functions, conversions of floating point values to integer will truncate.
3750 * Conversions of numbers too large to fit the destination type yield undefined results.
3751 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003752 *
3753 * Supported by API versions 9 and newer.
3754 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003755extern uint3 __attribute__((const, overloadable))convert_uint3(uchar3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003756#endif
3757
3758#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003759/**
3760 * Component wise conversion from uchar4 to uint4.
3761 *
3762 * For the convert_* functions, conversions of floating point values to integer will truncate.
3763 * Conversions of numbers too large to fit the destination type yield undefined results.
3764 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003765 *
3766 * Supported by API versions 9 and newer.
3767 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003768extern uint4 __attribute__((const, overloadable))convert_uint4(uchar4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003769#endif
3770
3771#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003772/**
3773 * Component wise conversion from short2 to uint2.
3774 *
3775 * For the convert_* functions, conversions of floating point values to integer will truncate.
3776 * Conversions of numbers too large to fit the destination type yield undefined results.
3777 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003778 *
3779 * Supported by API versions 9 and newer.
3780 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003781extern uint2 __attribute__((const, overloadable))convert_uint2(short2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003782#endif
3783
3784#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003785/**
3786 * Component wise conversion from short3 to uint3.
3787 *
3788 * For the convert_* functions, conversions of floating point values to integer will truncate.
3789 * Conversions of numbers too large to fit the destination type yield undefined results.
3790 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003791 *
3792 * Supported by API versions 9 and newer.
3793 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003794extern uint3 __attribute__((const, overloadable))convert_uint3(short3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003795#endif
3796
3797#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003798/**
3799 * Component wise conversion from short4 to uint4.
3800 *
3801 * For the convert_* functions, conversions of floating point values to integer will truncate.
3802 * Conversions of numbers too large to fit the destination type yield undefined results.
3803 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003804 *
3805 * Supported by API versions 9 and newer.
3806 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003807extern uint4 __attribute__((const, overloadable))convert_uint4(short4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003808#endif
3809
3810#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003811/**
3812 * Component wise conversion from ushort2 to uint2.
3813 *
3814 * For the convert_* functions, conversions of floating point values to integer will truncate.
3815 * Conversions of numbers too large to fit the destination type yield undefined results.
3816 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003817 *
3818 * Supported by API versions 9 and newer.
3819 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003820extern uint2 __attribute__((const, overloadable))convert_uint2(ushort2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003821#endif
3822
3823#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003824/**
3825 * Component wise conversion from ushort3 to uint3.
3826 *
3827 * For the convert_* functions, conversions of floating point values to integer will truncate.
3828 * Conversions of numbers too large to fit the destination type yield undefined results.
3829 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003830 *
3831 * Supported by API versions 9 and newer.
3832 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003833extern uint3 __attribute__((const, overloadable))convert_uint3(ushort3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003834#endif
3835
3836#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003837/**
3838 * Component wise conversion from ushort4 to uint4.
3839 *
3840 * For the convert_* functions, conversions of floating point values to integer will truncate.
3841 * Conversions of numbers too large to fit the destination type yield undefined results.
3842 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003843 *
3844 * Supported by API versions 9 and newer.
3845 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003846extern uint4 __attribute__((const, overloadable))convert_uint4(ushort4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003847#endif
3848
3849#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003850/**
3851 * Component wise conversion from int2 to uint2.
3852 *
3853 * For the convert_* functions, conversions of floating point values to integer will truncate.
3854 * Conversions of numbers too large to fit the destination type yield undefined results.
3855 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003856 *
3857 * Supported by API versions 9 and newer.
3858 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003859extern uint2 __attribute__((const, overloadable))convert_uint2(int2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003860#endif
3861
3862#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003863/**
3864 * Component wise conversion from int3 to uint3.
3865 *
3866 * For the convert_* functions, conversions of floating point values to integer will truncate.
3867 * Conversions of numbers too large to fit the destination type yield undefined results.
3868 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003869 *
3870 * Supported by API versions 9 and newer.
3871 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003872extern uint3 __attribute__((const, overloadable))convert_uint3(int3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003873#endif
3874
3875#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003876/**
3877 * Component wise conversion from int4 to uint4.
3878 *
3879 * For the convert_* functions, conversions of floating point values to integer will truncate.
3880 * Conversions of numbers too large to fit the destination type yield undefined results.
3881 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003882 *
3883 * Supported by API versions 9 and newer.
3884 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003885extern uint4 __attribute__((const, overloadable))convert_uint4(int4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003886#endif
3887
3888#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003889/**
3890 * Component wise conversion from uint2 to uint2.
3891 *
3892 * For the convert_* functions, conversions of floating point values to integer will truncate.
3893 * Conversions of numbers too large to fit the destination type yield undefined results.
3894 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003895 *
3896 * Supported by API versions 9 and newer.
3897 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003898extern uint2 __attribute__((const, overloadable))convert_uint2(uint2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003899#endif
3900
3901#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003902/**
3903 * Component wise conversion from uint3 to uint3.
3904 *
3905 * For the convert_* functions, conversions of floating point values to integer will truncate.
3906 * Conversions of numbers too large to fit the destination type yield undefined results.
3907 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003908 *
3909 * Supported by API versions 9 and newer.
3910 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003911extern uint3 __attribute__((const, overloadable))convert_uint3(uint3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003912#endif
3913
3914#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003915/**
3916 * Component wise conversion from uint4 to uint4.
3917 *
3918 * For the convert_* functions, conversions of floating point values to integer will truncate.
3919 * Conversions of numbers too large to fit the destination type yield undefined results.
3920 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08003921 *
3922 * Supported by API versions 9 and newer.
3923 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08003924extern uint4 __attribute__((const, overloadable))convert_uint4(uint4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08003925#endif
3926
Jason Samsaa456932014-08-18 16:20:51 -07003927#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003928/**
3929 * Component wise conversion from double2 to double2.
3930 *
3931 * For the convert_* functions, conversions of floating point values to integer will truncate.
3932 * Conversions of numbers too large to fit the destination type yield undefined results.
3933 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07003934 *
Jason Samsaa456932014-08-18 16:20:51 -07003935 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07003936 */
3937extern double2 __attribute__((const, overloadable))convert_double2(double2 v);
3938#endif
3939
Jason Samsaa456932014-08-18 16:20:51 -07003940#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003941/**
3942 * Component wise conversion from double3 to double3.
3943 *
3944 * For the convert_* functions, conversions of floating point values to integer will truncate.
3945 * Conversions of numbers too large to fit the destination type yield undefined results.
3946 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07003947 *
Jason Samsaa456932014-08-18 16:20:51 -07003948 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07003949 */
3950extern double3 __attribute__((const, overloadable))convert_double3(double3 v);
3951#endif
3952
Jason Samsaa456932014-08-18 16:20:51 -07003953#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003954/**
3955 * Component wise conversion from double4 to double4.
3956 *
3957 * For the convert_* functions, conversions of floating point values to integer will truncate.
3958 * Conversions of numbers too large to fit the destination type yield undefined results.
3959 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07003960 *
Jason Samsaa456932014-08-18 16:20:51 -07003961 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07003962 */
3963extern double4 __attribute__((const, overloadable))convert_double4(double4 v);
3964#endif
3965
Jason Samsaa456932014-08-18 16:20:51 -07003966#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003967/**
3968 * Component wise conversion from long2 to double2.
3969 *
3970 * For the convert_* functions, conversions of floating point values to integer will truncate.
3971 * Conversions of numbers too large to fit the destination type yield undefined results.
3972 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07003973 *
Jason Samsaa456932014-08-18 16:20:51 -07003974 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07003975 */
3976extern double2 __attribute__((const, overloadable))convert_double2(long2 v);
3977#endif
3978
Jason Samsaa456932014-08-18 16:20:51 -07003979#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003980/**
3981 * Component wise conversion from long3 to double3.
3982 *
3983 * For the convert_* functions, conversions of floating point values to integer will truncate.
3984 * Conversions of numbers too large to fit the destination type yield undefined results.
3985 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07003986 *
Jason Samsaa456932014-08-18 16:20:51 -07003987 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07003988 */
3989extern double3 __attribute__((const, overloadable))convert_double3(long3 v);
3990#endif
3991
Jason Samsaa456932014-08-18 16:20:51 -07003992#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08003993/**
3994 * Component wise conversion from long4 to double4.
3995 *
3996 * For the convert_* functions, conversions of floating point values to integer will truncate.
3997 * Conversions of numbers too large to fit the destination type yield undefined results.
3998 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07003999 *
Jason Samsaa456932014-08-18 16:20:51 -07004000 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004001 */
4002extern double4 __attribute__((const, overloadable))convert_double4(long4 v);
4003#endif
4004
Jason Samsaa456932014-08-18 16:20:51 -07004005#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004006/**
4007 * Component wise conversion from ulong2 to double2.
4008 *
4009 * For the convert_* functions, conversions of floating point values to integer will truncate.
4010 * Conversions of numbers too large to fit the destination type yield undefined results.
4011 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004012 *
Jason Samsaa456932014-08-18 16:20:51 -07004013 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004014 */
4015extern double2 __attribute__((const, overloadable))convert_double2(ulong2 v);
4016#endif
4017
Jason Samsaa456932014-08-18 16:20:51 -07004018#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004019/**
4020 * Component wise conversion from ulong3 to double3.
4021 *
4022 * For the convert_* functions, conversions of floating point values to integer will truncate.
4023 * Conversions of numbers too large to fit the destination type yield undefined results.
4024 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004025 *
Jason Samsaa456932014-08-18 16:20:51 -07004026 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004027 */
4028extern double3 __attribute__((const, overloadable))convert_double3(ulong3 v);
4029#endif
4030
Jason Samsaa456932014-08-18 16:20:51 -07004031#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004032/**
4033 * Component wise conversion from ulong4 to double4.
4034 *
4035 * For the convert_* functions, conversions of floating point values to integer will truncate.
4036 * Conversions of numbers too large to fit the destination type yield undefined results.
4037 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004038 *
Jason Samsaa456932014-08-18 16:20:51 -07004039 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004040 */
4041extern double4 __attribute__((const, overloadable))convert_double4(ulong4 v);
4042#endif
4043
Jason Samsaa456932014-08-18 16:20:51 -07004044#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004045/**
4046 * Component wise conversion from double2 to long2.
4047 *
4048 * For the convert_* functions, conversions of floating point values to integer will truncate.
4049 * Conversions of numbers too large to fit the destination type yield undefined results.
4050 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004051 *
Jason Samsaa456932014-08-18 16:20:51 -07004052 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004053 */
4054extern long2 __attribute__((const, overloadable))convert_long2(double2 v);
4055#endif
4056
Jason Samsaa456932014-08-18 16:20:51 -07004057#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004058/**
4059 * Component wise conversion from double3 to long3.
4060 *
4061 * For the convert_* functions, conversions of floating point values to integer will truncate.
4062 * Conversions of numbers too large to fit the destination type yield undefined results.
4063 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004064 *
Jason Samsaa456932014-08-18 16:20:51 -07004065 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004066 */
4067extern long3 __attribute__((const, overloadable))convert_long3(double3 v);
4068#endif
4069
Jason Samsaa456932014-08-18 16:20:51 -07004070#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004071/**
4072 * Component wise conversion from double4 to long4.
4073 *
4074 * For the convert_* functions, conversions of floating point values to integer will truncate.
4075 * Conversions of numbers too large to fit the destination type yield undefined results.
4076 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004077 *
Jason Samsaa456932014-08-18 16:20:51 -07004078 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004079 */
4080extern long4 __attribute__((const, overloadable))convert_long4(double4 v);
4081#endif
4082
Jason Samsaa456932014-08-18 16:20:51 -07004083#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004084/**
4085 * Component wise conversion from long2 to long2.
4086 *
4087 * For the convert_* functions, conversions of floating point values to integer will truncate.
4088 * Conversions of numbers too large to fit the destination type yield undefined results.
4089 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004090 *
Jason Samsaa456932014-08-18 16:20:51 -07004091 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004092 */
4093extern long2 __attribute__((const, overloadable))convert_long2(long2 v);
4094#endif
4095
Jason Samsaa456932014-08-18 16:20:51 -07004096#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004097/**
4098 * Component wise conversion from long3 to long3.
4099 *
4100 * For the convert_* functions, conversions of floating point values to integer will truncate.
4101 * Conversions of numbers too large to fit the destination type yield undefined results.
4102 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004103 *
Jason Samsaa456932014-08-18 16:20:51 -07004104 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004105 */
4106extern long3 __attribute__((const, overloadable))convert_long3(long3 v);
4107#endif
4108
Jason Samsaa456932014-08-18 16:20:51 -07004109#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004110/**
4111 * Component wise conversion from long4 to long4.
4112 *
4113 * For the convert_* functions, conversions of floating point values to integer will truncate.
4114 * Conversions of numbers too large to fit the destination type yield undefined results.
4115 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004116 *
Jason Samsaa456932014-08-18 16:20:51 -07004117 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004118 */
4119extern long4 __attribute__((const, overloadable))convert_long4(long4 v);
4120#endif
4121
Jason Samsaa456932014-08-18 16:20:51 -07004122#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004123/**
4124 * Component wise conversion from ulong2 to long2.
4125 *
4126 * For the convert_* functions, conversions of floating point values to integer will truncate.
4127 * Conversions of numbers too large to fit the destination type yield undefined results.
4128 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004129 *
Jason Samsaa456932014-08-18 16:20:51 -07004130 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004131 */
4132extern long2 __attribute__((const, overloadable))convert_long2(ulong2 v);
4133#endif
4134
Jason Samsaa456932014-08-18 16:20:51 -07004135#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004136/**
4137 * Component wise conversion from ulong3 to long3.
4138 *
4139 * For the convert_* functions, conversions of floating point values to integer will truncate.
4140 * Conversions of numbers too large to fit the destination type yield undefined results.
4141 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004142 *
Jason Samsaa456932014-08-18 16:20:51 -07004143 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004144 */
4145extern long3 __attribute__((const, overloadable))convert_long3(ulong3 v);
4146#endif
4147
Jason Samsaa456932014-08-18 16:20:51 -07004148#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004149/**
4150 * Component wise conversion from ulong4 to long4.
4151 *
4152 * For the convert_* functions, conversions of floating point values to integer will truncate.
4153 * Conversions of numbers too large to fit the destination type yield undefined results.
4154 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004155 *
Jason Samsaa456932014-08-18 16:20:51 -07004156 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004157 */
4158extern long4 __attribute__((const, overloadable))convert_long4(ulong4 v);
4159#endif
4160
Jason Samsaa456932014-08-18 16:20:51 -07004161#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004162/**
4163 * Component wise conversion from double2 to ulong2.
4164 *
4165 * For the convert_* functions, conversions of floating point values to integer will truncate.
4166 * Conversions of numbers too large to fit the destination type yield undefined results.
4167 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004168 *
Jason Samsaa456932014-08-18 16:20:51 -07004169 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004170 */
4171extern ulong2 __attribute__((const, overloadable))convert_ulong2(double2 v);
4172#endif
4173
Jason Samsaa456932014-08-18 16:20:51 -07004174#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004175/**
4176 * Component wise conversion from double3 to ulong3.
4177 *
4178 * For the convert_* functions, conversions of floating point values to integer will truncate.
4179 * Conversions of numbers too large to fit the destination type yield undefined results.
4180 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004181 *
Jason Samsaa456932014-08-18 16:20:51 -07004182 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004183 */
4184extern ulong3 __attribute__((const, overloadable))convert_ulong3(double3 v);
4185#endif
4186
Jason Samsaa456932014-08-18 16:20:51 -07004187#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004188/**
4189 * Component wise conversion from double4 to ulong4.
4190 *
4191 * For the convert_* functions, conversions of floating point values to integer will truncate.
4192 * Conversions of numbers too large to fit the destination type yield undefined results.
4193 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004194 *
Jason Samsaa456932014-08-18 16:20:51 -07004195 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004196 */
4197extern ulong4 __attribute__((const, overloadable))convert_ulong4(double4 v);
4198#endif
4199
Jason Samsaa456932014-08-18 16:20:51 -07004200#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004201/**
4202 * Component wise conversion from long2 to ulong2.
4203 *
4204 * For the convert_* functions, conversions of floating point values to integer will truncate.
4205 * Conversions of numbers too large to fit the destination type yield undefined results.
4206 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004207 *
Jason Samsaa456932014-08-18 16:20:51 -07004208 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004209 */
4210extern ulong2 __attribute__((const, overloadable))convert_ulong2(long2 v);
4211#endif
4212
Jason Samsaa456932014-08-18 16:20:51 -07004213#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004214/**
4215 * Component wise conversion from long3 to ulong3.
4216 *
4217 * For the convert_* functions, conversions of floating point values to integer will truncate.
4218 * Conversions of numbers too large to fit the destination type yield undefined results.
4219 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004220 *
Jason Samsaa456932014-08-18 16:20:51 -07004221 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004222 */
4223extern ulong3 __attribute__((const, overloadable))convert_ulong3(long3 v);
4224#endif
4225
Jason Samsaa456932014-08-18 16:20:51 -07004226#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004227/**
4228 * Component wise conversion from long4 to ulong4.
4229 *
4230 * For the convert_* functions, conversions of floating point values to integer will truncate.
4231 * Conversions of numbers too large to fit the destination type yield undefined results.
4232 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004233 *
Jason Samsaa456932014-08-18 16:20:51 -07004234 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004235 */
4236extern ulong4 __attribute__((const, overloadable))convert_ulong4(long4 v);
4237#endif
4238
Jason Samsaa456932014-08-18 16:20:51 -07004239#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004240/**
4241 * Component wise conversion from ulong2 to ulong2.
4242 *
4243 * For the convert_* functions, conversions of floating point values to integer will truncate.
4244 * Conversions of numbers too large to fit the destination type yield undefined results.
4245 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004246 *
Jason Samsaa456932014-08-18 16:20:51 -07004247 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004248 */
4249extern ulong2 __attribute__((const, overloadable))convert_ulong2(ulong2 v);
4250#endif
4251
Jason Samsaa456932014-08-18 16:20:51 -07004252#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004253/**
4254 * Component wise conversion from ulong3 to ulong3.
4255 *
4256 * For the convert_* functions, conversions of floating point values to integer will truncate.
4257 * Conversions of numbers too large to fit the destination type yield undefined results.
4258 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004259 *
Jason Samsaa456932014-08-18 16:20:51 -07004260 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004261 */
4262extern ulong3 __attribute__((const, overloadable))convert_ulong3(ulong3 v);
4263#endif
4264
Jason Samsaa456932014-08-18 16:20:51 -07004265#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004266/**
4267 * Component wise conversion from ulong4 to ulong4.
4268 *
4269 * For the convert_* functions, conversions of floating point values to integer will truncate.
4270 * Conversions of numbers too large to fit the destination type yield undefined results.
4271 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004272 *
Jason Samsaa456932014-08-18 16:20:51 -07004273 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004274 */
4275extern ulong4 __attribute__((const, overloadable))convert_ulong4(ulong4 v);
4276#endif
4277
Jason Samsaa456932014-08-18 16:20:51 -07004278#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004279/**
4280 * Component wise conversion from double2 to float2.
4281 *
4282 * For the convert_* functions, conversions of floating point values to integer will truncate.
4283 * Conversions of numbers too large to fit the destination type yield undefined results.
4284 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004285 *
Jason Samsaa456932014-08-18 16:20:51 -07004286 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004287 */
4288extern float2 __attribute__((const, overloadable))convert_float2(double2 v);
4289#endif
4290
Jason Samsaa456932014-08-18 16:20:51 -07004291#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004292/**
4293 * Component wise conversion from double3 to float3.
4294 *
4295 * For the convert_* functions, conversions of floating point values to integer will truncate.
4296 * Conversions of numbers too large to fit the destination type yield undefined results.
4297 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004298 *
Jason Samsaa456932014-08-18 16:20:51 -07004299 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004300 */
4301extern float3 __attribute__((const, overloadable))convert_float3(double3 v);
4302#endif
4303
Jason Samsaa456932014-08-18 16:20:51 -07004304#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004305/**
4306 * Component wise conversion from double4 to float4.
4307 *
4308 * For the convert_* functions, conversions of floating point values to integer will truncate.
4309 * Conversions of numbers too large to fit the destination type yield undefined results.
4310 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004311 *
Jason Samsaa456932014-08-18 16:20:51 -07004312 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004313 */
4314extern float4 __attribute__((const, overloadable))convert_float4(double4 v);
4315#endif
4316
Jason Samsaa456932014-08-18 16:20:51 -07004317#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004318/**
4319 * Component wise conversion from long2 to float2.
4320 *
4321 * For the convert_* functions, conversions of floating point values to integer will truncate.
4322 * Conversions of numbers too large to fit the destination type yield undefined results.
4323 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004324 *
Jason Samsaa456932014-08-18 16:20:51 -07004325 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004326 */
4327extern float2 __attribute__((const, overloadable))convert_float2(long2 v);
4328#endif
4329
Jason Samsaa456932014-08-18 16:20:51 -07004330#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004331/**
4332 * Component wise conversion from long3 to float3.
4333 *
4334 * For the convert_* functions, conversions of floating point values to integer will truncate.
4335 * Conversions of numbers too large to fit the destination type yield undefined results.
4336 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004337 *
Jason Samsaa456932014-08-18 16:20:51 -07004338 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004339 */
4340extern float3 __attribute__((const, overloadable))convert_float3(long3 v);
4341#endif
4342
Jason Samsaa456932014-08-18 16:20:51 -07004343#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004344/**
4345 * Component wise conversion from long4 to float4.
4346 *
4347 * For the convert_* functions, conversions of floating point values to integer will truncate.
4348 * Conversions of numbers too large to fit the destination type yield undefined results.
4349 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004350 *
Jason Samsaa456932014-08-18 16:20:51 -07004351 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004352 */
4353extern float4 __attribute__((const, overloadable))convert_float4(long4 v);
4354#endif
4355
Jason Samsaa456932014-08-18 16:20:51 -07004356#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004357/**
4358 * Component wise conversion from ulong2 to float2.
4359 *
4360 * For the convert_* functions, conversions of floating point values to integer will truncate.
4361 * Conversions of numbers too large to fit the destination type yield undefined results.
4362 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004363 *
Jason Samsaa456932014-08-18 16:20:51 -07004364 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004365 */
4366extern float2 __attribute__((const, overloadable))convert_float2(ulong2 v);
4367#endif
4368
Jason Samsaa456932014-08-18 16:20:51 -07004369#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004370/**
4371 * Component wise conversion from ulong3 to float3.
4372 *
4373 * For the convert_* functions, conversions of floating point values to integer will truncate.
4374 * Conversions of numbers too large to fit the destination type yield undefined results.
4375 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004376 *
Jason Samsaa456932014-08-18 16:20:51 -07004377 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004378 */
4379extern float3 __attribute__((const, overloadable))convert_float3(ulong3 v);
4380#endif
4381
Jason Samsaa456932014-08-18 16:20:51 -07004382#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004383/**
4384 * Component wise conversion from ulong4 to float4.
4385 *
4386 * For the convert_* functions, conversions of floating point values to integer will truncate.
4387 * Conversions of numbers too large to fit the destination type yield undefined results.
4388 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004389 *
Jason Samsaa456932014-08-18 16:20:51 -07004390 * Supported by API versions 21 and newer.
Jean-Luc Brouillet46ebc972014-05-05 20:33:25 -07004391 */
4392extern float4 __attribute__((const, overloadable))convert_float4(ulong4 v);
4393#endif
4394
Jason Samsaa456932014-08-18 16:20:51 -07004395#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004396/**
4397 * Component wise conversion from double2 to char2.
4398 *
4399 * For the convert_* functions, conversions of floating point values to integer will truncate.
4400 * Conversions of numbers too large to fit the destination type yield undefined results.
4401 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004402 *
Jason Samsaa456932014-08-18 16:20:51 -07004403 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004404 */
4405extern char2 __attribute__((const, overloadable))convert_char2(double2 v);
4406#endif
4407
Jason Samsaa456932014-08-18 16:20:51 -07004408#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004409/**
4410 * Component wise conversion from double3 to char3.
4411 *
4412 * For the convert_* functions, conversions of floating point values to integer will truncate.
4413 * Conversions of numbers too large to fit the destination type yield undefined results.
4414 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004415 *
Jason Samsaa456932014-08-18 16:20:51 -07004416 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004417 */
4418extern char3 __attribute__((const, overloadable))convert_char3(double3 v);
4419#endif
4420
Jason Samsaa456932014-08-18 16:20:51 -07004421#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004422/**
4423 * Component wise conversion from double4 to char4.
4424 *
4425 * For the convert_* functions, conversions of floating point values to integer will truncate.
4426 * Conversions of numbers too large to fit the destination type yield undefined results.
4427 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004428 *
Jason Samsaa456932014-08-18 16:20:51 -07004429 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004430 */
4431extern char4 __attribute__((const, overloadable))convert_char4(double4 v);
4432#endif
4433
Jason Samsaa456932014-08-18 16:20:51 -07004434#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004435/**
4436 * Component wise conversion from long2 to char2.
4437 *
4438 * For the convert_* functions, conversions of floating point values to integer will truncate.
4439 * Conversions of numbers too large to fit the destination type yield undefined results.
4440 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004441 *
Jason Samsaa456932014-08-18 16:20:51 -07004442 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004443 */
4444extern char2 __attribute__((const, overloadable))convert_char2(long2 v);
4445#endif
4446
Jason Samsaa456932014-08-18 16:20:51 -07004447#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004448/**
4449 * Component wise conversion from long3 to char3.
4450 *
4451 * For the convert_* functions, conversions of floating point values to integer will truncate.
4452 * Conversions of numbers too large to fit the destination type yield undefined results.
4453 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004454 *
Jason Samsaa456932014-08-18 16:20:51 -07004455 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004456 */
4457extern char3 __attribute__((const, overloadable))convert_char3(long3 v);
4458#endif
4459
Jason Samsaa456932014-08-18 16:20:51 -07004460#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004461/**
4462 * Component wise conversion from long4 to char4.
4463 *
4464 * For the convert_* functions, conversions of floating point values to integer will truncate.
4465 * Conversions of numbers too large to fit the destination type yield undefined results.
4466 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004467 *
Jason Samsaa456932014-08-18 16:20:51 -07004468 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004469 */
4470extern char4 __attribute__((const, overloadable))convert_char4(long4 v);
4471#endif
4472
Jason Samsaa456932014-08-18 16:20:51 -07004473#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004474/**
4475 * Component wise conversion from ulong2 to char2.
4476 *
4477 * For the convert_* functions, conversions of floating point values to integer will truncate.
4478 * Conversions of numbers too large to fit the destination type yield undefined results.
4479 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004480 *
Jason Samsaa456932014-08-18 16:20:51 -07004481 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004482 */
4483extern char2 __attribute__((const, overloadable))convert_char2(ulong2 v);
4484#endif
4485
Jason Samsaa456932014-08-18 16:20:51 -07004486#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004487/**
4488 * Component wise conversion from ulong3 to char3.
4489 *
4490 * For the convert_* functions, conversions of floating point values to integer will truncate.
4491 * Conversions of numbers too large to fit the destination type yield undefined results.
4492 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004493 *
Jason Samsaa456932014-08-18 16:20:51 -07004494 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004495 */
4496extern char3 __attribute__((const, overloadable))convert_char3(ulong3 v);
4497#endif
4498
Jason Samsaa456932014-08-18 16:20:51 -07004499#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004500/**
4501 * Component wise conversion from ulong4 to char4.
4502 *
4503 * For the convert_* functions, conversions of floating point values to integer will truncate.
4504 * Conversions of numbers too large to fit the destination type yield undefined results.
4505 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004506 *
Jason Samsaa456932014-08-18 16:20:51 -07004507 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004508 */
4509extern char4 __attribute__((const, overloadable))convert_char4(ulong4 v);
4510#endif
4511
Jason Samsaa456932014-08-18 16:20:51 -07004512#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004513/**
4514 * Component wise conversion from double2 to uchar2.
4515 *
4516 * For the convert_* functions, conversions of floating point values to integer will truncate.
4517 * Conversions of numbers too large to fit the destination type yield undefined results.
4518 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004519 *
Jason Samsaa456932014-08-18 16:20:51 -07004520 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004521 */
4522extern uchar2 __attribute__((const, overloadable))convert_uchar2(double2 v);
4523#endif
4524
Jason Samsaa456932014-08-18 16:20:51 -07004525#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004526/**
4527 * Component wise conversion from double3 to uchar3.
4528 *
4529 * For the convert_* functions, conversions of floating point values to integer will truncate.
4530 * Conversions of numbers too large to fit the destination type yield undefined results.
4531 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004532 *
Jason Samsaa456932014-08-18 16:20:51 -07004533 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004534 */
4535extern uchar3 __attribute__((const, overloadable))convert_uchar3(double3 v);
4536#endif
4537
Jason Samsaa456932014-08-18 16:20:51 -07004538#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004539/**
4540 * Component wise conversion from double4 to uchar4.
4541 *
4542 * For the convert_* functions, conversions of floating point values to integer will truncate.
4543 * Conversions of numbers too large to fit the destination type yield undefined results.
4544 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004545 *
Jason Samsaa456932014-08-18 16:20:51 -07004546 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004547 */
4548extern uchar4 __attribute__((const, overloadable))convert_uchar4(double4 v);
4549#endif
4550
Jason Samsaa456932014-08-18 16:20:51 -07004551#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004552/**
4553 * Component wise conversion from long2 to uchar2.
4554 *
4555 * For the convert_* functions, conversions of floating point values to integer will truncate.
4556 * Conversions of numbers too large to fit the destination type yield undefined results.
4557 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004558 *
Jason Samsaa456932014-08-18 16:20:51 -07004559 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004560 */
4561extern uchar2 __attribute__((const, overloadable))convert_uchar2(long2 v);
4562#endif
4563
Jason Samsaa456932014-08-18 16:20:51 -07004564#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004565/**
4566 * Component wise conversion from long3 to uchar3.
4567 *
4568 * For the convert_* functions, conversions of floating point values to integer will truncate.
4569 * Conversions of numbers too large to fit the destination type yield undefined results.
4570 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004571 *
Jason Samsaa456932014-08-18 16:20:51 -07004572 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004573 */
4574extern uchar3 __attribute__((const, overloadable))convert_uchar3(long3 v);
4575#endif
4576
Jason Samsaa456932014-08-18 16:20:51 -07004577#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004578/**
4579 * Component wise conversion from long4 to uchar4.
4580 *
4581 * For the convert_* functions, conversions of floating point values to integer will truncate.
4582 * Conversions of numbers too large to fit the destination type yield undefined results.
4583 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004584 *
Jason Samsaa456932014-08-18 16:20:51 -07004585 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004586 */
4587extern uchar4 __attribute__((const, overloadable))convert_uchar4(long4 v);
4588#endif
4589
Jason Samsaa456932014-08-18 16:20:51 -07004590#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004591/**
4592 * Component wise conversion from ulong2 to uchar2.
4593 *
4594 * For the convert_* functions, conversions of floating point values to integer will truncate.
4595 * Conversions of numbers too large to fit the destination type yield undefined results.
4596 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004597 *
Jason Samsaa456932014-08-18 16:20:51 -07004598 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004599 */
4600extern uchar2 __attribute__((const, overloadable))convert_uchar2(ulong2 v);
4601#endif
4602
Jason Samsaa456932014-08-18 16:20:51 -07004603#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004604/**
4605 * Component wise conversion from ulong3 to uchar3.
4606 *
4607 * For the convert_* functions, conversions of floating point values to integer will truncate.
4608 * Conversions of numbers too large to fit the destination type yield undefined results.
4609 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004610 *
Jason Samsaa456932014-08-18 16:20:51 -07004611 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004612 */
4613extern uchar3 __attribute__((const, overloadable))convert_uchar3(ulong3 v);
4614#endif
4615
Jason Samsaa456932014-08-18 16:20:51 -07004616#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004617/**
4618 * Component wise conversion from ulong4 to uchar4.
4619 *
4620 * For the convert_* functions, conversions of floating point values to integer will truncate.
4621 * Conversions of numbers too large to fit the destination type yield undefined results.
4622 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004623 *
Jason Samsaa456932014-08-18 16:20:51 -07004624 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004625 */
4626extern uchar4 __attribute__((const, overloadable))convert_uchar4(ulong4 v);
4627#endif
4628
Jason Samsaa456932014-08-18 16:20:51 -07004629#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004630/**
4631 * Component wise conversion from double2 to short2.
4632 *
4633 * For the convert_* functions, conversions of floating point values to integer will truncate.
4634 * Conversions of numbers too large to fit the destination type yield undefined results.
4635 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004636 *
Jason Samsaa456932014-08-18 16:20:51 -07004637 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004638 */
4639extern short2 __attribute__((const, overloadable))convert_short2(double2 v);
4640#endif
4641
Jason Samsaa456932014-08-18 16:20:51 -07004642#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004643/**
4644 * Component wise conversion from double3 to short3.
4645 *
4646 * For the convert_* functions, conversions of floating point values to integer will truncate.
4647 * Conversions of numbers too large to fit the destination type yield undefined results.
4648 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004649 *
Jason Samsaa456932014-08-18 16:20:51 -07004650 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004651 */
4652extern short3 __attribute__((const, overloadable))convert_short3(double3 v);
4653#endif
4654
Jason Samsaa456932014-08-18 16:20:51 -07004655#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004656/**
4657 * Component wise conversion from double4 to short4.
4658 *
4659 * For the convert_* functions, conversions of floating point values to integer will truncate.
4660 * Conversions of numbers too large to fit the destination type yield undefined results.
4661 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004662 *
Jason Samsaa456932014-08-18 16:20:51 -07004663 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004664 */
4665extern short4 __attribute__((const, overloadable))convert_short4(double4 v);
4666#endif
4667
Jason Samsaa456932014-08-18 16:20:51 -07004668#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004669/**
4670 * Component wise conversion from long2 to short2.
4671 *
4672 * For the convert_* functions, conversions of floating point values to integer will truncate.
4673 * Conversions of numbers too large to fit the destination type yield undefined results.
4674 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004675 *
Jason Samsaa456932014-08-18 16:20:51 -07004676 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004677 */
4678extern short2 __attribute__((const, overloadable))convert_short2(long2 v);
4679#endif
4680
Jason Samsaa456932014-08-18 16:20:51 -07004681#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004682/**
4683 * Component wise conversion from long3 to short3.
4684 *
4685 * For the convert_* functions, conversions of floating point values to integer will truncate.
4686 * Conversions of numbers too large to fit the destination type yield undefined results.
4687 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004688 *
Jason Samsaa456932014-08-18 16:20:51 -07004689 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004690 */
4691extern short3 __attribute__((const, overloadable))convert_short3(long3 v);
4692#endif
4693
Jason Samsaa456932014-08-18 16:20:51 -07004694#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004695/**
4696 * Component wise conversion from long4 to short4.
4697 *
4698 * For the convert_* functions, conversions of floating point values to integer will truncate.
4699 * Conversions of numbers too large to fit the destination type yield undefined results.
4700 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004701 *
Jason Samsaa456932014-08-18 16:20:51 -07004702 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004703 */
4704extern short4 __attribute__((const, overloadable))convert_short4(long4 v);
4705#endif
4706
Jason Samsaa456932014-08-18 16:20:51 -07004707#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004708/**
4709 * Component wise conversion from ulong2 to short2.
4710 *
4711 * For the convert_* functions, conversions of floating point values to integer will truncate.
4712 * Conversions of numbers too large to fit the destination type yield undefined results.
4713 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004714 *
Jason Samsaa456932014-08-18 16:20:51 -07004715 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004716 */
4717extern short2 __attribute__((const, overloadable))convert_short2(ulong2 v);
4718#endif
4719
Jason Samsaa456932014-08-18 16:20:51 -07004720#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004721/**
4722 * Component wise conversion from ulong3 to short3.
4723 *
4724 * For the convert_* functions, conversions of floating point values to integer will truncate.
4725 * Conversions of numbers too large to fit the destination type yield undefined results.
4726 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004727 *
Jason Samsaa456932014-08-18 16:20:51 -07004728 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004729 */
4730extern short3 __attribute__((const, overloadable))convert_short3(ulong3 v);
4731#endif
4732
Jason Samsaa456932014-08-18 16:20:51 -07004733#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004734/**
4735 * Component wise conversion from ulong4 to short4.
4736 *
4737 * For the convert_* functions, conversions of floating point values to integer will truncate.
4738 * Conversions of numbers too large to fit the destination type yield undefined results.
4739 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004740 *
Jason Samsaa456932014-08-18 16:20:51 -07004741 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004742 */
4743extern short4 __attribute__((const, overloadable))convert_short4(ulong4 v);
4744#endif
4745
Jason Samsaa456932014-08-18 16:20:51 -07004746#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004747/**
4748 * Component wise conversion from double2 to ushort2.
4749 *
4750 * For the convert_* functions, conversions of floating point values to integer will truncate.
4751 * Conversions of numbers too large to fit the destination type yield undefined results.
4752 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004753 *
Jason Samsaa456932014-08-18 16:20:51 -07004754 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004755 */
4756extern ushort2 __attribute__((const, overloadable))convert_ushort2(double2 v);
4757#endif
4758
Jason Samsaa456932014-08-18 16:20:51 -07004759#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004760/**
4761 * Component wise conversion from double3 to ushort3.
4762 *
4763 * For the convert_* functions, conversions of floating point values to integer will truncate.
4764 * Conversions of numbers too large to fit the destination type yield undefined results.
4765 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004766 *
Jason Samsaa456932014-08-18 16:20:51 -07004767 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004768 */
4769extern ushort3 __attribute__((const, overloadable))convert_ushort3(double3 v);
4770#endif
4771
Jason Samsaa456932014-08-18 16:20:51 -07004772#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004773/**
4774 * Component wise conversion from double4 to ushort4.
4775 *
4776 * For the convert_* functions, conversions of floating point values to integer will truncate.
4777 * Conversions of numbers too large to fit the destination type yield undefined results.
4778 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004779 *
Jason Samsaa456932014-08-18 16:20:51 -07004780 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004781 */
4782extern ushort4 __attribute__((const, overloadable))convert_ushort4(double4 v);
4783#endif
4784
Jason Samsaa456932014-08-18 16:20:51 -07004785#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004786/**
4787 * Component wise conversion from long2 to ushort2.
4788 *
4789 * For the convert_* functions, conversions of floating point values to integer will truncate.
4790 * Conversions of numbers too large to fit the destination type yield undefined results.
4791 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004792 *
Jason Samsaa456932014-08-18 16:20:51 -07004793 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004794 */
4795extern ushort2 __attribute__((const, overloadable))convert_ushort2(long2 v);
4796#endif
4797
Jason Samsaa456932014-08-18 16:20:51 -07004798#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004799/**
4800 * Component wise conversion from long3 to ushort3.
4801 *
4802 * For the convert_* functions, conversions of floating point values to integer will truncate.
4803 * Conversions of numbers too large to fit the destination type yield undefined results.
4804 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004805 *
Jason Samsaa456932014-08-18 16:20:51 -07004806 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004807 */
4808extern ushort3 __attribute__((const, overloadable))convert_ushort3(long3 v);
4809#endif
4810
Jason Samsaa456932014-08-18 16:20:51 -07004811#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004812/**
4813 * Component wise conversion from long4 to ushort4.
4814 *
4815 * For the convert_* functions, conversions of floating point values to integer will truncate.
4816 * Conversions of numbers too large to fit the destination type yield undefined results.
4817 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004818 *
Jason Samsaa456932014-08-18 16:20:51 -07004819 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004820 */
4821extern ushort4 __attribute__((const, overloadable))convert_ushort4(long4 v);
4822#endif
4823
Jason Samsaa456932014-08-18 16:20:51 -07004824#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004825/**
4826 * Component wise conversion from ulong2 to ushort2.
4827 *
4828 * For the convert_* functions, conversions of floating point values to integer will truncate.
4829 * Conversions of numbers too large to fit the destination type yield undefined results.
4830 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004831 *
Jason Samsaa456932014-08-18 16:20:51 -07004832 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004833 */
4834extern ushort2 __attribute__((const, overloadable))convert_ushort2(ulong2 v);
4835#endif
4836
Jason Samsaa456932014-08-18 16:20:51 -07004837#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004838/**
4839 * Component wise conversion from ulong3 to ushort3.
4840 *
4841 * For the convert_* functions, conversions of floating point values to integer will truncate.
4842 * Conversions of numbers too large to fit the destination type yield undefined results.
4843 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004844 *
Jason Samsaa456932014-08-18 16:20:51 -07004845 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004846 */
4847extern ushort3 __attribute__((const, overloadable))convert_ushort3(ulong3 v);
4848#endif
4849
Jason Samsaa456932014-08-18 16:20:51 -07004850#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004851/**
4852 * Component wise conversion from ulong4 to ushort4.
4853 *
4854 * For the convert_* functions, conversions of floating point values to integer will truncate.
4855 * Conversions of numbers too large to fit the destination type yield undefined results.
4856 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004857 *
Jason Samsaa456932014-08-18 16:20:51 -07004858 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004859 */
4860extern ushort4 __attribute__((const, overloadable))convert_ushort4(ulong4 v);
4861#endif
4862
Jason Samsaa456932014-08-18 16:20:51 -07004863#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004864/**
4865 * Component wise conversion from double2 to int2.
4866 *
4867 * For the convert_* functions, conversions of floating point values to integer will truncate.
4868 * Conversions of numbers too large to fit the destination type yield undefined results.
4869 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004870 *
Jason Samsaa456932014-08-18 16:20:51 -07004871 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004872 */
4873extern int2 __attribute__((const, overloadable))convert_int2(double2 v);
4874#endif
4875
Jason Samsaa456932014-08-18 16:20:51 -07004876#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004877/**
4878 * Component wise conversion from double3 to int3.
4879 *
4880 * For the convert_* functions, conversions of floating point values to integer will truncate.
4881 * Conversions of numbers too large to fit the destination type yield undefined results.
4882 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004883 *
Jason Samsaa456932014-08-18 16:20:51 -07004884 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004885 */
4886extern int3 __attribute__((const, overloadable))convert_int3(double3 v);
4887#endif
4888
Jason Samsaa456932014-08-18 16:20:51 -07004889#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004890/**
4891 * Component wise conversion from double4 to int4.
4892 *
4893 * For the convert_* functions, conversions of floating point values to integer will truncate.
4894 * Conversions of numbers too large to fit the destination type yield undefined results.
4895 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004896 *
Jason Samsaa456932014-08-18 16:20:51 -07004897 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004898 */
4899extern int4 __attribute__((const, overloadable))convert_int4(double4 v);
4900#endif
4901
Jason Samsaa456932014-08-18 16:20:51 -07004902#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004903/**
4904 * Component wise conversion from long2 to int2.
4905 *
4906 * For the convert_* functions, conversions of floating point values to integer will truncate.
4907 * Conversions of numbers too large to fit the destination type yield undefined results.
4908 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004909 *
Jason Samsaa456932014-08-18 16:20:51 -07004910 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004911 */
4912extern int2 __attribute__((const, overloadable))convert_int2(long2 v);
4913#endif
4914
Jason Samsaa456932014-08-18 16:20:51 -07004915#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004916/**
4917 * Component wise conversion from long3 to int3.
4918 *
4919 * For the convert_* functions, conversions of floating point values to integer will truncate.
4920 * Conversions of numbers too large to fit the destination type yield undefined results.
4921 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004922 *
Jason Samsaa456932014-08-18 16:20:51 -07004923 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004924 */
4925extern int3 __attribute__((const, overloadable))convert_int3(long3 v);
4926#endif
4927
Jason Samsaa456932014-08-18 16:20:51 -07004928#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004929/**
4930 * Component wise conversion from long4 to int4.
4931 *
4932 * For the convert_* functions, conversions of floating point values to integer will truncate.
4933 * Conversions of numbers too large to fit the destination type yield undefined results.
4934 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004935 *
Jason Samsaa456932014-08-18 16:20:51 -07004936 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004937 */
4938extern int4 __attribute__((const, overloadable))convert_int4(long4 v);
4939#endif
4940
Jason Samsaa456932014-08-18 16:20:51 -07004941#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004942/**
4943 * Component wise conversion from ulong2 to int2.
4944 *
4945 * For the convert_* functions, conversions of floating point values to integer will truncate.
4946 * Conversions of numbers too large to fit the destination type yield undefined results.
4947 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004948 *
Jason Samsaa456932014-08-18 16:20:51 -07004949 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004950 */
4951extern int2 __attribute__((const, overloadable))convert_int2(ulong2 v);
4952#endif
4953
Jason Samsaa456932014-08-18 16:20:51 -07004954#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004955/**
4956 * Component wise conversion from ulong3 to int3.
4957 *
4958 * For the convert_* functions, conversions of floating point values to integer will truncate.
4959 * Conversions of numbers too large to fit the destination type yield undefined results.
4960 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004961 *
Jason Samsaa456932014-08-18 16:20:51 -07004962 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004963 */
4964extern int3 __attribute__((const, overloadable))convert_int3(ulong3 v);
4965#endif
4966
Jason Samsaa456932014-08-18 16:20:51 -07004967#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004968/**
4969 * Component wise conversion from ulong4 to int4.
4970 *
4971 * For the convert_* functions, conversions of floating point values to integer will truncate.
4972 * Conversions of numbers too large to fit the destination type yield undefined results.
4973 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004974 *
Jason Samsaa456932014-08-18 16:20:51 -07004975 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004976 */
4977extern int4 __attribute__((const, overloadable))convert_int4(ulong4 v);
4978#endif
4979
Jason Samsaa456932014-08-18 16:20:51 -07004980#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004981/**
4982 * Component wise conversion from double2 to uint2.
4983 *
4984 * For the convert_* functions, conversions of floating point values to integer will truncate.
4985 * Conversions of numbers too large to fit the destination type yield undefined results.
4986 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07004987 *
Jason Samsaa456932014-08-18 16:20:51 -07004988 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07004989 */
4990extern uint2 __attribute__((const, overloadable))convert_uint2(double2 v);
4991#endif
4992
Jason Samsaa456932014-08-18 16:20:51 -07004993#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08004994/**
4995 * Component wise conversion from double3 to uint3.
4996 *
4997 * For the convert_* functions, conversions of floating point values to integer will truncate.
4998 * Conversions of numbers too large to fit the destination type yield undefined results.
4999 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005000 *
Jason Samsaa456932014-08-18 16:20:51 -07005001 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005002 */
5003extern uint3 __attribute__((const, overloadable))convert_uint3(double3 v);
5004#endif
5005
Jason Samsaa456932014-08-18 16:20:51 -07005006#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005007/**
5008 * Component wise conversion from double4 to uint4.
5009 *
5010 * For the convert_* functions, conversions of floating point values to integer will truncate.
5011 * Conversions of numbers too large to fit the destination type yield undefined results.
5012 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005013 *
Jason Samsaa456932014-08-18 16:20:51 -07005014 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005015 */
5016extern uint4 __attribute__((const, overloadable))convert_uint4(double4 v);
5017#endif
5018
Jason Samsaa456932014-08-18 16:20:51 -07005019#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005020/**
5021 * Component wise conversion from long2 to uint2.
5022 *
5023 * For the convert_* functions, conversions of floating point values to integer will truncate.
5024 * Conversions of numbers too large to fit the destination type yield undefined results.
5025 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08005026 *
Jason Samsaa456932014-08-18 16:20:51 -07005027 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08005028 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08005029extern uint2 __attribute__((const, overloadable))convert_uint2(long2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005030#endif
5031
Jason Samsaa456932014-08-18 16:20:51 -07005032#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005033/**
5034 * Component wise conversion from long3 to uint3.
5035 *
5036 * For the convert_* functions, conversions of floating point values to integer will truncate.
5037 * Conversions of numbers too large to fit the destination type yield undefined results.
5038 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08005039 *
Jason Samsaa456932014-08-18 16:20:51 -07005040 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08005041 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08005042extern uint3 __attribute__((const, overloadable))convert_uint3(long3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005043#endif
5044
Jason Samsaa456932014-08-18 16:20:51 -07005045#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005046/**
5047 * Component wise conversion from long4 to uint4.
5048 *
5049 * For the convert_* functions, conversions of floating point values to integer will truncate.
5050 * Conversions of numbers too large to fit the destination type yield undefined results.
5051 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08005052 *
Jason Samsaa456932014-08-18 16:20:51 -07005053 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08005054 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08005055extern uint4 __attribute__((const, overloadable))convert_uint4(long4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005056#endif
5057
Jason Samsaa456932014-08-18 16:20:51 -07005058#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005059/**
5060 * Component wise conversion from ulong2 to uint2.
5061 *
5062 * For the convert_* functions, conversions of floating point values to integer will truncate.
5063 * Conversions of numbers too large to fit the destination type yield undefined results.
5064 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08005065 *
Jason Samsaa456932014-08-18 16:20:51 -07005066 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08005067 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08005068extern uint2 __attribute__((const, overloadable))convert_uint2(ulong2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005069#endif
5070
Jason Samsaa456932014-08-18 16:20:51 -07005071#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005072/**
5073 * Component wise conversion from ulong3 to uint3.
5074 *
5075 * For the convert_* functions, conversions of floating point values to integer will truncate.
5076 * Conversions of numbers too large to fit the destination type yield undefined results.
5077 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08005078 *
Jason Samsaa456932014-08-18 16:20:51 -07005079 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08005080 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08005081extern uint3 __attribute__((const, overloadable))convert_uint3(ulong3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005082#endif
5083
Jason Samsaa456932014-08-18 16:20:51 -07005084#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005085/**
5086 * Component wise conversion from ulong4 to uint4.
5087 *
5088 * For the convert_* functions, conversions of floating point values to integer will truncate.
5089 * Conversions of numbers too large to fit the destination type yield undefined results.
5090 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams29087fa2014-01-09 17:06:17 -08005091 *
Jason Samsaa456932014-08-18 16:20:51 -07005092 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08005093 */
Jean-Luc Brouilletbcd5b9a2014-03-07 18:00:57 -08005094extern uint4 __attribute__((const, overloadable))convert_uint4(ulong4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08005095#endif
5096
Jason Samsaa456932014-08-18 16:20:51 -07005097#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005098/**
5099 * Component wise conversion from float2 to double2.
5100 *
5101 * For the convert_* functions, conversions of floating point values to integer will truncate.
5102 * Conversions of numbers too large to fit the destination type yield undefined results.
5103 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005104 *
Jason Samsaa456932014-08-18 16:20:51 -07005105 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005106 */
5107extern double2 __attribute__((const, overloadable))convert_double2(float2 v);
5108#endif
5109
Jason Samsaa456932014-08-18 16:20:51 -07005110#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005111/**
5112 * Component wise conversion from float3 to double3.
5113 *
5114 * For the convert_* functions, conversions of floating point values to integer will truncate.
5115 * Conversions of numbers too large to fit the destination type yield undefined results.
5116 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005117 *
Jason Samsaa456932014-08-18 16:20:51 -07005118 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005119 */
5120extern double3 __attribute__((const, overloadable))convert_double3(float3 v);
5121#endif
5122
Jason Samsaa456932014-08-18 16:20:51 -07005123#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005124/**
5125 * Component wise conversion from float4 to double4.
5126 *
5127 * For the convert_* functions, conversions of floating point values to integer will truncate.
5128 * Conversions of numbers too large to fit the destination type yield undefined results.
5129 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005130 *
Jason Samsaa456932014-08-18 16:20:51 -07005131 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005132 */
5133extern double4 __attribute__((const, overloadable))convert_double4(float4 v);
5134#endif
5135
Jason Samsaa456932014-08-18 16:20:51 -07005136#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005137/**
5138 * Component wise conversion from char2 to double2.
5139 *
5140 * For the convert_* functions, conversions of floating point values to integer will truncate.
5141 * Conversions of numbers too large to fit the destination type yield undefined results.
5142 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005143 *
Jason Samsaa456932014-08-18 16:20:51 -07005144 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005145 */
5146extern double2 __attribute__((const, overloadable))convert_double2(char2 v);
5147#endif
5148
Jason Samsaa456932014-08-18 16:20:51 -07005149#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005150/**
5151 * Component wise conversion from char3 to double3.
5152 *
5153 * For the convert_* functions, conversions of floating point values to integer will truncate.
5154 * Conversions of numbers too large to fit the destination type yield undefined results.
5155 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005156 *
Jason Samsaa456932014-08-18 16:20:51 -07005157 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005158 */
5159extern double3 __attribute__((const, overloadable))convert_double3(char3 v);
5160#endif
5161
Jason Samsaa456932014-08-18 16:20:51 -07005162#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005163/**
5164 * Component wise conversion from char4 to double4.
5165 *
5166 * For the convert_* functions, conversions of floating point values to integer will truncate.
5167 * Conversions of numbers too large to fit the destination type yield undefined results.
5168 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005169 *
Jason Samsaa456932014-08-18 16:20:51 -07005170 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005171 */
5172extern double4 __attribute__((const, overloadable))convert_double4(char4 v);
5173#endif
5174
Jason Samsaa456932014-08-18 16:20:51 -07005175#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005176/**
5177 * Component wise conversion from uchar2 to double2.
5178 *
5179 * For the convert_* functions, conversions of floating point values to integer will truncate.
5180 * Conversions of numbers too large to fit the destination type yield undefined results.
5181 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005182 *
Jason Samsaa456932014-08-18 16:20:51 -07005183 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005184 */
5185extern double2 __attribute__((const, overloadable))convert_double2(uchar2 v);
5186#endif
5187
Jason Samsaa456932014-08-18 16:20:51 -07005188#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005189/**
5190 * Component wise conversion from uchar3 to double3.
5191 *
5192 * For the convert_* functions, conversions of floating point values to integer will truncate.
5193 * Conversions of numbers too large to fit the destination type yield undefined results.
5194 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005195 *
Jason Samsaa456932014-08-18 16:20:51 -07005196 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005197 */
5198extern double3 __attribute__((const, overloadable))convert_double3(uchar3 v);
5199#endif
5200
Jason Samsaa456932014-08-18 16:20:51 -07005201#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005202/**
5203 * Component wise conversion from uchar4 to double4.
5204 *
5205 * For the convert_* functions, conversions of floating point values to integer will truncate.
5206 * Conversions of numbers too large to fit the destination type yield undefined results.
5207 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005208 *
Jason Samsaa456932014-08-18 16:20:51 -07005209 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005210 */
5211extern double4 __attribute__((const, overloadable))convert_double4(uchar4 v);
5212#endif
5213
Jason Samsaa456932014-08-18 16:20:51 -07005214#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005215/**
5216 * Component wise conversion from short2 to double2.
5217 *
5218 * For the convert_* functions, conversions of floating point values to integer will truncate.
5219 * Conversions of numbers too large to fit the destination type yield undefined results.
5220 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005221 *
Jason Samsaa456932014-08-18 16:20:51 -07005222 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005223 */
5224extern double2 __attribute__((const, overloadable))convert_double2(short2 v);
5225#endif
5226
Jason Samsaa456932014-08-18 16:20:51 -07005227#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005228/**
5229 * Component wise conversion from short3 to double3.
5230 *
5231 * For the convert_* functions, conversions of floating point values to integer will truncate.
5232 * Conversions of numbers too large to fit the destination type yield undefined results.
5233 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005234 *
Jason Samsaa456932014-08-18 16:20:51 -07005235 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005236 */
5237extern double3 __attribute__((const, overloadable))convert_double3(short3 v);
5238#endif
5239
Jason Samsaa456932014-08-18 16:20:51 -07005240#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005241/**
5242 * Component wise conversion from short4 to double4.
5243 *
5244 * For the convert_* functions, conversions of floating point values to integer will truncate.
5245 * Conversions of numbers too large to fit the destination type yield undefined results.
5246 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005247 *
Jason Samsaa456932014-08-18 16:20:51 -07005248 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005249 */
5250extern double4 __attribute__((const, overloadable))convert_double4(short4 v);
5251#endif
5252
Jason Samsaa456932014-08-18 16:20:51 -07005253#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005254/**
5255 * Component wise conversion from ushort2 to double2.
5256 *
5257 * For the convert_* functions, conversions of floating point values to integer will truncate.
5258 * Conversions of numbers too large to fit the destination type yield undefined results.
5259 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005260 *
Jason Samsaa456932014-08-18 16:20:51 -07005261 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005262 */
5263extern double2 __attribute__((const, overloadable))convert_double2(ushort2 v);
5264#endif
5265
Jason Samsaa456932014-08-18 16:20:51 -07005266#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005267/**
5268 * Component wise conversion from ushort3 to double3.
5269 *
5270 * For the convert_* functions, conversions of floating point values to integer will truncate.
5271 * Conversions of numbers too large to fit the destination type yield undefined results.
5272 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005273 *
Jason Samsaa456932014-08-18 16:20:51 -07005274 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005275 */
5276extern double3 __attribute__((const, overloadable))convert_double3(ushort3 v);
5277#endif
5278
Jason Samsaa456932014-08-18 16:20:51 -07005279#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005280/**
5281 * Component wise conversion from ushort4 to double4.
5282 *
5283 * For the convert_* functions, conversions of floating point values to integer will truncate.
5284 * Conversions of numbers too large to fit the destination type yield undefined results.
5285 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005286 *
Jason Samsaa456932014-08-18 16:20:51 -07005287 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005288 */
5289extern double4 __attribute__((const, overloadable))convert_double4(ushort4 v);
5290#endif
5291
Jason Samsaa456932014-08-18 16:20:51 -07005292#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005293/**
5294 * Component wise conversion from int2 to double2.
5295 *
5296 * For the convert_* functions, conversions of floating point values to integer will truncate.
5297 * Conversions of numbers too large to fit the destination type yield undefined results.
5298 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005299 *
Jason Samsaa456932014-08-18 16:20:51 -07005300 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005301 */
5302extern double2 __attribute__((const, overloadable))convert_double2(int2 v);
5303#endif
5304
Jason Samsaa456932014-08-18 16:20:51 -07005305#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005306/**
5307 * Component wise conversion from int3 to double3.
5308 *
5309 * For the convert_* functions, conversions of floating point values to integer will truncate.
5310 * Conversions of numbers too large to fit the destination type yield undefined results.
5311 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005312 *
Jason Samsaa456932014-08-18 16:20:51 -07005313 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005314 */
5315extern double3 __attribute__((const, overloadable))convert_double3(int3 v);
5316#endif
5317
Jason Samsaa456932014-08-18 16:20:51 -07005318#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005319/**
5320 * Component wise conversion from int4 to double4.
5321 *
5322 * For the convert_* functions, conversions of floating point values to integer will truncate.
5323 * Conversions of numbers too large to fit the destination type yield undefined results.
5324 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005325 *
Jason Samsaa456932014-08-18 16:20:51 -07005326 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005327 */
5328extern double4 __attribute__((const, overloadable))convert_double4(int4 v);
5329#endif
5330
Jason Samsaa456932014-08-18 16:20:51 -07005331#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005332/**
5333 * Component wise conversion from uint2 to double2.
5334 *
5335 * For the convert_* functions, conversions of floating point values to integer will truncate.
5336 * Conversions of numbers too large to fit the destination type yield undefined results.
5337 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005338 *
Jason Samsaa456932014-08-18 16:20:51 -07005339 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005340 */
5341extern double2 __attribute__((const, overloadable))convert_double2(uint2 v);
5342#endif
5343
Jason Samsaa456932014-08-18 16:20:51 -07005344#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005345/**
5346 * Component wise conversion from uint3 to double3.
5347 *
5348 * For the convert_* functions, conversions of floating point values to integer will truncate.
5349 * Conversions of numbers too large to fit the destination type yield undefined results.
5350 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005351 *
Jason Samsaa456932014-08-18 16:20:51 -07005352 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005353 */
5354extern double3 __attribute__((const, overloadable))convert_double3(uint3 v);
5355#endif
5356
Jason Samsaa456932014-08-18 16:20:51 -07005357#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005358/**
5359 * Component wise conversion from uint4 to double4.
5360 *
5361 * For the convert_* functions, conversions of floating point values to integer will truncate.
5362 * Conversions of numbers too large to fit the destination type yield undefined results.
5363 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005364 *
Jason Samsaa456932014-08-18 16:20:51 -07005365 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005366 */
5367extern double4 __attribute__((const, overloadable))convert_double4(uint4 v);
5368#endif
5369
Jason Samsaa456932014-08-18 16:20:51 -07005370#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005371/**
5372 * Component wise conversion from float2 to long2.
5373 *
5374 * For the convert_* functions, conversions of floating point values to integer will truncate.
5375 * Conversions of numbers too large to fit the destination type yield undefined results.
5376 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005377 *
Jason Samsaa456932014-08-18 16:20:51 -07005378 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005379 */
5380extern long2 __attribute__((const, overloadable))convert_long2(float2 v);
5381#endif
5382
Jason Samsaa456932014-08-18 16:20:51 -07005383#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005384/**
5385 * Component wise conversion from float3 to long3.
5386 *
5387 * For the convert_* functions, conversions of floating point values to integer will truncate.
5388 * Conversions of numbers too large to fit the destination type yield undefined results.
5389 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005390 *
Jason Samsaa456932014-08-18 16:20:51 -07005391 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005392 */
5393extern long3 __attribute__((const, overloadable))convert_long3(float3 v);
5394#endif
5395
Jason Samsaa456932014-08-18 16:20:51 -07005396#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005397/**
5398 * Component wise conversion from float4 to long4.
5399 *
5400 * For the convert_* functions, conversions of floating point values to integer will truncate.
5401 * Conversions of numbers too large to fit the destination type yield undefined results.
5402 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005403 *
Jason Samsaa456932014-08-18 16:20:51 -07005404 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005405 */
5406extern long4 __attribute__((const, overloadable))convert_long4(float4 v);
5407#endif
5408
Jason Samsaa456932014-08-18 16:20:51 -07005409#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005410/**
5411 * Component wise conversion from char2 to long2.
5412 *
5413 * For the convert_* functions, conversions of floating point values to integer will truncate.
5414 * Conversions of numbers too large to fit the destination type yield undefined results.
5415 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005416 *
Jason Samsaa456932014-08-18 16:20:51 -07005417 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005418 */
5419extern long2 __attribute__((const, overloadable))convert_long2(char2 v);
5420#endif
5421
Jason Samsaa456932014-08-18 16:20:51 -07005422#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005423/**
5424 * Component wise conversion from char3 to long3.
5425 *
5426 * For the convert_* functions, conversions of floating point values to integer will truncate.
5427 * Conversions of numbers too large to fit the destination type yield undefined results.
5428 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005429 *
Jason Samsaa456932014-08-18 16:20:51 -07005430 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005431 */
5432extern long3 __attribute__((const, overloadable))convert_long3(char3 v);
5433#endif
5434
Jason Samsaa456932014-08-18 16:20:51 -07005435#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005436/**
5437 * Component wise conversion from char4 to long4.
5438 *
5439 * For the convert_* functions, conversions of floating point values to integer will truncate.
5440 * Conversions of numbers too large to fit the destination type yield undefined results.
5441 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005442 *
Jason Samsaa456932014-08-18 16:20:51 -07005443 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005444 */
5445extern long4 __attribute__((const, overloadable))convert_long4(char4 v);
5446#endif
5447
Jason Samsaa456932014-08-18 16:20:51 -07005448#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005449/**
5450 * Component wise conversion from uchar2 to long2.
5451 *
5452 * For the convert_* functions, conversions of floating point values to integer will truncate.
5453 * Conversions of numbers too large to fit the destination type yield undefined results.
5454 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005455 *
Jason Samsaa456932014-08-18 16:20:51 -07005456 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005457 */
5458extern long2 __attribute__((const, overloadable))convert_long2(uchar2 v);
5459#endif
5460
Jason Samsaa456932014-08-18 16:20:51 -07005461#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005462/**
5463 * Component wise conversion from uchar3 to long3.
5464 *
5465 * For the convert_* functions, conversions of floating point values to integer will truncate.
5466 * Conversions of numbers too large to fit the destination type yield undefined results.
5467 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005468 *
Jason Samsaa456932014-08-18 16:20:51 -07005469 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005470 */
5471extern long3 __attribute__((const, overloadable))convert_long3(uchar3 v);
5472#endif
5473
Jason Samsaa456932014-08-18 16:20:51 -07005474#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005475/**
5476 * Component wise conversion from uchar4 to long4.
5477 *
5478 * For the convert_* functions, conversions of floating point values to integer will truncate.
5479 * Conversions of numbers too large to fit the destination type yield undefined results.
5480 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005481 *
Jason Samsaa456932014-08-18 16:20:51 -07005482 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005483 */
5484extern long4 __attribute__((const, overloadable))convert_long4(uchar4 v);
5485#endif
5486
Jason Samsaa456932014-08-18 16:20:51 -07005487#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005488/**
5489 * Component wise conversion from short2 to long2.
5490 *
5491 * For the convert_* functions, conversions of floating point values to integer will truncate.
5492 * Conversions of numbers too large to fit the destination type yield undefined results.
5493 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005494 *
Jason Samsaa456932014-08-18 16:20:51 -07005495 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005496 */
5497extern long2 __attribute__((const, overloadable))convert_long2(short2 v);
5498#endif
5499
Jason Samsaa456932014-08-18 16:20:51 -07005500#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005501/**
5502 * Component wise conversion from short3 to long3.
5503 *
5504 * For the convert_* functions, conversions of floating point values to integer will truncate.
5505 * Conversions of numbers too large to fit the destination type yield undefined results.
5506 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005507 *
Jason Samsaa456932014-08-18 16:20:51 -07005508 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005509 */
5510extern long3 __attribute__((const, overloadable))convert_long3(short3 v);
5511#endif
5512
Jason Samsaa456932014-08-18 16:20:51 -07005513#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005514/**
5515 * Component wise conversion from short4 to long4.
5516 *
5517 * For the convert_* functions, conversions of floating point values to integer will truncate.
5518 * Conversions of numbers too large to fit the destination type yield undefined results.
5519 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005520 *
Jason Samsaa456932014-08-18 16:20:51 -07005521 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005522 */
5523extern long4 __attribute__((const, overloadable))convert_long4(short4 v);
5524#endif
5525
Jason Samsaa456932014-08-18 16:20:51 -07005526#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005527/**
5528 * Component wise conversion from ushort2 to long2.
5529 *
5530 * For the convert_* functions, conversions of floating point values to integer will truncate.
5531 * Conversions of numbers too large to fit the destination type yield undefined results.
5532 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005533 *
Jason Samsaa456932014-08-18 16:20:51 -07005534 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005535 */
5536extern long2 __attribute__((const, overloadable))convert_long2(ushort2 v);
5537#endif
5538
Jason Samsaa456932014-08-18 16:20:51 -07005539#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005540/**
5541 * Component wise conversion from ushort3 to long3.
5542 *
5543 * For the convert_* functions, conversions of floating point values to integer will truncate.
5544 * Conversions of numbers too large to fit the destination type yield undefined results.
5545 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005546 *
Jason Samsaa456932014-08-18 16:20:51 -07005547 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005548 */
5549extern long3 __attribute__((const, overloadable))convert_long3(ushort3 v);
5550#endif
5551
Jason Samsaa456932014-08-18 16:20:51 -07005552#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005553/**
5554 * Component wise conversion from ushort4 to long4.
5555 *
5556 * For the convert_* functions, conversions of floating point values to integer will truncate.
5557 * Conversions of numbers too large to fit the destination type yield undefined results.
5558 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005559 *
Jason Samsaa456932014-08-18 16:20:51 -07005560 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005561 */
5562extern long4 __attribute__((const, overloadable))convert_long4(ushort4 v);
5563#endif
5564
Jason Samsaa456932014-08-18 16:20:51 -07005565#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005566/**
5567 * Component wise conversion from int2 to long2.
5568 *
5569 * For the convert_* functions, conversions of floating point values to integer will truncate.
5570 * Conversions of numbers too large to fit the destination type yield undefined results.
5571 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005572 *
Jason Samsaa456932014-08-18 16:20:51 -07005573 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005574 */
5575extern long2 __attribute__((const, overloadable))convert_long2(int2 v);
5576#endif
5577
Jason Samsaa456932014-08-18 16:20:51 -07005578#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005579/**
5580 * Component wise conversion from int3 to long3.
5581 *
5582 * For the convert_* functions, conversions of floating point values to integer will truncate.
5583 * Conversions of numbers too large to fit the destination type yield undefined results.
5584 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005585 *
Jason Samsaa456932014-08-18 16:20:51 -07005586 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005587 */
5588extern long3 __attribute__((const, overloadable))convert_long3(int3 v);
5589#endif
5590
Jason Samsaa456932014-08-18 16:20:51 -07005591#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005592/**
5593 * Component wise conversion from int4 to long4.
5594 *
5595 * For the convert_* functions, conversions of floating point values to integer will truncate.
5596 * Conversions of numbers too large to fit the destination type yield undefined results.
5597 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005598 *
Jason Samsaa456932014-08-18 16:20:51 -07005599 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005600 */
5601extern long4 __attribute__((const, overloadable))convert_long4(int4 v);
5602#endif
5603
Jason Samsaa456932014-08-18 16:20:51 -07005604#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005605/**
5606 * Component wise conversion from uint2 to long2.
5607 *
5608 * For the convert_* functions, conversions of floating point values to integer will truncate.
5609 * Conversions of numbers too large to fit the destination type yield undefined results.
5610 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005611 *
Jason Samsaa456932014-08-18 16:20:51 -07005612 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005613 */
5614extern long2 __attribute__((const, overloadable))convert_long2(uint2 v);
5615#endif
5616
Jason Samsaa456932014-08-18 16:20:51 -07005617#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005618/**
5619 * Component wise conversion from uint3 to long3.
5620 *
5621 * For the convert_* functions, conversions of floating point values to integer will truncate.
5622 * Conversions of numbers too large to fit the destination type yield undefined results.
5623 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005624 *
Jason Samsaa456932014-08-18 16:20:51 -07005625 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005626 */
5627extern long3 __attribute__((const, overloadable))convert_long3(uint3 v);
5628#endif
5629
Jason Samsaa456932014-08-18 16:20:51 -07005630#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005631/**
5632 * Component wise conversion from uint4 to long4.
5633 *
5634 * For the convert_* functions, conversions of floating point values to integer will truncate.
5635 * Conversions of numbers too large to fit the destination type yield undefined results.
5636 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005637 *
Jason Samsaa456932014-08-18 16:20:51 -07005638 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005639 */
5640extern long4 __attribute__((const, overloadable))convert_long4(uint4 v);
5641#endif
5642
Jason Samsaa456932014-08-18 16:20:51 -07005643#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005644/**
5645 * Component wise conversion from float2 to ulong2.
5646 *
5647 * For the convert_* functions, conversions of floating point values to integer will truncate.
5648 * Conversions of numbers too large to fit the destination type yield undefined results.
5649 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005650 *
Jason Samsaa456932014-08-18 16:20:51 -07005651 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005652 */
5653extern ulong2 __attribute__((const, overloadable))convert_ulong2(float2 v);
5654#endif
5655
Jason Samsaa456932014-08-18 16:20:51 -07005656#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005657/**
5658 * Component wise conversion from float3 to ulong3.
5659 *
5660 * For the convert_* functions, conversions of floating point values to integer will truncate.
5661 * Conversions of numbers too large to fit the destination type yield undefined results.
5662 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005663 *
Jason Samsaa456932014-08-18 16:20:51 -07005664 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005665 */
5666extern ulong3 __attribute__((const, overloadable))convert_ulong3(float3 v);
5667#endif
5668
Jason Samsaa456932014-08-18 16:20:51 -07005669#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005670/**
5671 * Component wise conversion from float4 to ulong4.
5672 *
5673 * For the convert_* functions, conversions of floating point values to integer will truncate.
5674 * Conversions of numbers too large to fit the destination type yield undefined results.
5675 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005676 *
Jason Samsaa456932014-08-18 16:20:51 -07005677 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005678 */
5679extern ulong4 __attribute__((const, overloadable))convert_ulong4(float4 v);
5680#endif
5681
Jason Samsaa456932014-08-18 16:20:51 -07005682#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005683/**
5684 * Component wise conversion from char2 to ulong2.
5685 *
5686 * For the convert_* functions, conversions of floating point values to integer will truncate.
5687 * Conversions of numbers too large to fit the destination type yield undefined results.
5688 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005689 *
Jason Samsaa456932014-08-18 16:20:51 -07005690 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005691 */
5692extern ulong2 __attribute__((const, overloadable))convert_ulong2(char2 v);
5693#endif
5694
Jason Samsaa456932014-08-18 16:20:51 -07005695#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005696/**
5697 * Component wise conversion from char3 to ulong3.
5698 *
5699 * For the convert_* functions, conversions of floating point values to integer will truncate.
5700 * Conversions of numbers too large to fit the destination type yield undefined results.
5701 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005702 *
Jason Samsaa456932014-08-18 16:20:51 -07005703 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005704 */
5705extern ulong3 __attribute__((const, overloadable))convert_ulong3(char3 v);
5706#endif
5707
Jason Samsaa456932014-08-18 16:20:51 -07005708#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005709/**
5710 * Component wise conversion from char4 to ulong4.
5711 *
5712 * For the convert_* functions, conversions of floating point values to integer will truncate.
5713 * Conversions of numbers too large to fit the destination type yield undefined results.
5714 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005715 *
Jason Samsaa456932014-08-18 16:20:51 -07005716 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005717 */
5718extern ulong4 __attribute__((const, overloadable))convert_ulong4(char4 v);
5719#endif
5720
Jason Samsaa456932014-08-18 16:20:51 -07005721#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005722/**
5723 * Component wise conversion from uchar2 to ulong2.
5724 *
5725 * For the convert_* functions, conversions of floating point values to integer will truncate.
5726 * Conversions of numbers too large to fit the destination type yield undefined results.
5727 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005728 *
Jason Samsaa456932014-08-18 16:20:51 -07005729 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005730 */
5731extern ulong2 __attribute__((const, overloadable))convert_ulong2(uchar2 v);
5732#endif
5733
Jason Samsaa456932014-08-18 16:20:51 -07005734#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005735/**
5736 * Component wise conversion from uchar3 to ulong3.
5737 *
5738 * For the convert_* functions, conversions of floating point values to integer will truncate.
5739 * Conversions of numbers too large to fit the destination type yield undefined results.
5740 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005741 *
Jason Samsaa456932014-08-18 16:20:51 -07005742 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005743 */
5744extern ulong3 __attribute__((const, overloadable))convert_ulong3(uchar3 v);
5745#endif
5746
Jason Samsaa456932014-08-18 16:20:51 -07005747#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005748/**
5749 * Component wise conversion from uchar4 to ulong4.
5750 *
5751 * For the convert_* functions, conversions of floating point values to integer will truncate.
5752 * Conversions of numbers too large to fit the destination type yield undefined results.
5753 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005754 *
Jason Samsaa456932014-08-18 16:20:51 -07005755 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005756 */
5757extern ulong4 __attribute__((const, overloadable))convert_ulong4(uchar4 v);
5758#endif
5759
Jason Samsaa456932014-08-18 16:20:51 -07005760#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005761/**
5762 * Component wise conversion from short2 to ulong2.
5763 *
5764 * For the convert_* functions, conversions of floating point values to integer will truncate.
5765 * Conversions of numbers too large to fit the destination type yield undefined results.
5766 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005767 *
Jason Samsaa456932014-08-18 16:20:51 -07005768 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005769 */
5770extern ulong2 __attribute__((const, overloadable))convert_ulong2(short2 v);
5771#endif
5772
Jason Samsaa456932014-08-18 16:20:51 -07005773#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005774/**
5775 * Component wise conversion from short3 to ulong3.
5776 *
5777 * For the convert_* functions, conversions of floating point values to integer will truncate.
5778 * Conversions of numbers too large to fit the destination type yield undefined results.
5779 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005780 *
Jason Samsaa456932014-08-18 16:20:51 -07005781 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005782 */
5783extern ulong3 __attribute__((const, overloadable))convert_ulong3(short3 v);
5784#endif
5785
Jason Samsaa456932014-08-18 16:20:51 -07005786#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005787/**
5788 * Component wise conversion from short4 to ulong4.
5789 *
5790 * For the convert_* functions, conversions of floating point values to integer will truncate.
5791 * Conversions of numbers too large to fit the destination type yield undefined results.
5792 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005793 *
Jason Samsaa456932014-08-18 16:20:51 -07005794 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005795 */
5796extern ulong4 __attribute__((const, overloadable))convert_ulong4(short4 v);
5797#endif
5798
Jason Samsaa456932014-08-18 16:20:51 -07005799#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005800/**
5801 * Component wise conversion from ushort2 to ulong2.
5802 *
5803 * For the convert_* functions, conversions of floating point values to integer will truncate.
5804 * Conversions of numbers too large to fit the destination type yield undefined results.
5805 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005806 *
Jason Samsaa456932014-08-18 16:20:51 -07005807 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005808 */
5809extern ulong2 __attribute__((const, overloadable))convert_ulong2(ushort2 v);
5810#endif
5811
Jason Samsaa456932014-08-18 16:20:51 -07005812#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005813/**
5814 * Component wise conversion from ushort3 to ulong3.
5815 *
5816 * For the convert_* functions, conversions of floating point values to integer will truncate.
5817 * Conversions of numbers too large to fit the destination type yield undefined results.
5818 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005819 *
Jason Samsaa456932014-08-18 16:20:51 -07005820 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005821 */
5822extern ulong3 __attribute__((const, overloadable))convert_ulong3(ushort3 v);
5823#endif
5824
Jason Samsaa456932014-08-18 16:20:51 -07005825#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005826/**
5827 * Component wise conversion from ushort4 to ulong4.
5828 *
5829 * For the convert_* functions, conversions of floating point values to integer will truncate.
5830 * Conversions of numbers too large to fit the destination type yield undefined results.
5831 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005832 *
Jason Samsaa456932014-08-18 16:20:51 -07005833 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005834 */
5835extern ulong4 __attribute__((const, overloadable))convert_ulong4(ushort4 v);
5836#endif
5837
Jason Samsaa456932014-08-18 16:20:51 -07005838#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005839/**
5840 * Component wise conversion from int2 to ulong2.
5841 *
5842 * For the convert_* functions, conversions of floating point values to integer will truncate.
5843 * Conversions of numbers too large to fit the destination type yield undefined results.
5844 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005845 *
Jason Samsaa456932014-08-18 16:20:51 -07005846 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005847 */
5848extern ulong2 __attribute__((const, overloadable))convert_ulong2(int2 v);
5849#endif
5850
Jason Samsaa456932014-08-18 16:20:51 -07005851#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005852/**
5853 * Component wise conversion from int3 to ulong3.
5854 *
5855 * For the convert_* functions, conversions of floating point values to integer will truncate.
5856 * Conversions of numbers too large to fit the destination type yield undefined results.
5857 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005858 *
Jason Samsaa456932014-08-18 16:20:51 -07005859 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005860 */
5861extern ulong3 __attribute__((const, overloadable))convert_ulong3(int3 v);
5862#endif
5863
Jason Samsaa456932014-08-18 16:20:51 -07005864#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005865/**
5866 * Component wise conversion from int4 to ulong4.
5867 *
5868 * For the convert_* functions, conversions of floating point values to integer will truncate.
5869 * Conversions of numbers too large to fit the destination type yield undefined results.
5870 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005871 *
Jason Samsaa456932014-08-18 16:20:51 -07005872 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005873 */
5874extern ulong4 __attribute__((const, overloadable))convert_ulong4(int4 v);
5875#endif
5876
Jason Samsaa456932014-08-18 16:20:51 -07005877#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005878/**
5879 * Component wise conversion from uint2 to ulong2.
5880 *
5881 * For the convert_* functions, conversions of floating point values to integer will truncate.
5882 * Conversions of numbers too large to fit the destination type yield undefined results.
5883 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005884 *
Jason Samsaa456932014-08-18 16:20:51 -07005885 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005886 */
5887extern ulong2 __attribute__((const, overloadable))convert_ulong2(uint2 v);
5888#endif
5889
Jason Samsaa456932014-08-18 16:20:51 -07005890#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005891/**
5892 * Component wise conversion from uint3 to ulong3.
5893 *
5894 * For the convert_* functions, conversions of floating point values to integer will truncate.
5895 * Conversions of numbers too large to fit the destination type yield undefined results.
5896 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005897 *
Jason Samsaa456932014-08-18 16:20:51 -07005898 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005899 */
5900extern ulong3 __attribute__((const, overloadable))convert_ulong3(uint3 v);
5901#endif
5902
Jason Samsaa456932014-08-18 16:20:51 -07005903#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005904/**
5905 * Component wise conversion from uint4 to ulong4.
5906 *
5907 * For the convert_* functions, conversions of floating point values to integer will truncate.
5908 * Conversions of numbers too large to fit the destination type yield undefined results.
5909 * For example, converting a float that contains 1.0e18 to a short is undefined.
Jason Sams564a4002014-04-29 16:30:41 -07005910 *
Jason Samsaa456932014-08-18 16:20:51 -07005911 * Supported by API versions 21 and newer.
Jason Sams564a4002014-04-29 16:30:41 -07005912 */
5913extern ulong4 __attribute__((const, overloadable))convert_ulong4(uint4 v);
5914#endif
5915
Jason Sams29087fa2014-01-09 17:06:17 -08005916#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005917/**
5918 * Copies the sign from y to x.
5919 *
5920 * The value returned is either x or -x.
5921 *
5922 * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
Jason Sams29087fa2014-01-09 17:06:17 -08005923 *
5924 * Supported by API versions 9 and newer.
5925 */
5926extern float __attribute__((const, overloadable))copysign(float x, float y);
5927#endif
5928
5929#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005930/**
5931 * Copies the sign from y to x.
5932 *
5933 * The value returned is either x or -x.
5934 *
5935 * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
Jason Sams29087fa2014-01-09 17:06:17 -08005936 *
5937 * Supported by API versions 9 and newer.
5938 */
5939extern float2 __attribute__((const, overloadable))copysign(float2 x, float2 y);
5940#endif
5941
5942#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005943/**
5944 * Copies the sign from y to x.
5945 *
5946 * The value returned is either x or -x.
5947 *
5948 * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
Jason Sams29087fa2014-01-09 17:06:17 -08005949 *
5950 * Supported by API versions 9 and newer.
5951 */
5952extern float3 __attribute__((const, overloadable))copysign(float3 x, float3 y);
5953#endif
5954
5955#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005956/**
5957 * Copies the sign from y to x.
5958 *
5959 * The value returned is either x or -x.
5960 *
5961 * For example, copysign(4.0f, -2.7f) returns -4.0f and copysign(-4.0f, 2.7f) returns 4.0f.
Jason Sams29087fa2014-01-09 17:06:17 -08005962 *
5963 * Supported by API versions 9 and newer.
5964 */
5965extern float4 __attribute__((const, overloadable))copysign(float4 x, float4 y);
5966#endif
5967
5968#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005969/**
5970 * Returns the cosine of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08005971 *
5972 * Supported by API versions 9 and newer.
5973 */
5974extern float __attribute__((const, overloadable))cos(float);
5975#endif
5976
5977#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005978/**
5979 * Returns the cosine of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08005980 *
5981 * Supported by API versions 9 and newer.
5982 */
5983extern float2 __attribute__((const, overloadable))cos(float2);
5984#endif
5985
5986#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005987/**
5988 * Returns the cosine of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08005989 *
5990 * Supported by API versions 9 and newer.
5991 */
5992extern float3 __attribute__((const, overloadable))cos(float3);
5993#endif
5994
5995#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08005996/**
5997 * Returns the cosine of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08005998 *
5999 * Supported by API versions 9 and newer.
6000 */
6001extern float4 __attribute__((const, overloadable))cos(float4);
6002#endif
6003
6004#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006005/**
6006 * Returns the hypebolic cosine of x, where x is measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08006007 *
6008 * Supported by API versions 9 and newer.
6009 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006010extern float __attribute__((const, overloadable))cosh(float x);
Jason Sams29087fa2014-01-09 17:06:17 -08006011#endif
6012
6013#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006014/**
6015 * Returns the hypebolic cosine of x, where x is measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08006016 *
6017 * Supported by API versions 9 and newer.
6018 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006019extern float2 __attribute__((const, overloadable))cosh(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006020#endif
6021
6022#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006023/**
6024 * Returns the hypebolic cosine of x, where x is measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08006025 *
6026 * Supported by API versions 9 and newer.
6027 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006028extern float3 __attribute__((const, overloadable))cosh(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006029#endif
6030
6031#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006032/**
6033 * Returns the hypebolic cosine of x, where x is measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -08006034 *
6035 * Supported by API versions 9 and newer.
6036 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006037extern float4 __attribute__((const, overloadable))cosh(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006038#endif
6039
6040#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006041/**
6042 * Returns the cosine of (x * pi), where (x * pi) is measured in radians.
6043 *
6044 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006045 *
6046 * Supported by API versions 9 and newer.
6047 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006048extern float __attribute__((const, overloadable))cospi(float x);
Jason Sams29087fa2014-01-09 17:06:17 -08006049#endif
6050
6051#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006052/**
6053 * Returns the cosine of (x * pi), where (x * pi) is measured in radians.
6054 *
6055 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006056 *
6057 * Supported by API versions 9 and newer.
6058 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006059extern float2 __attribute__((const, overloadable))cospi(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006060#endif
6061
6062#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006063/**
6064 * Returns the cosine of (x * pi), where (x * pi) is measured in radians.
6065 *
6066 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006067 *
6068 * Supported by API versions 9 and newer.
6069 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006070extern float3 __attribute__((const, overloadable))cospi(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006071#endif
6072
6073#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006074/**
6075 * Returns the cosine of (x * pi), where (x * pi) is measured in radians.
6076 *
6077 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006078 *
6079 * Supported by API versions 9 and newer.
6080 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006081extern float4 __attribute__((const, overloadable))cospi(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006082#endif
6083
6084#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006085/**
6086 * Computes the cross product of two vectors.
Jason Sams29087fa2014-01-09 17:06:17 -08006087 *
6088 * Supported by API versions 9 and newer.
6089 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006090extern float3 __attribute__((const, overloadable))cross(float3 lhs, float3 rhs);
Jason Sams29087fa2014-01-09 17:06:17 -08006091#endif
6092
6093#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006094/**
6095 * Computes the cross product of two vectors.
Jason Sams29087fa2014-01-09 17:06:17 -08006096 *
6097 * Supported by API versions 9 and newer.
6098 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006099extern float4 __attribute__((const, overloadable))cross(float4 lhs, float4 rhs);
Jason Sams29087fa2014-01-09 17:06:17 -08006100#endif
6101
6102#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006103/**
6104 * Converts from radians to degrees.
Jason Sams29087fa2014-01-09 17:06:17 -08006105 *
6106 * Supported by API versions 9 and newer.
6107 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006108extern float __attribute__((const, overloadable))degrees(float value);
Jason Sams29087fa2014-01-09 17:06:17 -08006109#endif
6110
6111#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006112/**
6113 * Converts from radians to degrees.
Jason Sams29087fa2014-01-09 17:06:17 -08006114 *
6115 * Supported by API versions 9 and newer.
6116 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006117extern float2 __attribute__((const, overloadable))degrees(float2 value);
6118#endif
6119
6120#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006121/**
6122 * Converts from radians to degrees.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006123 *
6124 * Supported by API versions 9 and newer.
6125 */
6126extern float3 __attribute__((const, overloadable))degrees(float3 value);
6127#endif
6128
6129#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006130/**
6131 * Converts from radians to degrees.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006132 *
6133 * Supported by API versions 9 and newer.
6134 */
6135extern float4 __attribute__((const, overloadable))degrees(float4 value);
6136#endif
6137
6138#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006139/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006140 * Compute the distance between two points.
6141 *
6142 * Supported by API versions 9 and newer.
6143 */
6144extern float __attribute__((const, overloadable))distance(float lhs, float rhs);
6145#endif
6146
6147#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006148/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006149 * Compute the distance between two points.
6150 *
6151 * Supported by API versions 9 and newer.
6152 */
6153extern float __attribute__((const, overloadable))distance(float2 lhs, float2 rhs);
6154#endif
6155
6156#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006157/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006158 * Compute the distance between two points.
6159 *
6160 * Supported by API versions 9 and newer.
6161 */
6162extern float __attribute__((const, overloadable))distance(float3 lhs, float3 rhs);
6163#endif
6164
6165#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006166/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006167 * Compute the distance between two points.
6168 *
6169 * Supported by API versions 9 and newer.
6170 */
6171extern float __attribute__((const, overloadable))distance(float4 lhs, float4 rhs);
6172#endif
6173
6174#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006175/**
6176 * Computes the dot product of two vectors.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006177 *
6178 * Supported by API versions 9 and newer.
6179 */
6180extern float __attribute__((const, overloadable))dot(float lhs, float rhs);
6181#endif
6182
6183#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006184/**
6185 * Computes the dot product of two vectors.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006186 *
6187 * Supported by API versions 9 and newer.
6188 */
6189extern float __attribute__((const, overloadable))dot(float2 lhs, float2 rhs);
6190#endif
6191
6192#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006193/**
6194 * Computes the dot product of two vectors.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006195 *
6196 * Supported by API versions 9 and newer.
6197 */
6198extern float __attribute__((const, overloadable))dot(float3 lhs, float3 rhs);
6199#endif
6200
6201#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006202/**
6203 * Computes the dot product of two vectors.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006204 *
6205 * Supported by API versions 9 and newer.
6206 */
6207extern float __attribute__((const, overloadable))dot(float4 lhs, float4 rhs);
Jason Sams29087fa2014-01-09 17:06:17 -08006208#endif
6209
6210#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006211/**
6212 * Returns the error function.
Jason Sams29087fa2014-01-09 17:06:17 -08006213 *
6214 * Supported by API versions 9 and newer.
6215 */
6216extern float __attribute__((const, overloadable))erf(float);
6217#endif
6218
6219#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006220/**
6221 * Returns the error function.
Jason Sams29087fa2014-01-09 17:06:17 -08006222 *
6223 * Supported by API versions 9 and newer.
6224 */
6225extern float2 __attribute__((const, overloadable))erf(float2);
6226#endif
6227
6228#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006229/**
6230 * Returns the error function.
Jason Sams29087fa2014-01-09 17:06:17 -08006231 *
6232 * Supported by API versions 9 and newer.
6233 */
6234extern float3 __attribute__((const, overloadable))erf(float3);
6235#endif
6236
6237#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006238/**
6239 * Returns the error function.
Jason Sams29087fa2014-01-09 17:06:17 -08006240 *
6241 * Supported by API versions 9 and newer.
6242 */
6243extern float4 __attribute__((const, overloadable))erf(float4);
6244#endif
6245
6246#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006247/**
6248 * Returns the complementary error function.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006249 *
6250 * Supported by API versions 9 and newer.
6251 */
6252extern float __attribute__((const, overloadable))erfc(float);
6253#endif
6254
6255#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006256/**
6257 * Returns the complementary error function.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006258 *
6259 * Supported by API versions 9 and newer.
6260 */
6261extern float2 __attribute__((const, overloadable))erfc(float2);
6262#endif
6263
6264#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006265/**
6266 * Returns the complementary error function.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006267 *
6268 * Supported by API versions 9 and newer.
6269 */
6270extern float3 __attribute__((const, overloadable))erfc(float3);
6271#endif
6272
6273#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006274/**
6275 * Returns the complementary error function.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006276 *
6277 * Supported by API versions 9 and newer.
6278 */
6279extern float4 __attribute__((const, overloadable))erfc(float4);
6280#endif
6281
6282#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006283/**
6284 * Returns e raised to x, i.e. e ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006285 *
6286 * Supported by API versions 9 and newer.
6287 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006288extern float __attribute__((const, overloadable))exp(float x);
Jason Sams29087fa2014-01-09 17:06:17 -08006289#endif
6290
6291#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006292/**
6293 * Returns e raised to x, i.e. e ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006294 *
6295 * Supported by API versions 9 and newer.
6296 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006297extern float2 __attribute__((const, overloadable))exp(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006298#endif
6299
6300#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006301/**
6302 * Returns e raised to x, i.e. e ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006303 *
6304 * Supported by API versions 9 and newer.
6305 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006306extern float3 __attribute__((const, overloadable))exp(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006307#endif
6308
6309#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006310/**
6311 * Returns e raised to x, i.e. e ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006312 *
6313 * Supported by API versions 9 and newer.
6314 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006315extern float4 __attribute__((const, overloadable))exp(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006316#endif
6317
6318#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006319/**
6320 * Returns 10 raised to x, i.e. 10.f ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006321 *
6322 * Supported by API versions 9 and newer.
6323 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006324extern float __attribute__((const, overloadable))exp10(float x);
Jason Sams29087fa2014-01-09 17:06:17 -08006325#endif
6326
6327#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006328/**
6329 * Returns 10 raised to x, i.e. 10.f ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006330 *
6331 * Supported by API versions 9 and newer.
6332 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006333extern float2 __attribute__((const, overloadable))exp10(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006334#endif
6335
6336#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006337/**
6338 * Returns 10 raised to x, i.e. 10.f ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006339 *
6340 * Supported by API versions 9 and newer.
6341 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006342extern float3 __attribute__((const, overloadable))exp10(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006343#endif
6344
6345#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006346/**
6347 * Returns 10 raised to x, i.e. 10.f ^ x.
Jason Sams29087fa2014-01-09 17:06:17 -08006348 *
6349 * Supported by API versions 9 and newer.
6350 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006351extern float4 __attribute__((const, overloadable))exp10(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006352#endif
6353
6354#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006355/**
6356 * Returns 2 raised to x, i.e. 2.f ^ x.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006357 *
6358 * Supported by API versions 9 and newer.
6359 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006360extern float __attribute__((const, overloadable))exp2(float x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006361#endif
6362
6363#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006364/**
6365 * Returns 2 raised to x, i.e. 2.f ^ x.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006366 *
6367 * Supported by API versions 9 and newer.
6368 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006369extern float2 __attribute__((const, overloadable))exp2(float2 x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006370#endif
6371
6372#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006373/**
6374 * Returns 2 raised to x, i.e. 2.f ^ x.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006375 *
6376 * Supported by API versions 9 and newer.
6377 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006378extern float3 __attribute__((const, overloadable))exp2(float3 x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006379#endif
6380
6381#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006382/**
6383 * Returns 2 raised to x, i.e. 2.f ^ x.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006384 *
6385 * Supported by API versions 9 and newer.
6386 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006387extern float4 __attribute__((const, overloadable))exp2(float4 x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006388#endif
6389
6390#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006391/**
6392 * Returns e raised to x minus 1, i.e. (e ^ x) - 1.
Jason Sams29087fa2014-01-09 17:06:17 -08006393 *
6394 * Supported by API versions 9 and newer.
6395 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006396extern float __attribute__((const, overloadable))expm1(float x);
Jason Sams29087fa2014-01-09 17:06:17 -08006397#endif
6398
6399#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006400/**
6401 * Returns e raised to x minus 1, i.e. (e ^ x) - 1.
Jason Sams29087fa2014-01-09 17:06:17 -08006402 *
6403 * Supported by API versions 9 and newer.
6404 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006405extern float2 __attribute__((const, overloadable))expm1(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006406#endif
6407
6408#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006409/**
6410 * Returns e raised to x minus 1, i.e. (e ^ x) - 1.
Jason Sams29087fa2014-01-09 17:06:17 -08006411 *
6412 * Supported by API versions 9 and newer.
6413 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006414extern float3 __attribute__((const, overloadable))expm1(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006415#endif
6416
6417#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006418/**
6419 * Returns e raised to x minus 1, i.e. (e ^ x) - 1.
Jason Sams29087fa2014-01-09 17:06:17 -08006420 *
6421 * Supported by API versions 9 and newer.
6422 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006423extern float4 __attribute__((const, overloadable))expm1(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006424#endif
6425
6426#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006427/**
6428 * Returns the absolute value of the float x.
6429 *
6430 * For integers, use abs().
Jason Sams29087fa2014-01-09 17:06:17 -08006431 *
6432 * Supported by API versions 9 and newer.
6433 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006434extern float __attribute__((const, overloadable))fabs(float x);
Jason Sams29087fa2014-01-09 17:06:17 -08006435#endif
6436
6437#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006438/**
6439 * Returns the absolute value of the float x.
6440 *
6441 * For integers, use abs().
Jason Sams29087fa2014-01-09 17:06:17 -08006442 *
6443 * Supported by API versions 9 and newer.
6444 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006445extern float2 __attribute__((const, overloadable))fabs(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006446#endif
6447
6448#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006449/**
6450 * Returns the absolute value of the float x.
6451 *
6452 * For integers, use abs().
Jason Sams29087fa2014-01-09 17:06:17 -08006453 *
6454 * Supported by API versions 9 and newer.
6455 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006456extern float3 __attribute__((const, overloadable))fabs(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006457#endif
6458
6459#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006460/**
6461 * Returns the absolute value of the float x.
6462 *
6463 * For integers, use abs().
Jason Sams29087fa2014-01-09 17:06:17 -08006464 *
6465 * Supported by API versions 9 and newer.
6466 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006467extern float4 __attribute__((const, overloadable))fabs(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -08006468#endif
6469
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006470#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006471/**
6472 * Computes the approximate distance between two points.
6473 *
6474 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jason Sams29087fa2014-01-09 17:06:17 -08006475 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006476 * Supported by API versions 17 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08006477 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006478extern float __attribute__((const, overloadable))fast_distance(float lhs, float rhs);
6479#endif
6480
6481#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006482/**
6483 * Computes the approximate distance between two points.
6484 *
6485 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006486 *
6487 * Supported by API versions 17 and newer.
6488 */
6489extern float __attribute__((const, overloadable))fast_distance(float2 lhs, float2 rhs);
6490#endif
6491
6492#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006493/**
6494 * Computes the approximate distance between two points.
6495 *
6496 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006497 *
6498 * Supported by API versions 17 and newer.
6499 */
6500extern float __attribute__((const, overloadable))fast_distance(float3 lhs, float3 rhs);
6501#endif
6502
6503#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006504/**
6505 * Computes the approximate distance between two points.
6506 *
6507 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006508 *
6509 * Supported by API versions 17 and newer.
6510 */
6511extern float __attribute__((const, overloadable))fast_distance(float4 lhs, float4 rhs);
6512#endif
6513
6514#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006515/**
6516 * Computes the approximate length of a vector.
6517 *
6518 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006519 *
6520 * Supported by API versions 17 and newer.
6521 */
6522extern float __attribute__((const, overloadable))fast_length(float v);
6523#endif
6524
6525#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006526/**
6527 * Computes the approximate length of a vector.
6528 *
6529 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006530 *
6531 * Supported by API versions 17 and newer.
6532 */
6533extern float __attribute__((const, overloadable))fast_length(float2 v);
6534#endif
6535
6536#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006537/**
6538 * Computes the approximate length of a vector.
6539 *
6540 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006541 *
6542 * Supported by API versions 17 and newer.
6543 */
6544extern float __attribute__((const, overloadable))fast_length(float3 v);
6545#endif
6546
6547#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006548/**
6549 * Computes the approximate length of a vector.
6550 *
6551 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006552 *
6553 * Supported by API versions 17 and newer.
6554 */
6555extern float __attribute__((const, overloadable))fast_length(float4 v);
6556#endif
6557
6558#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006559/**
6560 * Approximately normalizes a vector.
6561 *
6562 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
6563 *
6564 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006565 *
6566 * Supported by API versions 17 and newer.
6567 */
6568extern float __attribute__((const, overloadable))fast_normalize(float v);
6569#endif
6570
6571#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006572/**
6573 * Approximately normalizes a vector.
6574 *
6575 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
6576 *
6577 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006578 *
6579 * Supported by API versions 17 and newer.
6580 */
6581extern float2 __attribute__((const, overloadable))fast_normalize(float2 v);
6582#endif
6583
6584#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006585/**
6586 * Approximately normalizes a vector.
6587 *
6588 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
6589 *
6590 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006591 *
6592 * Supported by API versions 17 and newer.
6593 */
6594extern float3 __attribute__((const, overloadable))fast_normalize(float3 v);
6595#endif
6596
6597#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006598/**
6599 * Approximately normalizes a vector.
6600 *
6601 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
6602 *
6603 * The precision is what would be expected from doing the computation using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006604 *
6605 * Supported by API versions 17 and newer.
6606 */
6607extern float4 __attribute__((const, overloadable))fast_normalize(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08006608#endif
6609
6610#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006611/**
6612 * Returns the positive difference between two values.
6613 *
6614 * If a > b, returns (a - b) otherwise returns 0f.
Jason Sams29087fa2014-01-09 17:06:17 -08006615 *
6616 * Supported by API versions 9 and newer.
6617 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006618extern float __attribute__((const, overloadable))fdim(float a, float b);
Jason Sams29087fa2014-01-09 17:06:17 -08006619#endif
6620
6621#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006622/**
6623 * Returns the positive difference between two values.
6624 *
6625 * If a > b, returns (a - b) otherwise returns 0f.
Jason Sams29087fa2014-01-09 17:06:17 -08006626 *
6627 * Supported by API versions 9 and newer.
6628 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006629extern float2 __attribute__((const, overloadable))fdim(float2 a, float2 b);
Jason Sams29087fa2014-01-09 17:06:17 -08006630#endif
6631
6632#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006633/**
6634 * Returns the positive difference between two values.
6635 *
6636 * If a > b, returns (a - b) otherwise returns 0f.
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))fdim(float3 a, float3 b);
6641#endif
6642
6643#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006644/**
6645 * Returns the positive difference between two values.
6646 *
6647 * If a > b, returns (a - b) otherwise returns 0f.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08006648 *
6649 * Supported by API versions 9 and newer.
6650 */
6651extern float4 __attribute__((const, overloadable))fdim(float4 a, float4 b);
Jason Sams29087fa2014-01-09 17:06:17 -08006652#endif
6653
6654#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006655/**
6656 * Returns the smallest integer not greater than a value.
Jason Sams29087fa2014-01-09 17:06:17 -08006657 *
6658 * Supported by API versions 9 and newer.
6659 */
6660extern float __attribute__((const, overloadable))floor(float);
6661#endif
6662
6663#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006664/**
6665 * Returns the smallest integer not greater than a value.
Jason Sams29087fa2014-01-09 17:06:17 -08006666 *
6667 * Supported by API versions 9 and newer.
6668 */
6669extern float2 __attribute__((const, overloadable))floor(float2);
6670#endif
6671
6672#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006673/**
6674 * Returns the smallest integer not greater than a value.
Jason Sams29087fa2014-01-09 17:06:17 -08006675 *
6676 * Supported by API versions 9 and newer.
6677 */
6678extern float3 __attribute__((const, overloadable))floor(float3);
6679#endif
6680
6681#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006682/**
6683 * Returns the smallest integer not greater than a value.
Jason Sams29087fa2014-01-09 17:06:17 -08006684 *
6685 * Supported by API versions 9 and newer.
6686 */
6687extern float4 __attribute__((const, overloadable))floor(float4);
6688#endif
6689
6690#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006691/**
6692 * Multiply and add. Returns (a * b) + c.
6693 *
6694 * This function is identical to mad().
Jason Sams29087fa2014-01-09 17:06:17 -08006695 *
6696 * Supported by API versions 9 and newer.
6697 */
6698extern float __attribute__((const, overloadable))fma(float a, float b, float c);
6699#endif
6700
6701#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006702/**
6703 * Multiply and add. Returns (a * b) + c.
6704 *
6705 * This function is identical to mad().
Jason Sams29087fa2014-01-09 17:06:17 -08006706 *
6707 * Supported by API versions 9 and newer.
6708 */
6709extern float2 __attribute__((const, overloadable))fma(float2 a, float2 b, float2 c);
6710#endif
6711
6712#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006713/**
6714 * Multiply and add. Returns (a * b) + c.
6715 *
6716 * This function is identical to mad().
Jason Sams29087fa2014-01-09 17:06:17 -08006717 *
6718 * Supported by API versions 9 and newer.
6719 */
6720extern float3 __attribute__((const, overloadable))fma(float3 a, float3 b, float3 c);
6721#endif
6722
6723#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006724/**
6725 * Multiply and add. Returns (a * b) + c.
6726 *
6727 * This function is identical to mad().
Jason Sams29087fa2014-01-09 17:06:17 -08006728 *
6729 * Supported by API versions 9 and newer.
6730 */
6731extern float4 __attribute__((const, overloadable))fma(float4 a, float4 b, float4 c);
6732#endif
6733
6734#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006735/**
6736 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6737 *
6738 * The max() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006739 *
6740 * Supported by API versions 9 and newer.
6741 */
6742extern float __attribute__((const, overloadable))fmax(float x, float y);
6743#endif
6744
6745#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006746/**
6747 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6748 *
6749 * The max() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006750 *
6751 * Supported by API versions 9 and newer.
6752 */
6753extern float2 __attribute__((const, overloadable))fmax(float2 x, float2 y);
6754#endif
6755
6756#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006757/**
6758 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6759 *
6760 * The max() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006761 *
6762 * Supported by API versions 9 and newer.
6763 */
6764extern float3 __attribute__((const, overloadable))fmax(float3 x, float3 y);
6765#endif
6766
6767#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006768/**
6769 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6770 *
6771 * The max() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006772 *
6773 * Supported by API versions 9 and newer.
6774 */
6775extern float4 __attribute__((const, overloadable))fmax(float4 x, float4 y);
6776#endif
6777
6778#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006779/**
6780 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6781 *
6782 * Unlike the other variants of fmax() and max(), this function compare each element of x to the scalar y.
Jason Sams29087fa2014-01-09 17:06:17 -08006783 *
6784 * Supported by API versions 9 and newer.
6785 */
Jason Sams29087fa2014-01-09 17:06:17 -08006786extern float2 __attribute__((const, overloadable))fmax(float2 x, float y);
6787#endif
6788
6789#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006790/**
6791 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6792 *
6793 * Unlike the other variants of fmax() and max(), this function compare each element of x to the scalar y.
Jason Sams29087fa2014-01-09 17:06:17 -08006794 *
6795 * Supported by API versions 9 and newer.
6796 */
6797extern float3 __attribute__((const, overloadable))fmax(float3 x, float y);
6798#endif
6799
6800#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006801/**
6802 * Returns the maximum of x and y, i.e. (x < y ? y : x).
6803 *
6804 * Unlike the other variants of fmax() and max(), this function compare each element of x to the scalar y.
Jason Sams29087fa2014-01-09 17:06:17 -08006805 *
6806 * Supported by API versions 9 and newer.
6807 */
6808extern float4 __attribute__((const, overloadable))fmax(float4 x, float y);
6809#endif
6810
6811#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006812/**
6813 * Returns the minimum of x and y, i.e. (x > y ? y : x).
6814 *
6815 * The min() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006816 *
6817 * Supported by API versions 9 and newer.
6818 */
6819extern float __attribute__((const, overloadable))fmin(float x, float y);
6820#endif
6821
6822#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006823/**
6824 * Returns the minimum of x and y, i.e. (x > y ? y : x).
6825 *
6826 * The min() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006827 *
6828 * Supported by API versions 9 and newer.
6829 */
6830extern float2 __attribute__((const, overloadable))fmin(float2 x, float2 y);
6831#endif
6832
6833#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006834/**
6835 * Returns the minimum of x and y, i.e. (x > y ? y : x).
6836 *
6837 * The min() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006838 *
6839 * Supported by API versions 9 and newer.
6840 */
6841extern float3 __attribute__((const, overloadable))fmin(float3 x, float3 y);
6842#endif
6843
6844#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006845/**
6846 * Returns the minimum of x and y, i.e. (x > y ? y : x).
6847 *
6848 * The min() function returns identical results but can be applied to more data types.
Jason Sams29087fa2014-01-09 17:06:17 -08006849 *
6850 * Supported by API versions 9 and newer.
6851 */
6852extern float4 __attribute__((const, overloadable))fmin(float4 x, float4 y);
6853#endif
6854
6855#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006856/**
6857 * Returns the minimum of x and y, i.e. (x > y ? y : x)
6858 *
6859 * Unlike the other variants of fmin() and min(), this function compare each element of x to the scalar y.
Jason Sams29087fa2014-01-09 17:06:17 -08006860 *
6861 * Supported by API versions 9 and newer.
6862 */
Jason Sams29087fa2014-01-09 17:06:17 -08006863extern float2 __attribute__((const, overloadable))fmin(float2 x, float y);
6864#endif
6865
6866#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006867/**
6868 * Returns the minimum of x and y, i.e. (x > y ? y : x)
6869 *
6870 * Unlike the other variants of fmin() and min(), this function compare each element of x to the scalar y.
Jason Sams29087fa2014-01-09 17:06:17 -08006871 *
6872 * Supported by API versions 9 and newer.
6873 */
6874extern float3 __attribute__((const, overloadable))fmin(float3 x, float y);
6875#endif
6876
6877#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006878/**
6879 * Returns the minimum of x and y, i.e. (x > y ? y : x)
6880 *
6881 * Unlike the other variants of fmin() and min(), this function compare each element of x to the scalar y.
Jason Sams29087fa2014-01-09 17:06:17 -08006882 *
6883 * Supported by API versions 9 and newer.
6884 */
6885extern float4 __attribute__((const, overloadable))fmin(float4 x, float y);
6886#endif
6887
6888#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006889/**
6890 * Returns the remainder of x / y, where the quotient is rounded towards zero.
6891 *
6892 * The function remainder() is similar but rounds toward the closest interger.
6893 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
6894 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006895 *
6896 * Supported by API versions 9 and newer.
6897 */
6898extern float __attribute__((const, overloadable))fmod(float x, float y);
6899#endif
6900
6901#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006902/**
6903 * Returns the remainder of x / y, where the quotient is rounded towards zero.
6904 *
6905 * The function remainder() is similar but rounds toward the closest interger.
6906 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
6907 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006908 *
6909 * Supported by API versions 9 and newer.
6910 */
6911extern float2 __attribute__((const, overloadable))fmod(float2 x, float2 y);
6912#endif
6913
6914#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006915/**
6916 * Returns the remainder of x / y, where the quotient is rounded towards zero.
6917 *
6918 * The function remainder() is similar but rounds toward the closest interger.
6919 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
6920 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006921 *
6922 * Supported by API versions 9 and newer.
6923 */
6924extern float3 __attribute__((const, overloadable))fmod(float3 x, float3 y);
6925#endif
6926
6927#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006928/**
6929 * Returns the remainder of x / y, where the quotient is rounded towards zero.
6930 *
6931 * The function remainder() is similar but rounds toward the closest interger.
6932 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
6933 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jason Sams29087fa2014-01-09 17:06:17 -08006934 *
6935 * Supported by API versions 9 and newer.
6936 */
6937extern float4 __attribute__((const, overloadable))fmod(float4 x, float4 y);
6938#endif
6939
6940#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006941/**
6942 * Returns the positive fractional part of v, i.e. v - floor(v).
Jason Sams29087fa2014-01-09 17:06:17 -08006943 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006944 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
6945 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
6946 *
6947 * @param v Input value.
6948 * @param floor If floor is not null, each element of floor will be set to the floor of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08006949 *
6950 * Supported by API versions 9 and newer.
6951 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08006952extern float __attribute__((overloadable))fract(float v, float* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08006953#endif
6954
6955#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006956/**
6957 * Returns the positive fractional part of v, i.e. v - floor(v).
Jason Sams29087fa2014-01-09 17:06:17 -08006958 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006959 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
6960 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
6961 *
6962 * @param v Input value.
6963 * @param floor If floor is not null, each element of floor will be set to the floor of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08006964 *
6965 * Supported by API versions 9 and newer.
6966 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08006967extern float2 __attribute__((overloadable))fract(float2 v, float2* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08006968#endif
6969
6970#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006971/**
6972 * Returns the positive fractional part of v, i.e. v - floor(v).
Jason Sams29087fa2014-01-09 17:06:17 -08006973 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006974 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
6975 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
6976 *
6977 * @param v Input value.
6978 * @param floor If floor is not null, each element of floor will be set to the floor of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08006979 *
6980 * Supported by API versions 9 and newer.
6981 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08006982extern float3 __attribute__((overloadable))fract(float3 v, float3* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08006983#endif
6984
6985#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006986/**
6987 * Returns the positive fractional part of v, i.e. v - floor(v).
Jason Sams29087fa2014-01-09 17:06:17 -08006988 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08006989 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
6990 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
6991 *
6992 * @param v Input value.
6993 * @param floor If floor is not null, each element of floor will be set to the floor of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08006994 *
6995 * Supported by API versions 9 and newer.
6996 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08006997extern float4 __attribute__((overloadable))fract(float4 v, float4* floor);
Jason Sams29087fa2014-01-09 17:06:17 -08006998#endif
6999
7000#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007001/**
7002 * Returns the positive fractional part of v, i.e. v - floor(v).
7003 *
7004 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
7005 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
Jason Sams29087fa2014-01-09 17:06:17 -08007006 *
7007 * Supported by API versions 9 and newer.
7008 */
7009static float __attribute__((const, overloadable))fract(float v) {
7010 float unused;
7011 return fract(v, &unused);
7012}
7013#endif
7014
7015#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007016/**
7017 * Returns the positive fractional part of v, i.e. v - floor(v).
7018 *
7019 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
7020 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
Jason Sams29087fa2014-01-09 17:06:17 -08007021 *
7022 * Supported by API versions 9 and newer.
7023 */
7024static float2 __attribute__((const, overloadable))fract(float2 v) {
7025 float2 unused;
7026 return fract(v, &unused);
7027}
7028#endif
7029
7030#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007031/**
7032 * Returns the positive fractional part of v, i.e. v - floor(v).
7033 *
7034 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
7035 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
Jason Sams29087fa2014-01-09 17:06:17 -08007036 *
7037 * Supported by API versions 9 and newer.
7038 */
7039static float3 __attribute__((const, overloadable))fract(float3 v) {
7040 float3 unused;
7041 return fract(v, &unused);
7042}
7043#endif
7044
7045#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007046/**
7047 * Returns the positive fractional part of v, i.e. v - floor(v).
7048 *
7049 * For example, fract(1.3f, &val) returns 0.3f and sets val to 1.f.
7050 * fract(-1.3f, &val) returns 0.7f and sets val to -2.f.
Jason Sams29087fa2014-01-09 17:06:17 -08007051 *
7052 * Supported by API versions 9 and newer.
7053 */
7054static float4 __attribute__((const, overloadable))fract(float4 v) {
7055 float4 unused;
7056 return fract(v, &unused);
7057}
7058#endif
7059
7060#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007061/**
7062 * Returns the binary mantissa and exponent of v, e.g. v == mantissa * 2 ^ exponent.
7063 *
7064 * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
7065 * See ldexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007066 *
7067 * @param v Supports float, float2, float3, float4.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007068 * @param expo If expo is not null, each element of expo will be set to the exponent of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08007069 *
7070 * Supported by API versions 9 and newer.
7071 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007072extern float __attribute__((overloadable))frexp(float v, int* expo);
Jason Sams29087fa2014-01-09 17:06:17 -08007073#endif
7074
7075#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007076/**
7077 * Returns the binary mantissa and exponent of v, e.g. v == mantissa * 2 ^ exponent.
7078 *
7079 * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
7080 * See ldexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007081 *
7082 * @param v Supports float, float2, float3, float4.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007083 * @param expo If expo is not null, each element of expo will be set to the exponent of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08007084 *
7085 * Supported by API versions 9 and newer.
7086 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007087extern float2 __attribute__((overloadable))frexp(float2 v, int2* expo);
Jason Sams29087fa2014-01-09 17:06:17 -08007088#endif
7089
7090#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007091/**
7092 * Returns the binary mantissa and exponent of v, e.g. v == mantissa * 2 ^ exponent.
7093 *
7094 * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
7095 * See ldexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007096 *
7097 * @param v Supports float, float2, float3, float4.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007098 * @param expo If expo is not null, each element of expo will be set to the exponent of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08007099 *
7100 * Supported by API versions 9 and newer.
7101 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007102extern float3 __attribute__((overloadable))frexp(float3 v, int3* expo);
Jason Sams29087fa2014-01-09 17:06:17 -08007103#endif
7104
7105#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007106/**
7107 * Returns the binary mantissa and exponent of v, e.g. v == mantissa * 2 ^ exponent.
7108 *
7109 * The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
7110 * See ldexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007111 *
7112 * @param v Supports float, float2, float3, float4.
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007113 * @param expo If expo is not null, each element of expo will be set to the exponent of the corresponding element of v.
Jason Sams29087fa2014-01-09 17:06:17 -08007114 *
7115 * Supported by API versions 9 and newer.
7116 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007117extern float4 __attribute__((overloadable))frexp(float4 v, int4* expo);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007118#endif
7119
7120#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007121/**
7122 * Returns the approximate reciprocal of a value.
7123 *
7124 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007125 *
7126 * Supported by API versions 17 and newer.
7127 */
7128extern float __attribute__((const, overloadable))half_recip(float v);
7129#endif
7130
7131#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007132/**
7133 * Returns the approximate reciprocal of a value.
7134 *
7135 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007136 *
7137 * Supported by API versions 17 and newer.
7138 */
7139extern float2 __attribute__((const, overloadable))half_recip(float2 v);
7140#endif
7141
7142#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007143/**
7144 * Returns the approximate reciprocal of a value.
7145 *
7146 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007147 *
7148 * Supported by API versions 17 and newer.
7149 */
7150extern float3 __attribute__((const, overloadable))half_recip(float3 v);
7151#endif
7152
7153#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007154/**
7155 * Returns the approximate reciprocal of a value.
7156 *
7157 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007158 *
7159 * Supported by API versions 17 and newer.
7160 */
7161extern float4 __attribute__((const, overloadable))half_recip(float4 v);
7162#endif
7163
7164#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007165/**
7166 * Returns the approximate value of (1.f / sqrt(value)).
7167 *
7168 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007169 *
7170 * Supported by API versions 17 and newer.
7171 */
7172extern float __attribute__((const, overloadable))half_rsqrt(float v);
7173#endif
7174
7175#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007176/**
7177 * Returns the approximate value of (1.f / sqrt(value)).
7178 *
7179 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007180 *
7181 * Supported by API versions 17 and newer.
7182 */
7183extern float2 __attribute__((const, overloadable))half_rsqrt(float2 v);
7184#endif
7185
7186#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007187/**
7188 * Returns the approximate value of (1.f / sqrt(value)).
7189 *
7190 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007191 *
7192 * Supported by API versions 17 and newer.
7193 */
7194extern float3 __attribute__((const, overloadable))half_rsqrt(float3 v);
7195#endif
7196
7197#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007198/**
7199 * Returns the approximate value of (1.f / sqrt(value)).
7200 *
7201 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007202 *
7203 * Supported by API versions 17 and newer.
7204 */
7205extern float4 __attribute__((const, overloadable))half_rsqrt(float4 v);
7206#endif
7207
7208#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007209/**
7210 * Returns the approximate square root of a value.
7211 *
7212 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007213 *
7214 * Supported by API versions 17 and newer.
7215 */
7216extern float __attribute__((const, overloadable))half_sqrt(float v);
7217#endif
7218
7219#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007220/**
7221 * Returns the approximate square root of a value.
7222 *
7223 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007224 *
7225 * Supported by API versions 17 and newer.
7226 */
7227extern float2 __attribute__((const, overloadable))half_sqrt(float2 v);
7228#endif
7229
7230#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007231/**
7232 * Returns the approximate square root of a value.
7233 *
7234 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007235 *
7236 * Supported by API versions 17 and newer.
7237 */
7238extern float3 __attribute__((const, overloadable))half_sqrt(float3 v);
7239#endif
7240
7241#if (defined(RS_VERSION) && (RS_VERSION >= 17))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007242/**
7243 * Returns the approximate square root of a value.
7244 *
7245 * The precision is that of a 16 bit floating point value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007246 *
7247 * Supported by API versions 17 and newer.
7248 */
7249extern float4 __attribute__((const, overloadable))half_sqrt(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08007250#endif
7251
7252#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007253/**
7254 * Returns the hypotenuse, i.e. sqrt(x * x + y * y).
Jason Sams29087fa2014-01-09 17:06:17 -08007255 *
7256 * Supported by API versions 9 and newer.
7257 */
7258extern float __attribute__((const, overloadable))hypot(float x, float y);
7259#endif
7260
7261#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007262/**
7263 * Returns the hypotenuse, i.e. sqrt(x * x + y * y).
Jason Sams29087fa2014-01-09 17:06:17 -08007264 *
7265 * Supported by API versions 9 and newer.
7266 */
7267extern float2 __attribute__((const, overloadable))hypot(float2 x, float2 y);
7268#endif
7269
7270#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007271/**
7272 * Returns the hypotenuse, i.e. sqrt(x * x + y * y).
Jason Sams29087fa2014-01-09 17:06:17 -08007273 *
7274 * Supported by API versions 9 and newer.
7275 */
7276extern float3 __attribute__((const, overloadable))hypot(float3 x, float3 y);
7277#endif
7278
7279#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007280/**
7281 * Returns the hypotenuse, i.e. sqrt(x * x + y * y).
Jason Sams29087fa2014-01-09 17:06:17 -08007282 *
7283 * Supported by API versions 9 and newer.
7284 */
7285extern float4 __attribute__((const, overloadable))hypot(float4 x, float4 y);
7286#endif
7287
7288#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007289/**
7290 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7291 *
7292 * For example, ilogb(8.5f) returns 3. Because of the difference in mantissa, this number is one less than
7293 * is returned by frexp().
7294 *
7295 * logb() is similar but returns a float.
Jason Sams29087fa2014-01-09 17:06:17 -08007296 *
7297 * Supported by API versions 9 and newer.
7298 */
7299extern int __attribute__((const, overloadable))ilogb(float);
7300#endif
7301
7302#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007303/**
7304 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7305 *
7306 * For example, ilogb(8.5f) returns 3. Because of the difference in mantissa, this number is one less than
7307 * is returned by frexp().
7308 *
7309 * logb() is similar but returns a float.
Jason Sams29087fa2014-01-09 17:06:17 -08007310 *
7311 * Supported by API versions 9 and newer.
7312 */
7313extern int2 __attribute__((const, overloadable))ilogb(float2);
7314#endif
7315
7316#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007317/**
7318 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7319 *
7320 * For example, ilogb(8.5f) returns 3. Because of the difference in mantissa, this number is one less than
7321 * is returned by frexp().
7322 *
7323 * logb() is similar but returns a float.
Jason Sams29087fa2014-01-09 17:06:17 -08007324 *
7325 * Supported by API versions 9 and newer.
7326 */
7327extern int3 __attribute__((const, overloadable))ilogb(float3);
7328#endif
7329
7330#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007331/**
7332 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7333 *
7334 * For example, ilogb(8.5f) returns 3. Because of the difference in mantissa, this number is one less than
7335 * is returned by frexp().
7336 *
7337 * logb() is similar but returns a float.
Jason Sams29087fa2014-01-09 17:06:17 -08007338 *
7339 * Supported by API versions 9 and newer.
7340 */
7341extern int4 __attribute__((const, overloadable))ilogb(float4);
7342#endif
7343
7344#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007345/**
7346 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
Jason Sams29087fa2014-01-09 17:06:17 -08007347 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007348 * See frexp() for the reverse operation.
7349 *
7350 * @param mantissa Supports float, float2, float3, and float4.
7351 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007352 *
7353 * Supported by API versions 9 and newer.
7354 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007355extern float __attribute__((const, overloadable))ldexp(float mantissa, int exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007356#endif
7357
7358#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007359/**
7360 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
Jason Sams29087fa2014-01-09 17:06:17 -08007361 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007362 * See frexp() for the reverse operation.
7363 *
7364 * @param mantissa Supports float, float2, float3, and float4.
7365 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007366 *
7367 * Supported by API versions 9 and newer.
7368 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007369extern float2 __attribute__((const, overloadable))ldexp(float2 mantissa, int2 exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007370#endif
7371
7372#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007373/**
7374 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
Jason Sams29087fa2014-01-09 17:06:17 -08007375 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007376 * See frexp() for the reverse operation.
7377 *
7378 * @param mantissa Supports float, float2, float3, and float4.
7379 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007380 *
7381 * Supported by API versions 9 and newer.
7382 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007383extern float3 __attribute__((const, overloadable))ldexp(float3 mantissa, int3 exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007384#endif
7385
7386#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007387/**
7388 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
Jason Sams29087fa2014-01-09 17:06:17 -08007389 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007390 * See frexp() for the reverse operation.
7391 *
7392 * @param mantissa Supports float, float2, float3, and float4.
7393 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007394 *
7395 * Supported by API versions 9 and newer.
7396 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007397extern float4 __attribute__((const, overloadable))ldexp(float4 mantissa, int4 exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007398#endif
7399
7400#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007401/**
7402 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
7403 * See frexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007404 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007405 * @param mantissa Supports float, float2, float3, and float4.
7406 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007407 *
7408 * Supported by API versions 9 and newer.
7409 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007410extern float2 __attribute__((const, overloadable))ldexp(float2 mantissa, int exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007411#endif
7412
7413#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007414/**
7415 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
7416 * See frexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007417 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007418 * @param mantissa Supports float, float2, float3, and float4.
7419 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007420 *
7421 * Supported by API versions 9 and newer.
7422 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007423extern float3 __attribute__((const, overloadable))ldexp(float3 mantissa, int exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007424#endif
7425
7426#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007427/**
7428 * Returns the floating point created from the mantissa and exponent, i.e. (mantissa * 2 ^ exponent).
7429 * See frexp() for the reverse operation.
Jason Sams29087fa2014-01-09 17:06:17 -08007430 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007431 * @param mantissa Supports float, float2, float3, and float4.
7432 * @param exponent Supports single component or matching vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007433 *
7434 * Supported by API versions 9 and newer.
7435 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007436extern float4 __attribute__((const, overloadable))ldexp(float4 mantissa, int exponent);
Jason Sams29087fa2014-01-09 17:06:17 -08007437#endif
7438
7439#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007440/**
7441 * Computes the length of a vector.
Jason Sams29087fa2014-01-09 17:06:17 -08007442 *
7443 * Supported by API versions 9 and newer.
7444 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007445extern float __attribute__((const, overloadable))length(float v);
7446#endif
7447
7448#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007449/**
7450 * Computes the length of a vector.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007451 *
7452 * Supported by API versions 9 and newer.
7453 */
7454extern float __attribute__((const, overloadable))length(float2 v);
7455#endif
7456
7457#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007458/**
7459 * Computes the length of a vector.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007460 *
7461 * Supported by API versions 9 and newer.
7462 */
7463extern float __attribute__((const, overloadable))length(float3 v);
7464#endif
7465
7466#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007467/**
7468 * Computes the length of a vector.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007469 *
7470 * Supported by API versions 9 and newer.
7471 */
7472extern float __attribute__((const, overloadable))length(float4 v);
Jason Sams29087fa2014-01-09 17:06:17 -08007473#endif
7474
7475#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007476/**
7477 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(value))).
Jason Sams29087fa2014-01-09 17:06:17 -08007478 *
7479 * Supported by API versions 9 and newer.
7480 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007481extern float __attribute__((const, overloadable))lgamma(float);
Jason Sams29087fa2014-01-09 17:06:17 -08007482#endif
7483
7484#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007485/**
7486 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(value))).
Jason Sams29087fa2014-01-09 17:06:17 -08007487 *
7488 * Supported by API versions 9 and newer.
7489 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007490extern float2 __attribute__((const, overloadable))lgamma(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08007491#endif
7492
7493#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007494/**
7495 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(value))).
Jason Sams29087fa2014-01-09 17:06:17 -08007496 *
7497 * Supported by API versions 9 and newer.
7498 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007499extern float3 __attribute__((const, overloadable))lgamma(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08007500#endif
7501
7502#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007503/**
7504 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(value))).
Jason Sams29087fa2014-01-09 17:06:17 -08007505 *
7506 * Supported by API versions 9 and newer.
7507 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007508extern float4 __attribute__((const, overloadable))lgamma(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08007509#endif
7510
7511#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007512/**
7513 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(x))).
7514 *
7515 * Can also return the sign of the gamma function.
7516 *
7517 * @param x Input value.
7518 * @param sign If sign is not null, each element of sign will be set to -1.f if the gamma of the corresponding element of x is negative, otherwise to 1.f.
7519 *
Jason Sams29087fa2014-01-09 17:06:17 -08007520 *
7521 * Supported by API versions 9 and newer.
7522 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007523extern float __attribute__((overloadable))lgamma(float x, int* sign);
Jason Sams29087fa2014-01-09 17:06:17 -08007524#endif
7525
7526#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007527/**
7528 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(x))).
7529 *
7530 * Can also return the sign of the gamma function.
7531 *
7532 * @param x Input value.
7533 * @param sign If sign is not null, each element of sign will be set to -1.f if the gamma of the corresponding element of x is negative, otherwise to 1.f.
7534 *
Jason Sams29087fa2014-01-09 17:06:17 -08007535 *
7536 * Supported by API versions 9 and newer.
7537 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007538extern float2 __attribute__((overloadable))lgamma(float2 x, int2* sign);
Jason Sams29087fa2014-01-09 17:06:17 -08007539#endif
7540
7541#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007542/**
7543 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(x))).
7544 *
7545 * Can also return the sign of the gamma function.
7546 *
7547 * @param x Input value.
7548 * @param sign If sign is not null, each element of sign will be set to -1.f if the gamma of the corresponding element of x is negative, otherwise to 1.f.
7549 *
Jason Sams29087fa2014-01-09 17:06:17 -08007550 *
7551 * Supported by API versions 9 and newer.
7552 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007553extern float3 __attribute__((overloadable))lgamma(float3 x, int3* sign);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007554#endif
7555
7556#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007557/**
7558 * Returns the natural logarithm of the absolute value of the gamma function, i.e. log(fabs(gamma(x))).
7559 *
7560 * Can also return the sign of the gamma function.
7561 *
7562 * @param x Input value.
7563 * @param sign If sign is not null, each element of sign will be set to -1.f if the gamma of the corresponding element of x is negative, otherwise to 1.f.
7564 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007565 *
7566 * Supported by API versions 9 and newer.
7567 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007568extern float4 __attribute__((overloadable))lgamma(float4 x, int4* sign);
Jason Sams29087fa2014-01-09 17:06:17 -08007569#endif
7570
7571#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007572/**
7573 * Returns the natural logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007574 *
7575 * Supported by API versions 9 and newer.
7576 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007577extern float __attribute__((const, overloadable))log(float);
Jason Sams29087fa2014-01-09 17:06:17 -08007578#endif
7579
7580#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007581/**
7582 * Returns the natural logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007583 *
7584 * Supported by API versions 9 and newer.
7585 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007586extern float2 __attribute__((const, overloadable))log(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08007587#endif
7588
7589#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007590/**
7591 * Returns the natural logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007592 *
7593 * Supported by API versions 9 and newer.
7594 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007595extern float3 __attribute__((const, overloadable))log(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08007596#endif
7597
7598#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007599/**
7600 * Returns the natural logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007601 *
7602 * Supported by API versions 9 and newer.
7603 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007604extern float4 __attribute__((const, overloadable))log(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08007605#endif
7606
7607#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007608/**
7609 * Returns the base 10 logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007610 *
7611 * Supported by API versions 9 and newer.
7612 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007613extern float __attribute__((const, overloadable))log10(float);
Jason Sams29087fa2014-01-09 17:06:17 -08007614#endif
7615
7616#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007617/**
7618 * Returns the base 10 logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007619 *
7620 * Supported by API versions 9 and newer.
7621 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007622extern float2 __attribute__((const, overloadable))log10(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08007623#endif
7624
7625#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007626/**
7627 * Returns the base 10 logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007628 *
7629 * Supported by API versions 9 and newer.
7630 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007631extern float3 __attribute__((const, overloadable))log10(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08007632#endif
7633
7634#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007635/**
7636 * Returns the base 10 logarithm.
Jason Sams29087fa2014-01-09 17:06:17 -08007637 *
7638 * Supported by API versions 9 and newer.
7639 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007640extern float4 __attribute__((const, overloadable))log10(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08007641#endif
7642
7643#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007644/**
7645 * Returns the natural logarithm of (v + 1.f).
Jason Sams29087fa2014-01-09 17:06:17 -08007646 *
7647 * Supported by API versions 9 and newer.
7648 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007649extern float __attribute__((const, overloadable))log1p(float v);
Jason Sams29087fa2014-01-09 17:06:17 -08007650#endif
7651
7652#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007653/**
7654 * Returns the natural logarithm of (v + 1.f).
Jason Sams29087fa2014-01-09 17:06:17 -08007655 *
7656 * Supported by API versions 9 and newer.
7657 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007658extern float2 __attribute__((const, overloadable))log1p(float2 v);
Jason Sams29087fa2014-01-09 17:06:17 -08007659#endif
7660
7661#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007662/**
7663 * Returns the natural logarithm of (v + 1.f).
Jason Sams29087fa2014-01-09 17:06:17 -08007664 *
7665 * Supported by API versions 9 and newer.
7666 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007667extern float3 __attribute__((const, overloadable))log1p(float3 v);
Jason Sams29087fa2014-01-09 17:06:17 -08007668#endif
7669
7670#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007671/**
7672 * Returns the natural logarithm of (v + 1.f).
Jason Sams29087fa2014-01-09 17:06:17 -08007673 *
7674 * Supported by API versions 9 and newer.
7675 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007676extern float4 __attribute__((const, overloadable))log1p(float4 v);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007677#endif
7678
7679#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007680/**
7681 * Returns the base 2 logarithm.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007682 *
7683 * Supported by API versions 9 and newer.
7684 */
7685extern float __attribute__((const, overloadable))log2(float);
7686#endif
7687
7688#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007689/**
7690 * Returns the base 2 logarithm.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007691 *
7692 * Supported by API versions 9 and newer.
7693 */
7694extern float2 __attribute__((const, overloadable))log2(float2);
7695#endif
7696
7697#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007698/**
7699 * Returns the base 2 logarithm.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007700 *
7701 * Supported by API versions 9 and newer.
7702 */
7703extern float3 __attribute__((const, overloadable))log2(float3);
7704#endif
7705
7706#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007707/**
7708 * Returns the base 2 logarithm.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007709 *
7710 * Supported by API versions 9 and newer.
7711 */
7712extern float4 __attribute__((const, overloadable))log2(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08007713#endif
7714
7715#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007716/**
7717 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7718 *
7719 * For example, ilogb(8.5f) returns 3.f. Because of the difference in mantissa, this number is one less than
7720 * is returned by frexp().
7721 *
7722 * ilogb() is similar but returns an integer.
Jason Sams29087fa2014-01-09 17:06:17 -08007723 *
7724 * Supported by API versions 9 and newer.
7725 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007726extern float __attribute__((const, overloadable))logb(float);
Jason Sams29087fa2014-01-09 17:06:17 -08007727#endif
7728
7729#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007730/**
7731 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7732 *
7733 * For example, ilogb(8.5f) returns 3.f. Because of the difference in mantissa, this number is one less than
7734 * is returned by frexp().
7735 *
7736 * ilogb() is similar but returns an integer.
Jason Sams29087fa2014-01-09 17:06:17 -08007737 *
7738 * Supported by API versions 9 and newer.
7739 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007740extern float2 __attribute__((const, overloadable))logb(float2);
Jason Sams29087fa2014-01-09 17:06:17 -08007741#endif
7742
7743#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007744/**
7745 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7746 *
7747 * For example, ilogb(8.5f) returns 3.f. Because of the difference in mantissa, this number is one less than
7748 * is returned by frexp().
7749 *
7750 * ilogb() is similar but returns an integer.
Jason Sams29087fa2014-01-09 17:06:17 -08007751 *
7752 * Supported by API versions 9 and newer.
7753 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007754extern float3 __attribute__((const, overloadable))logb(float3);
Jason Sams29087fa2014-01-09 17:06:17 -08007755#endif
7756
7757#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007758/**
7759 * Returns the base two exponent of a value, where the mantissa is between 1.f (inclusive) and 2.f (exclusive).
7760 *
7761 * For example, ilogb(8.5f) returns 3.f. Because of the difference in mantissa, this number is one less than
7762 * is returned by frexp().
7763 *
7764 * ilogb() is similar but returns an integer.
Jason Sams29087fa2014-01-09 17:06:17 -08007765 *
7766 * Supported by API versions 9 and newer.
7767 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08007768extern float4 __attribute__((const, overloadable))logb(float4);
Jason Sams29087fa2014-01-09 17:06:17 -08007769#endif
7770
7771#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007772/**
7773 * Multiply and add. Returns (a * b) + c.
7774 *
7775 * This function is identical to fma().
Jason Sams29087fa2014-01-09 17:06:17 -08007776 *
7777 * Supported by API versions 9 and newer.
7778 */
7779extern float __attribute__((const, overloadable))mad(float a, float b, float c);
7780#endif
7781
7782#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007783/**
7784 * Multiply and add. Returns (a * b) + c.
7785 *
7786 * This function is identical to fma().
Jason Sams29087fa2014-01-09 17:06:17 -08007787 *
7788 * Supported by API versions 9 and newer.
7789 */
7790extern float2 __attribute__((const, overloadable))mad(float2 a, float2 b, float2 c);
7791#endif
7792
7793#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007794/**
7795 * Multiply and add. Returns (a * b) + c.
7796 *
7797 * This function is identical to fma().
Jason Sams29087fa2014-01-09 17:06:17 -08007798 *
7799 * Supported by API versions 9 and newer.
7800 */
7801extern float3 __attribute__((const, overloadable))mad(float3 a, float3 b, float3 c);
7802#endif
7803
7804#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007805/**
7806 * Multiply and add. Returns (a * b) + c.
7807 *
7808 * This function is identical to fma().
Jason Sams29087fa2014-01-09 17:06:17 -08007809 *
7810 * Supported by API versions 9 and newer.
7811 */
7812extern float4 __attribute__((const, overloadable))mad(float4 a, float4 b, float4 c);
7813#endif
7814
7815#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007816/**
7817 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007818 *
7819 * Supported by API versions 9 and newer.
7820 */
7821extern float __attribute__((const, overloadable))max(float, float);
7822#endif
7823
7824#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007825/**
7826 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007827 *
7828 * Supported by API versions 9 and newer.
7829 */
7830extern float2 __attribute__((const, overloadable))max(float2, float2);
7831#endif
7832
7833#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007834/**
7835 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007836 *
7837 * Supported by API versions 9 and newer.
7838 */
7839extern float3 __attribute__((const, overloadable))max(float3, float3);
7840#endif
7841
7842#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007843/**
7844 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007845 *
7846 * Supported by API versions 9 and newer.
7847 */
7848extern float4 __attribute__((const, overloadable))max(float4, float4);
7849#endif
7850
7851#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007852/**
7853 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007854 *
7855 * Suppored by API versions 9 - 19
7856 */
7857static char __attribute__((const, overloadable))max(char v1, char v2) {
7858 return (v1 > v2 ? v1 : v2);
7859}
7860#endif
7861
7862#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007863/**
7864 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007865 *
7866 * Suppored by API versions 9 - 19
7867 */
7868static uchar __attribute__((const, overloadable))max(uchar v1, uchar v2) {
7869 return (v1 > v2 ? v1 : v2);
7870}
7871#endif
7872
7873#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007874/**
7875 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007876 *
7877 * Suppored by API versions 9 - 19
7878 */
7879static short __attribute__((const, overloadable))max(short v1, short v2) {
7880 return (v1 > v2 ? v1 : v2);
7881}
7882#endif
7883
7884#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007885/**
7886 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007887 *
7888 * Suppored by API versions 9 - 19
7889 */
7890static ushort __attribute__((const, overloadable))max(ushort v1, ushort v2) {
7891 return (v1 > v2 ? v1 : v2);
7892}
7893#endif
7894
7895#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007896/**
7897 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007898 *
7899 * Suppored by API versions 9 - 19
7900 */
7901static int __attribute__((const, overloadable))max(int v1, int v2) {
7902 return (v1 > v2 ? v1 : v2);
7903}
7904#endif
7905
7906#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007907/**
7908 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007909 *
7910 * Suppored by API versions 9 - 19
7911 */
7912static uint __attribute__((const, overloadable))max(uint v1, uint v2) {
7913 return (v1 > v2 ? v1 : v2);
7914}
7915#endif
7916
7917#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007918/**
7919 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007920 *
7921 * Suppored by API versions 9 - 19
7922 */
7923static char2 __attribute__((const, overloadable))max(char2 v1, char2 v2) {
7924 char2 tmp;
7925 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
7926 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
7927 return tmp;
7928}
7929#endif
7930
7931#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007932/**
7933 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007934 *
7935 * Suppored by API versions 9 - 19
7936 */
7937static uchar2 __attribute__((const, overloadable))max(uchar2 v1, uchar2 v2) {
7938 uchar2 tmp;
7939 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
7940 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
7941 return tmp;
7942}
7943#endif
7944
7945#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007946/**
7947 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007948 *
7949 * Suppored by API versions 9 - 19
7950 */
7951static short2 __attribute__((const, overloadable))max(short2 v1, short2 v2) {
7952 short2 tmp;
7953 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
7954 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
7955 return tmp;
7956}
7957#endif
7958
7959#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007960/**
7961 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007962 *
7963 * Suppored by API versions 9 - 19
7964 */
7965static ushort2 __attribute__((const, overloadable))max(ushort2 v1, ushort2 v2) {
7966 ushort2 tmp;
7967 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
7968 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
7969 return tmp;
7970}
7971#endif
7972
7973#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007974/**
7975 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007976 *
7977 * Suppored by API versions 9 - 19
7978 */
7979static int2 __attribute__((const, overloadable))max(int2 v1, int2 v2) {
7980 int2 tmp;
7981 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
7982 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
7983 return tmp;
7984}
7985#endif
7986
7987#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08007988/**
7989 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08007990 *
7991 * Suppored by API versions 9 - 19
7992 */
7993static uint2 __attribute__((const, overloadable))max(uint2 v1, uint2 v2) {
7994 uint2 tmp;
7995 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
7996 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
7997 return tmp;
7998}
7999#endif
8000
8001#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008002/**
8003 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008004 *
8005 * Suppored by API versions 9 - 19
8006 */
8007static char3 __attribute__((const, overloadable))max(char3 v1, char3 v2) {
8008 char3 tmp;
8009 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8010 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8011 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8012 return tmp;
8013}
8014#endif
8015
8016#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008017/**
8018 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008019 *
8020 * Suppored by API versions 9 - 19
8021 */
8022static uchar3 __attribute__((const, overloadable))max(uchar3 v1, uchar3 v2) {
8023 uchar3 tmp;
8024 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8025 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8026 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8027 return tmp;
8028}
8029#endif
8030
8031#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008032/**
8033 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008034 *
8035 * Suppored by API versions 9 - 19
8036 */
8037static short3 __attribute__((const, overloadable))max(short3 v1, short3 v2) {
8038 short3 tmp;
8039 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8040 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8041 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8042 return tmp;
8043}
8044#endif
8045
8046#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008047/**
8048 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008049 *
8050 * Suppored by API versions 9 - 19
8051 */
8052static ushort3 __attribute__((const, overloadable))max(ushort3 v1, ushort3 v2) {
8053 ushort3 tmp;
8054 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8055 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8056 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8057 return tmp;
8058}
8059#endif
8060
8061#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008062/**
8063 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008064 *
8065 * Suppored by API versions 9 - 19
8066 */
8067static int3 __attribute__((const, overloadable))max(int3 v1, int3 v2) {
8068 int3 tmp;
8069 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8070 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8071 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8072 return tmp;
8073}
8074#endif
8075
8076#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008077/**
8078 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008079 *
8080 * Suppored by API versions 9 - 19
8081 */
8082static uint3 __attribute__((const, overloadable))max(uint3 v1, uint3 v2) {
8083 uint3 tmp;
8084 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8085 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8086 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8087 return tmp;
8088}
8089#endif
8090
8091#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008092/**
8093 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008094 *
8095 * Suppored by API versions 9 - 19
8096 */
8097static char4 __attribute__((const, overloadable))max(char4 v1, char4 v2) {
8098 char4 tmp;
8099 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8100 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8101 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8102 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
8103 return tmp;
8104}
8105#endif
8106
8107#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008108/**
8109 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008110 *
8111 * Suppored by API versions 9 - 19
8112 */
8113static uchar4 __attribute__((const, overloadable))max(uchar4 v1, uchar4 v2) {
8114 uchar4 tmp;
8115 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8116 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8117 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8118 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
8119 return tmp;
8120}
8121#endif
8122
8123#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008124/**
8125 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008126 *
8127 * Suppored by API versions 9 - 19
8128 */
8129static short4 __attribute__((const, overloadable))max(short4 v1, short4 v2) {
8130 short4 tmp;
8131 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8132 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8133 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8134 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
8135 return tmp;
8136}
8137#endif
8138
8139#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008140/**
8141 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008142 *
8143 * Suppored by API versions 9 - 19
8144 */
8145static ushort4 __attribute__((const, overloadable))max(ushort4 v1, ushort4 v2) {
8146 ushort4 tmp;
8147 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8148 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8149 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8150 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
8151 return tmp;
8152}
8153#endif
8154
8155#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008156/**
8157 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008158 *
8159 * Suppored by API versions 9 - 19
8160 */
8161static int4 __attribute__((const, overloadable))max(int4 v1, int4 v2) {
8162 int4 tmp;
8163 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8164 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8165 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8166 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
8167 return tmp;
8168}
8169#endif
8170
8171#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008172/**
8173 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008174 *
8175 * Suppored by API versions 9 - 19
8176 */
8177static uint4 __attribute__((const, overloadable))max(uint4 v1, uint4 v2) {
8178 uint4 tmp;
8179 tmp.x = (v1.x > v2.x ? v1.x : v2.x);
8180 tmp.y = (v1.y > v2.y ? v1.y : v2.y);
8181 tmp.z = (v1.z > v2.z ? v1.z : v2.z);
8182 tmp.w = (v1.w > v2.w ? v1.w : v2.w);
8183 return tmp;
8184}
8185#endif
8186
Jason Samsaa456932014-08-18 16:20:51 -07008187#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008188/**
8189 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008190 *
Jason Samsaa456932014-08-18 16:20:51 -07008191 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008192 */
8193extern char __attribute__((const, overloadable))max(char v1, char v2);
8194#endif
8195
Jason Samsaa456932014-08-18 16:20:51 -07008196#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008197/**
8198 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008199 *
Jason Samsaa456932014-08-18 16:20:51 -07008200 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008201 */
8202extern char2 __attribute__((const, overloadable))max(char2 v1, char2 v2);
8203#endif
8204
Jason Samsaa456932014-08-18 16:20:51 -07008205#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008206/**
8207 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008208 *
Jason Samsaa456932014-08-18 16:20:51 -07008209 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008210 */
8211extern char3 __attribute__((const, overloadable))max(char3 v1, char3 v2);
8212#endif
8213
Jason Samsaa456932014-08-18 16:20:51 -07008214#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008215/**
8216 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008217 *
Jason Samsaa456932014-08-18 16:20:51 -07008218 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008219 */
8220extern char4 __attribute__((const, overloadable))max(char4 v1, char4 v2);
8221#endif
8222
Jason Samsaa456932014-08-18 16:20:51 -07008223#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008224/**
8225 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008226 *
Jason Samsaa456932014-08-18 16:20:51 -07008227 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008228 */
8229extern uchar __attribute__((const, overloadable))max(uchar v1, uchar v2);
8230#endif
8231
Jason Samsaa456932014-08-18 16:20:51 -07008232#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008233/**
8234 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008235 *
Jason Samsaa456932014-08-18 16:20:51 -07008236 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008237 */
8238extern uchar2 __attribute__((const, overloadable))max(uchar2 v1, uchar2 v2);
8239#endif
8240
Jason Samsaa456932014-08-18 16:20:51 -07008241#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008242/**
8243 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008244 *
Jason Samsaa456932014-08-18 16:20:51 -07008245 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008246 */
8247extern uchar3 __attribute__((const, overloadable))max(uchar3 v1, uchar3 v2);
8248#endif
8249
Jason Samsaa456932014-08-18 16:20:51 -07008250#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008251/**
8252 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008253 *
Jason Samsaa456932014-08-18 16:20:51 -07008254 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008255 */
8256extern uchar4 __attribute__((const, overloadable))max(uchar4 v1, uchar4 v2);
8257#endif
8258
Jason Samsaa456932014-08-18 16:20:51 -07008259#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008260/**
8261 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008262 *
Jason Samsaa456932014-08-18 16:20:51 -07008263 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008264 */
8265extern short __attribute__((const, overloadable))max(short v1, short v2);
8266#endif
8267
Jason Samsaa456932014-08-18 16:20:51 -07008268#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008269/**
8270 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008271 *
Jason Samsaa456932014-08-18 16:20:51 -07008272 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008273 */
8274extern short2 __attribute__((const, overloadable))max(short2 v1, short2 v2);
8275#endif
8276
Jason Samsaa456932014-08-18 16:20:51 -07008277#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008278/**
8279 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008280 *
Jason Samsaa456932014-08-18 16:20:51 -07008281 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008282 */
8283extern short3 __attribute__((const, overloadable))max(short3 v1, short3 v2);
8284#endif
8285
Jason Samsaa456932014-08-18 16:20:51 -07008286#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008287/**
8288 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008289 *
Jason Samsaa456932014-08-18 16:20:51 -07008290 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008291 */
8292extern short4 __attribute__((const, overloadable))max(short4 v1, short4 v2);
8293#endif
8294
Jason Samsaa456932014-08-18 16:20:51 -07008295#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008296/**
8297 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008298 *
Jason Samsaa456932014-08-18 16:20:51 -07008299 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008300 */
8301extern ushort __attribute__((const, overloadable))max(ushort v1, ushort v2);
8302#endif
8303
Jason Samsaa456932014-08-18 16:20:51 -07008304#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008305/**
8306 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008307 *
Jason Samsaa456932014-08-18 16:20:51 -07008308 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008309 */
8310extern ushort2 __attribute__((const, overloadable))max(ushort2 v1, ushort2 v2);
8311#endif
8312
Jason Samsaa456932014-08-18 16:20:51 -07008313#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008314/**
8315 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008316 *
Jason Samsaa456932014-08-18 16:20:51 -07008317 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008318 */
8319extern ushort3 __attribute__((const, overloadable))max(ushort3 v1, ushort3 v2);
8320#endif
8321
Jason Samsaa456932014-08-18 16:20:51 -07008322#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008323/**
8324 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008325 *
Jason Samsaa456932014-08-18 16:20:51 -07008326 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008327 */
8328extern ushort4 __attribute__((const, overloadable))max(ushort4 v1, ushort4 v2);
8329#endif
8330
Jason Samsaa456932014-08-18 16:20:51 -07008331#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008332/**
8333 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008334 *
Jason Samsaa456932014-08-18 16:20:51 -07008335 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008336 */
8337extern int __attribute__((const, overloadable))max(int v1, int v2);
8338#endif
8339
Jason Samsaa456932014-08-18 16:20:51 -07008340#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008341/**
8342 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008343 *
Jason Samsaa456932014-08-18 16:20:51 -07008344 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008345 */
8346extern int2 __attribute__((const, overloadable))max(int2 v1, int2 v2);
8347#endif
8348
Jason Samsaa456932014-08-18 16:20:51 -07008349#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008350/**
8351 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008352 *
Jason Samsaa456932014-08-18 16:20:51 -07008353 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008354 */
8355extern int3 __attribute__((const, overloadable))max(int3 v1, int3 v2);
8356#endif
8357
Jason Samsaa456932014-08-18 16:20:51 -07008358#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008359/**
8360 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008361 *
Jason Samsaa456932014-08-18 16:20:51 -07008362 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008363 */
8364extern int4 __attribute__((const, overloadable))max(int4 v1, int4 v2);
8365#endif
8366
Jason Samsaa456932014-08-18 16:20:51 -07008367#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008368/**
8369 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008370 *
Jason Samsaa456932014-08-18 16:20:51 -07008371 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008372 */
8373extern uint __attribute__((const, overloadable))max(uint v1, uint v2);
8374#endif
8375
Jason Samsaa456932014-08-18 16:20:51 -07008376#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008377/**
8378 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008379 *
Jason Samsaa456932014-08-18 16:20:51 -07008380 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008381 */
8382extern uint2 __attribute__((const, overloadable))max(uint2 v1, uint2 v2);
8383#endif
8384
Jason Samsaa456932014-08-18 16:20:51 -07008385#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008386/**
8387 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008388 *
Jason Samsaa456932014-08-18 16:20:51 -07008389 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008390 */
8391extern uint3 __attribute__((const, overloadable))max(uint3 v1, uint3 v2);
8392#endif
8393
Jason Samsaa456932014-08-18 16:20:51 -07008394#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008395/**
8396 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008397 *
Jason Samsaa456932014-08-18 16:20:51 -07008398 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008399 */
8400extern uint4 __attribute__((const, overloadable))max(uint4 v1, uint4 v2);
8401#endif
8402
Jason Samsaa456932014-08-18 16:20:51 -07008403#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008404/**
8405 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008406 *
Jason Samsaa456932014-08-18 16:20:51 -07008407 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008408 */
8409extern long __attribute__((const, overloadable))max(long v1, long v2);
8410#endif
8411
Jason Samsaa456932014-08-18 16:20:51 -07008412#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008413/**
8414 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008415 *
Jason Samsaa456932014-08-18 16:20:51 -07008416 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008417 */
8418extern long2 __attribute__((const, overloadable))max(long2 v1, long2 v2);
8419#endif
8420
Jason Samsaa456932014-08-18 16:20:51 -07008421#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008422/**
8423 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008424 *
Jason Samsaa456932014-08-18 16:20:51 -07008425 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008426 */
8427extern long3 __attribute__((const, overloadable))max(long3 v1, long3 v2);
8428#endif
8429
Jason Samsaa456932014-08-18 16:20:51 -07008430#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008431/**
8432 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008433 *
Jason Samsaa456932014-08-18 16:20:51 -07008434 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008435 */
8436extern long4 __attribute__((const, overloadable))max(long4 v1, long4 v2);
8437#endif
8438
Jason Samsaa456932014-08-18 16:20:51 -07008439#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008440/**
8441 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008442 *
Jason Samsaa456932014-08-18 16:20:51 -07008443 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008444 */
8445extern ulong __attribute__((const, overloadable))max(ulong v1, ulong v2);
8446#endif
8447
Jason Samsaa456932014-08-18 16:20:51 -07008448#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008449/**
8450 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008451 *
Jason Samsaa456932014-08-18 16:20:51 -07008452 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008453 */
8454extern ulong2 __attribute__((const, overloadable))max(ulong2 v1, ulong2 v2);
8455#endif
8456
Jason Samsaa456932014-08-18 16:20:51 -07008457#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008458/**
8459 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008460 *
Jason Samsaa456932014-08-18 16:20:51 -07008461 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008462 */
8463extern ulong3 __attribute__((const, overloadable))max(ulong3 v1, ulong3 v2);
8464#endif
8465
Jason Samsaa456932014-08-18 16:20:51 -07008466#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008467/**
8468 * Returns the maximum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008469 *
Jason Samsaa456932014-08-18 16:20:51 -07008470 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008471 */
8472extern ulong4 __attribute__((const, overloadable))max(ulong4 v1, ulong4 v2);
8473#endif
8474
8475#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008476/**
8477 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008478 *
8479 * Supported by API versions 9 and newer.
8480 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008481extern float __attribute__((const, overloadable))min(float, float);
Jason Sams29087fa2014-01-09 17:06:17 -08008482#endif
8483
8484#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008485/**
8486 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008487 *
8488 * Supported by API versions 9 and newer.
8489 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008490extern float2 __attribute__((const, overloadable))min(float2, float2);
Jason Sams29087fa2014-01-09 17:06:17 -08008491#endif
8492
8493#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008494/**
8495 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008496 *
8497 * Supported by API versions 9 and newer.
8498 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008499extern float3 __attribute__((const, overloadable))min(float3, float3);
Jason Sams29087fa2014-01-09 17:06:17 -08008500#endif
8501
8502#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008503/**
8504 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008505 *
8506 * Supported by API versions 9 and newer.
8507 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008508extern float4 __attribute__((const, overloadable))min(float4, float4);
Jason Sams29087fa2014-01-09 17:06:17 -08008509#endif
8510
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008511#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008512/**
8513 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008514 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008515 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008516 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008517static char __attribute__((const, overloadable))min(char v1, char v2) {
8518 return (v1 < v2 ? v1 : v2);
8519}
Jason Sams29087fa2014-01-09 17:06:17 -08008520#endif
8521
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008522#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008523/**
8524 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008525 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008526 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008527 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008528static uchar __attribute__((const, overloadable))min(uchar v1, uchar v2) {
8529 return (v1 < v2 ? v1 : v2);
8530}
Jason Sams29087fa2014-01-09 17:06:17 -08008531#endif
8532
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008533#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008534/**
8535 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008536 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008537 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008538 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008539static short __attribute__((const, overloadable))min(short v1, short v2) {
8540 return (v1 < v2 ? v1 : v2);
8541}
Jason Sams29087fa2014-01-09 17:06:17 -08008542#endif
8543
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008544#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008545/**
8546 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008547 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008548 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008549 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008550static ushort __attribute__((const, overloadable))min(ushort v1, ushort v2) {
8551 return (v1 < v2 ? v1 : v2);
8552}
Jason Sams29087fa2014-01-09 17:06:17 -08008553#endif
8554
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008555#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008556/**
8557 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008558 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008559 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008560 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008561static int __attribute__((const, overloadable))min(int v1, int v2) {
8562 return (v1 < v2 ? v1 : v2);
8563}
Jason Sams29087fa2014-01-09 17:06:17 -08008564#endif
8565
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008566#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008567/**
8568 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008569 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008570 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008571 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008572static uint __attribute__((const, overloadable))min(uint v1, uint v2) {
8573 return (v1 < v2 ? v1 : v2);
8574}
Jason Sams29087fa2014-01-09 17:06:17 -08008575#endif
8576
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008577#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008578/**
8579 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008580 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008581 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008582 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008583static char2 __attribute__((const, overloadable))min(char2 v1, char2 v2) {
8584 char2 tmp;
8585 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8586 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8587 return tmp;
8588}
Jason Sams29087fa2014-01-09 17:06:17 -08008589#endif
8590
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008591#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008592/**
8593 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008594 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008595 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008596 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008597static uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2) {
8598 uchar2 tmp;
8599 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8600 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8601 return tmp;
8602}
Jason Sams29087fa2014-01-09 17:06:17 -08008603#endif
8604
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008605#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008606/**
8607 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008608 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008609 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008610 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008611static short2 __attribute__((const, overloadable))min(short2 v1, short2 v2) {
8612 short2 tmp;
8613 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8614 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8615 return tmp;
8616}
Jason Sams29087fa2014-01-09 17:06:17 -08008617#endif
8618
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008619#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008620/**
8621 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008622 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008623 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008624 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008625static ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2) {
8626 ushort2 tmp;
8627 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8628 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8629 return tmp;
8630}
Jason Sams29087fa2014-01-09 17:06:17 -08008631#endif
8632
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008633#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008634/**
8635 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008636 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008637 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008638 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008639static int2 __attribute__((const, overloadable))min(int2 v1, int2 v2) {
8640 int2 tmp;
8641 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8642 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8643 return tmp;
8644}
Jason Sams29087fa2014-01-09 17:06:17 -08008645#endif
8646
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008647#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008648/**
8649 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008650 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008651 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008652 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008653static uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2) {
8654 uint2 tmp;
8655 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8656 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8657 return tmp;
8658}
Jason Sams29087fa2014-01-09 17:06:17 -08008659#endif
8660
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008661#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008662/**
8663 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008664 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008665 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008666 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008667static char3 __attribute__((const, overloadable))min(char3 v1, char3 v2) {
8668 char3 tmp;
8669 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8670 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8671 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8672 return tmp;
8673}
Jason Sams29087fa2014-01-09 17:06:17 -08008674#endif
8675
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008676#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008677/**
8678 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008679 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008680 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008681 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008682static uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2) {
8683 uchar3 tmp;
8684 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8685 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8686 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8687 return tmp;
8688}
Jason Sams29087fa2014-01-09 17:06:17 -08008689#endif
8690
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008691#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008692/**
8693 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008694 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008695 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008696 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008697static short3 __attribute__((const, overloadable))min(short3 v1, short3 v2) {
8698 short3 tmp;
8699 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8700 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8701 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8702 return tmp;
8703}
Jason Sams29087fa2014-01-09 17:06:17 -08008704#endif
8705
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008706#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008707/**
8708 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008709 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008710 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008711 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008712static ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2) {
8713 ushort3 tmp;
8714 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8715 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8716 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8717 return tmp;
8718}
Jason Sams29087fa2014-01-09 17:06:17 -08008719#endif
8720
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008721#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008722/**
8723 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008724 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008725 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008726 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008727static int3 __attribute__((const, overloadable))min(int3 v1, int3 v2) {
8728 int3 tmp;
8729 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8730 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8731 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8732 return tmp;
8733}
Jason Sams29087fa2014-01-09 17:06:17 -08008734#endif
8735
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008736#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008737/**
8738 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008739 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008740 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008741 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008742static uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2) {
8743 uint3 tmp;
8744 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8745 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8746 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8747 return tmp;
8748}
Jason Sams29087fa2014-01-09 17:06:17 -08008749#endif
8750
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008751#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008752/**
8753 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008754 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008755 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008756 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008757static char4 __attribute__((const, overloadable))min(char4 v1, char4 v2) {
8758 char4 tmp;
8759 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8760 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8761 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8762 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
8763 return tmp;
8764}
Jason Sams29087fa2014-01-09 17:06:17 -08008765#endif
8766
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008767#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008768/**
8769 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008770 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008771 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008772 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008773static uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2) {
8774 uchar4 tmp;
8775 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8776 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8777 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8778 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
8779 return tmp;
8780}
Jason Sams29087fa2014-01-09 17:06:17 -08008781#endif
8782
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008783#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008784/**
8785 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008786 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008787 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008788 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008789static short4 __attribute__((const, overloadable))min(short4 v1, short4 v2) {
8790 short4 tmp;
8791 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8792 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8793 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8794 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
8795 return tmp;
8796}
Jason Sams29087fa2014-01-09 17:06:17 -08008797#endif
8798
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008799#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008800/**
8801 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008802 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008803 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008804 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008805static ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2) {
8806 ushort4 tmp;
8807 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8808 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8809 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8810 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
8811 return tmp;
8812}
Jason Sams29087fa2014-01-09 17:06:17 -08008813#endif
8814
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008815#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008816/**
8817 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008818 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008819 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008820 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008821static int4 __attribute__((const, overloadable))min(int4 v1, int4 v2) {
8822 int4 tmp;
8823 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8824 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8825 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8826 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
8827 return tmp;
8828}
Jason Sams29087fa2014-01-09 17:06:17 -08008829#endif
8830
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008831#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008832/**
8833 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008834 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008835 * Suppored by API versions 9 - 19
Jason Sams29087fa2014-01-09 17:06:17 -08008836 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008837static uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2) {
8838 uint4 tmp;
8839 tmp.x = (v1.x < v2.x ? v1.x : v2.x);
8840 tmp.y = (v1.y < v2.y ? v1.y : v2.y);
8841 tmp.z = (v1.z < v2.z ? v1.z : v2.z);
8842 tmp.w = (v1.w < v2.w ? v1.w : v2.w);
8843 return tmp;
8844}
Jason Sams29087fa2014-01-09 17:06:17 -08008845#endif
8846
Jason Samsaa456932014-08-18 16:20:51 -07008847#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008848/**
8849 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008850 *
Jason Samsaa456932014-08-18 16:20:51 -07008851 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008852 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008853extern char __attribute__((const, overloadable))min(char v1, char v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008854#endif
8855
Jason Samsaa456932014-08-18 16:20:51 -07008856#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008857/**
8858 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008859 *
Jason Samsaa456932014-08-18 16:20:51 -07008860 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008861 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008862extern char2 __attribute__((const, overloadable))min(char2 v1, char2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008863#endif
8864
Jason Samsaa456932014-08-18 16:20:51 -07008865#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008866/**
8867 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008868 *
Jason Samsaa456932014-08-18 16:20:51 -07008869 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008870 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008871extern char3 __attribute__((const, overloadable))min(char3 v1, char3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008872#endif
8873
Jason Samsaa456932014-08-18 16:20:51 -07008874#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008875/**
8876 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008877 *
Jason Samsaa456932014-08-18 16:20:51 -07008878 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008879 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008880extern char4 __attribute__((const, overloadable))min(char4 v1, char4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008881#endif
8882
Jason Samsaa456932014-08-18 16:20:51 -07008883#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008884/**
8885 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008886 *
Jason Samsaa456932014-08-18 16:20:51 -07008887 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008888 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008889extern uchar __attribute__((const, overloadable))min(uchar v1, uchar v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008890#endif
8891
Jason Samsaa456932014-08-18 16:20:51 -07008892#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008893/**
8894 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008895 *
Jason Samsaa456932014-08-18 16:20:51 -07008896 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008897 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008898extern uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008899#endif
8900
Jason Samsaa456932014-08-18 16:20:51 -07008901#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008902/**
8903 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008904 *
Jason Samsaa456932014-08-18 16:20:51 -07008905 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008906 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008907extern uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008908#endif
8909
Jason Samsaa456932014-08-18 16:20:51 -07008910#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008911/**
8912 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008913 *
Jason Samsaa456932014-08-18 16:20:51 -07008914 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008915 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008916extern uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008917#endif
8918
Jason Samsaa456932014-08-18 16:20:51 -07008919#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008920/**
8921 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008922 *
Jason Samsaa456932014-08-18 16:20:51 -07008923 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008924 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008925extern short __attribute__((const, overloadable))min(short v1, short v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008926#endif
8927
Jason Samsaa456932014-08-18 16:20:51 -07008928#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008929/**
8930 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008931 *
Jason Samsaa456932014-08-18 16:20:51 -07008932 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008933 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008934extern short2 __attribute__((const, overloadable))min(short2 v1, short2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008935#endif
8936
Jason Samsaa456932014-08-18 16:20:51 -07008937#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008938/**
8939 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008940 *
Jason Samsaa456932014-08-18 16:20:51 -07008941 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008942 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008943extern short3 __attribute__((const, overloadable))min(short3 v1, short3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008944#endif
8945
Jason Samsaa456932014-08-18 16:20:51 -07008946#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008947/**
8948 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008949 *
Jason Samsaa456932014-08-18 16:20:51 -07008950 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008951 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008952extern short4 __attribute__((const, overloadable))min(short4 v1, short4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008953#endif
8954
Jason Samsaa456932014-08-18 16:20:51 -07008955#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008956/**
8957 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008958 *
Jason Samsaa456932014-08-18 16:20:51 -07008959 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008960 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008961extern ushort __attribute__((const, overloadable))min(ushort v1, ushort v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008962#endif
8963
Jason Samsaa456932014-08-18 16:20:51 -07008964#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008965/**
8966 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008967 *
Jason Samsaa456932014-08-18 16:20:51 -07008968 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008969 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008970extern ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008971#endif
8972
Jason Samsaa456932014-08-18 16:20:51 -07008973#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008974/**
8975 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008976 *
Jason Samsaa456932014-08-18 16:20:51 -07008977 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008978 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008979extern ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008980#endif
8981
Jason Samsaa456932014-08-18 16:20:51 -07008982#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008983/**
8984 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008985 *
Jason Samsaa456932014-08-18 16:20:51 -07008986 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008987 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008988extern ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008989#endif
8990
Jason Samsaa456932014-08-18 16:20:51 -07008991#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08008992/**
8993 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08008994 *
Jason Samsaa456932014-08-18 16:20:51 -07008995 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08008996 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08008997extern int __attribute__((const, overloadable))min(int v1, int v2);
Jason Sams29087fa2014-01-09 17:06:17 -08008998#endif
8999
Jason Samsaa456932014-08-18 16:20:51 -07009000#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009001/**
9002 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009003 *
Jason Samsaa456932014-08-18 16:20:51 -07009004 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009005 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009006extern int2 __attribute__((const, overloadable))min(int2 v1, int2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009007#endif
9008
Jason Samsaa456932014-08-18 16:20:51 -07009009#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009010/**
9011 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009012 *
Jason Samsaa456932014-08-18 16:20:51 -07009013 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009014 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009015extern int3 __attribute__((const, overloadable))min(int3 v1, int3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009016#endif
9017
Jason Samsaa456932014-08-18 16:20:51 -07009018#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009019/**
9020 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009021 *
Jason Samsaa456932014-08-18 16:20:51 -07009022 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009023 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009024extern int4 __attribute__((const, overloadable))min(int4 v1, int4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009025#endif
9026
Jason Samsaa456932014-08-18 16:20:51 -07009027#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009028/**
9029 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009030 *
Jason Samsaa456932014-08-18 16:20:51 -07009031 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009032 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009033extern uint __attribute__((const, overloadable))min(uint v1, uint v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009034#endif
9035
Jason Samsaa456932014-08-18 16:20:51 -07009036#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009037/**
9038 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009039 *
Jason Samsaa456932014-08-18 16:20:51 -07009040 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009041 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009042extern uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009043#endif
9044
Jason Samsaa456932014-08-18 16:20:51 -07009045#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009046/**
9047 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009048 *
Jason Samsaa456932014-08-18 16:20:51 -07009049 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009050 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009051extern uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009052#endif
9053
Jason Samsaa456932014-08-18 16:20:51 -07009054#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009055/**
9056 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009057 *
Jason Samsaa456932014-08-18 16:20:51 -07009058 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009059 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009060extern uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009061#endif
9062
Jason Samsaa456932014-08-18 16:20:51 -07009063#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009064/**
9065 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009066 *
Jason Samsaa456932014-08-18 16:20:51 -07009067 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009068 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009069extern long __attribute__((const, overloadable))min(long v1, long v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009070#endif
9071
Jason Samsaa456932014-08-18 16:20:51 -07009072#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009073/**
9074 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009075 *
Jason Samsaa456932014-08-18 16:20:51 -07009076 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009077 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009078extern long2 __attribute__((const, overloadable))min(long2 v1, long2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009079#endif
9080
Jason Samsaa456932014-08-18 16:20:51 -07009081#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009082/**
9083 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009084 *
Jason Samsaa456932014-08-18 16:20:51 -07009085 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009086 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009087extern long3 __attribute__((const, overloadable))min(long3 v1, long3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009088#endif
9089
Jason Samsaa456932014-08-18 16:20:51 -07009090#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009091/**
9092 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009093 *
Jason Samsaa456932014-08-18 16:20:51 -07009094 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009095 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009096extern long4 __attribute__((const, overloadable))min(long4 v1, long4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009097#endif
9098
Jason Samsaa456932014-08-18 16:20:51 -07009099#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009100/**
9101 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009102 *
Jason Samsaa456932014-08-18 16:20:51 -07009103 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009104 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009105extern ulong __attribute__((const, overloadable))min(ulong v1, ulong v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009106#endif
9107
Jason Samsaa456932014-08-18 16:20:51 -07009108#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009109/**
9110 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009111 *
Jason Samsaa456932014-08-18 16:20:51 -07009112 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009113 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009114extern ulong2 __attribute__((const, overloadable))min(ulong2 v1, ulong2 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009115#endif
9116
Jason Samsaa456932014-08-18 16:20:51 -07009117#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009118/**
9119 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009120 *
Jason Samsaa456932014-08-18 16:20:51 -07009121 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009122 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009123extern ulong3 __attribute__((const, overloadable))min(ulong3 v1, ulong3 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009124#endif
9125
Jason Samsaa456932014-08-18 16:20:51 -07009126#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009127/**
9128 * Returns the minimum value from two arguments
Jason Sams29087fa2014-01-09 17:06:17 -08009129 *
Jason Samsaa456932014-08-18 16:20:51 -07009130 * Supported by API versions 21 and newer.
Jason Sams29087fa2014-01-09 17:06:17 -08009131 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009132extern ulong4 __attribute__((const, overloadable))min(ulong4 v1, ulong4 v2);
Jason Sams29087fa2014-01-09 17:06:17 -08009133#endif
9134
9135#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009136/**
9137 * Returns start + ((stop - start) * amount).
Jason Sams29087fa2014-01-09 17:06:17 -08009138 *
9139 * Supported by API versions 9 and newer.
9140 */
9141extern float __attribute__((const, overloadable))mix(float start, float stop, float amount);
9142#endif
9143
9144#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009145/**
9146 * Returns start + ((stop - start) * amount).
Jason Sams29087fa2014-01-09 17:06:17 -08009147 *
9148 * Supported by API versions 9 and newer.
9149 */
9150extern float2 __attribute__((const, overloadable))mix(float2 start, float2 stop, float2 amount);
9151#endif
9152
9153#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009154/**
9155 * Returns start + ((stop - start) * amount).
Jason Sams29087fa2014-01-09 17:06:17 -08009156 *
9157 * Supported by API versions 9 and newer.
9158 */
9159extern float3 __attribute__((const, overloadable))mix(float3 start, float3 stop, float3 amount);
9160#endif
9161
9162#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009163/**
9164 * Returns start + ((stop - start) * amount).
Jason Sams29087fa2014-01-09 17:06:17 -08009165 *
9166 * Supported by API versions 9 and newer.
9167 */
9168extern float4 __attribute__((const, overloadable))mix(float4 start, float4 stop, float4 amount);
9169#endif
9170
9171#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009172/**
9173 * Returns start + ((stop - start) * amount).
9174 *
9175 * This can be useful for mixing two values. For example, to create a new color that is 40% color1 and 60% color2, use mix(color1, color2, 0.6f).
Jason Sams29087fa2014-01-09 17:06:17 -08009176 *
9177 * Supported by API versions 9 and newer.
9178 */
Jason Sams29087fa2014-01-09 17:06:17 -08009179extern float2 __attribute__((const, overloadable))mix(float2 start, float2 stop, float amount);
9180#endif
9181
9182#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009183/**
9184 * Returns start + ((stop - start) * amount).
9185 *
9186 * This can be useful for mixing two values. For example, to create a new color that is 40% color1 and 60% color2, use mix(color1, color2, 0.6f).
Jason Sams29087fa2014-01-09 17:06:17 -08009187 *
9188 * Supported by API versions 9 and newer.
9189 */
9190extern float3 __attribute__((const, overloadable))mix(float3 start, float3 stop, float amount);
9191#endif
9192
9193#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009194/**
9195 * Returns start + ((stop - start) * amount).
9196 *
9197 * This can be useful for mixing two values. For example, to create a new color that is 40% color1 and 60% color2, use mix(color1, color2, 0.6f).
Jason Sams29087fa2014-01-09 17:06:17 -08009198 *
9199 * Supported by API versions 9 and newer.
9200 */
9201extern float4 __attribute__((const, overloadable))mix(float4 start, float4 stop, float amount);
9202#endif
9203
9204#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009205/**
9206 * Returns the integral and fractional components of a number.
9207 *
9208 * Both components will have the same sign as x. For example, for an input of -3.72f, iret will be set to -3.f and .72f will be returned.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009209 *
9210 * @param x Source value
9211 * @param iret iret[0] will be set to the integral portion of the number.
9212 * @return The floating point portion of the value.
9213 *
9214 * Supported by API versions 9 and newer.
9215 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009216extern float __attribute__((overloadable))modf(float x, float* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009217#endif
9218
9219#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009220/**
9221 * Returns the integral and fractional components of a number.
9222 *
9223 * Both components will have the same sign as x. For example, for an input of -3.72f, iret will be set to -3.f and .72f will be returned.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009224 *
9225 * @param x Source value
9226 * @param iret iret[0] will be set to the integral portion of the number.
9227 * @return The floating point portion of the value.
9228 *
9229 * Supported by API versions 9 and newer.
9230 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009231extern float2 __attribute__((overloadable))modf(float2 x, float2* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009232#endif
9233
9234#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009235/**
9236 * Returns the integral and fractional components of a number.
9237 *
9238 * Both components will have the same sign as x. For example, for an input of -3.72f, iret will be set to -3.f and .72f will be returned.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009239 *
9240 * @param x Source value
9241 * @param iret iret[0] will be set to the integral portion of the number.
9242 * @return The floating point portion of the value.
9243 *
9244 * Supported by API versions 9 and newer.
9245 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009246extern float3 __attribute__((overloadable))modf(float3 x, float3* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009247#endif
9248
9249#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009250/**
9251 * Returns the integral and fractional components of a number.
9252 *
9253 * Both components will have the same sign as x. For example, for an input of -3.72f, iret will be set to -3.f and .72f will be returned.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009254 *
9255 * @param x Source value
9256 * @param iret iret[0] will be set to the integral portion of the number.
9257 * @return The floating point portion of the value.
9258 *
9259 * Supported by API versions 9 and newer.
9260 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -08009261extern float4 __attribute__((overloadable))modf(float4 x, float4* iret);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009262#endif
9263
9264#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009265/**
9266 * Returns a NaN value (Not a Number).
9267 *
9268 * The argument is embedded into the return value and can be used to distinguish various NaNs.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009269 *
9270 * Supported by API versions 9 and newer.
9271 */
9272extern float __attribute__((const, overloadable))nan(uint);
9273#endif
9274
Jason Samsd2d7c182014-07-17 18:41:25 -07009275#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009276/**
9277 * Returns the approximate inverse cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009278 *
9279 * Supported by API versions 21 and newer.
9280 */
9281extern float __attribute__((const, overloadable))native_acos(float v);
9282#endif
9283
9284#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009285/**
9286 * Returns the approximate inverse cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009287 *
9288 * Supported by API versions 21 and newer.
9289 */
9290extern float2 __attribute__((const, overloadable))native_acos(float2 v);
9291#endif
9292
9293#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009294/**
9295 * Returns the approximate inverse cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009296 *
9297 * Supported by API versions 21 and newer.
9298 */
9299extern float3 __attribute__((const, overloadable))native_acos(float3 v);
9300#endif
9301
9302#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009303/**
9304 * Returns the approximate inverse cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009305 *
9306 * Supported by API versions 21 and newer.
9307 */
9308extern float4 __attribute__((const, overloadable))native_acos(float4 v);
9309#endif
9310
9311#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009312/**
9313 * Returns the approximate inverse hyperbolic cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009314 *
9315 * Supported by API versions 21 and newer.
9316 */
9317extern float __attribute__((const, overloadable))native_acosh(float);
9318#endif
9319
9320#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009321/**
9322 * Returns the approximate inverse hyperbolic cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009323 *
9324 * Supported by API versions 21 and newer.
9325 */
9326extern float2 __attribute__((const, overloadable))native_acosh(float2);
9327#endif
9328
9329#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009330/**
9331 * Returns the approximate inverse hyperbolic cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009332 *
9333 * Supported by API versions 21 and newer.
9334 */
9335extern float3 __attribute__((const, overloadable))native_acosh(float3);
9336#endif
9337
9338#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009339/**
9340 * Returns the approximate inverse hyperbolic cosine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009341 *
9342 * Supported by API versions 21 and newer.
9343 */
9344extern float4 __attribute__((const, overloadable))native_acosh(float4);
9345#endif
9346
9347#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009348/**
9349 * Returns the approximate inverse cosine in radians, divided by pi.
9350 *
9351 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009352 *
9353 * Supported by API versions 21 and newer.
9354 */
9355extern float __attribute__((const, overloadable))native_acospi(float v);
9356#endif
9357
9358#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009359/**
9360 * Returns the approximate inverse cosine in radians, divided by pi.
9361 *
9362 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009363 *
9364 * Supported by API versions 21 and newer.
9365 */
9366extern float2 __attribute__((const, overloadable))native_acospi(float2 v);
9367#endif
9368
9369#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009370/**
9371 * Returns the approximate inverse cosine in radians, divided by pi.
9372 *
9373 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009374 *
9375 * Supported by API versions 21 and newer.
9376 */
9377extern float3 __attribute__((const, overloadable))native_acospi(float3 v);
9378#endif
9379
9380#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009381/**
9382 * Returns the approximate inverse cosine in radians, divided by pi.
9383 *
9384 * To get an inverse cosine measured in degrees, use acospi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009385 *
9386 * Supported by API versions 21 and newer.
9387 */
9388extern float4 __attribute__((const, overloadable))native_acospi(float4 v);
9389#endif
9390
9391#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009392/**
9393 * Returns the approximate inverse sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009394 *
9395 * Supported by API versions 21 and newer.
9396 */
9397extern float __attribute__((const, overloadable))native_asin(float v);
9398#endif
9399
9400#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009401/**
9402 * Returns the approximate inverse sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009403 *
9404 * Supported by API versions 21 and newer.
9405 */
9406extern float2 __attribute__((const, overloadable))native_asin(float2 v);
9407#endif
9408
9409#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009410/**
9411 * Returns the approximate inverse sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009412 *
9413 * Supported by API versions 21 and newer.
9414 */
9415extern float3 __attribute__((const, overloadable))native_asin(float3 v);
9416#endif
9417
9418#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009419/**
9420 * Returns the approximate inverse sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009421 *
9422 * Supported by API versions 21 and newer.
9423 */
9424extern float4 __attribute__((const, overloadable))native_asin(float4 v);
9425#endif
9426
9427#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009428/**
9429 * Returns the approximate inverse hyperbolic sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009430 *
9431 * Supported by API versions 21 and newer.
9432 */
9433extern float __attribute__((const, overloadable))native_asinh(float);
9434#endif
9435
9436#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009437/**
9438 * Returns the approximate inverse hyperbolic sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009439 *
9440 * Supported by API versions 21 and newer.
9441 */
9442extern float2 __attribute__((const, overloadable))native_asinh(float2);
9443#endif
9444
9445#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009446/**
9447 * Returns the approximate inverse hyperbolic sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009448 *
9449 * Supported by API versions 21 and newer.
9450 */
9451extern float3 __attribute__((const, overloadable))native_asinh(float3);
9452#endif
9453
9454#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009455/**
9456 * Returns the approximate inverse hyperbolic sine, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009457 *
9458 * Supported by API versions 21 and newer.
9459 */
9460extern float4 __attribute__((const, overloadable))native_asinh(float4);
9461#endif
9462
9463#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009464/**
9465 * Returns the approximate inverse sine in radians, divided by pi.
9466 *
9467 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009468 *
9469 * Supported by API versions 21 and newer.
9470 */
9471extern float __attribute__((const, overloadable))native_asinpi(float v);
9472#endif
9473
9474#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009475/**
9476 * Returns the approximate inverse sine in radians, divided by pi.
9477 *
9478 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009479 *
9480 * Supported by API versions 21 and newer.
9481 */
9482extern float2 __attribute__((const, overloadable))native_asinpi(float2 v);
9483#endif
9484
9485#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009486/**
9487 * Returns the approximate inverse sine in radians, divided by pi.
9488 *
9489 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009490 *
9491 * Supported by API versions 21 and newer.
9492 */
9493extern float3 __attribute__((const, overloadable))native_asinpi(float3 v);
9494#endif
9495
9496#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009497/**
9498 * Returns the approximate inverse sine in radians, divided by pi.
9499 *
9500 * To get an inverse sine measured in degrees, use asinpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009501 *
9502 * Supported by API versions 21 and newer.
9503 */
9504extern float4 __attribute__((const, overloadable))native_asinpi(float4 v);
9505#endif
9506
9507#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009508/**
9509 * Returns the approximate inverse tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009510 *
9511 * Supported by API versions 21 and newer.
9512 */
9513extern float __attribute__((const, overloadable))native_atan(float v);
9514#endif
9515
9516#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009517/**
9518 * Returns the approximate inverse tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009519 *
9520 * Supported by API versions 21 and newer.
9521 */
9522extern float2 __attribute__((const, overloadable))native_atan(float2 v);
9523#endif
9524
9525#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009526/**
9527 * Returns the approximate inverse tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009528 *
9529 * Supported by API versions 21 and newer.
9530 */
9531extern float3 __attribute__((const, overloadable))native_atan(float3 v);
9532#endif
9533
9534#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009535/**
9536 * Returns the approximate inverse tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009537 *
9538 * Supported by API versions 21 and newer.
9539 */
9540extern float4 __attribute__((const, overloadable))native_atan(float4 v);
9541#endif
9542
9543#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009544/**
9545 * Returns the approximate inverse tangent of y / x, in radians.
9546 *
9547 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009548 *
9549 * Supported by API versions 21 and newer.
9550 */
9551extern float __attribute__((const, overloadable))native_atan2(float y, float x);
9552#endif
9553
9554#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009555/**
9556 * Returns the approximate inverse tangent of y / x, in radians.
9557 *
9558 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009559 *
9560 * Supported by API versions 21 and newer.
9561 */
9562extern float2 __attribute__((const, overloadable))native_atan2(float2 y, float2 x);
9563#endif
9564
9565#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009566/**
9567 * Returns the approximate inverse tangent of y / x, in radians.
9568 *
9569 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009570 *
9571 * Supported by API versions 21 and newer.
9572 */
9573extern float3 __attribute__((const, overloadable))native_atan2(float3 y, float3 x);
9574#endif
9575
9576#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009577/**
9578 * Returns the approximate inverse tangent of y / x, in radians.
9579 *
9580 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009581 *
9582 * Supported by API versions 21 and newer.
9583 */
9584extern float4 __attribute__((const, overloadable))native_atan2(float4 y, float4 x);
9585#endif
9586
9587#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009588/**
9589 * Returns the approximate inverse tangent of y / x, in radians, divided by pi.
9590 *
9591 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
9592 *
9593 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009594 *
9595 * Supported by API versions 21 and newer.
9596 */
9597extern float __attribute__((const, overloadable))native_atan2pi(float y, float x);
9598#endif
9599
9600#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009601/**
9602 * Returns the approximate inverse tangent of y / x, in radians, divided by pi.
9603 *
9604 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
9605 *
9606 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009607 *
9608 * Supported by API versions 21 and newer.
9609 */
9610extern float2 __attribute__((const, overloadable))native_atan2pi(float2 y, float2 x);
9611#endif
9612
9613#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009614/**
9615 * Returns the approximate inverse tangent of y / x, in radians, divided by pi.
9616 *
9617 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
9618 *
9619 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009620 *
9621 * Supported by API versions 21 and newer.
9622 */
9623extern float3 __attribute__((const, overloadable))native_atan2pi(float3 y, float3 x);
9624#endif
9625
9626#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009627/**
9628 * Returns the approximate inverse tangent of y / x, in radians, divided by pi.
9629 *
9630 * To get an inverse tangent measured in degrees, use atan2pi(x, y) * 180.f.
9631 *
9632 * x can be 0.
Jason Samsd2d7c182014-07-17 18:41:25 -07009633 *
9634 * Supported by API versions 21 and newer.
9635 */
9636extern float4 __attribute__((const, overloadable))native_atan2pi(float4 y, float4 x);
9637#endif
9638
9639#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009640/**
9641 * Returns the approximate inverse hyperbolic tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009642 *
9643 * Supported by API versions 21 and newer.
9644 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -07009645extern float __attribute__((const, overloadable))native_atanh(float in);
Jason Samsd2d7c182014-07-17 18:41:25 -07009646#endif
9647
9648#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009649/**
9650 * Returns the approximate inverse hyperbolic tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009651 *
9652 * Supported by API versions 21 and newer.
9653 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -07009654extern float2 __attribute__((const, overloadable))native_atanh(float2 in);
Jason Samsd2d7c182014-07-17 18:41:25 -07009655#endif
9656
9657#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009658/**
9659 * Returns the approximate inverse hyperbolic tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009660 *
9661 * Supported by API versions 21 and newer.
9662 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -07009663extern float3 __attribute__((const, overloadable))native_atanh(float3 in);
Jason Samsd2d7c182014-07-17 18:41:25 -07009664#endif
9665
9666#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009667/**
9668 * Returns the approximate inverse hyperbolic tangent, in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009669 *
9670 * Supported by API versions 21 and newer.
9671 */
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -07009672extern float4 __attribute__((const, overloadable))native_atanh(float4 in);
Jason Samsd2d7c182014-07-17 18:41:25 -07009673#endif
9674
9675#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009676/**
9677 * Returns the approximate inverse tangent in radians, divided by pi.
9678 *
9679 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009680 *
9681 * Supported by API versions 21 and newer.
9682 */
9683extern float __attribute__((const, overloadable))native_atanpi(float v);
9684#endif
9685
9686#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009687/**
9688 * Returns the approximate inverse tangent in radians, divided by pi.
9689 *
9690 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009691 *
9692 * Supported by API versions 21 and newer.
9693 */
9694extern float2 __attribute__((const, overloadable))native_atanpi(float2 v);
9695#endif
9696
9697#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009698/**
9699 * Returns the approximate inverse tangent in radians, divided by pi.
9700 *
9701 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009702 *
9703 * Supported by API versions 21 and newer.
9704 */
9705extern float3 __attribute__((const, overloadable))native_atanpi(float3 v);
9706#endif
9707
9708#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009709/**
9710 * Returns the approximate inverse tangent in radians, divided by pi.
9711 *
9712 * To get an inverse tangent measured in degrees, use atanpi(a) * 180.f.
Jason Samsd2d7c182014-07-17 18:41:25 -07009713 *
9714 * Supported by API versions 21 and newer.
9715 */
9716extern float4 __attribute__((const, overloadable))native_atanpi(float4 v);
9717#endif
9718
9719#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009720/**
9721 * Returns the approximate cubic root.
Jason Samsd2d7c182014-07-17 18:41:25 -07009722 *
9723 * Supported by API versions 21 and newer.
9724 */
9725extern float __attribute__((const, overloadable))native_cbrt(float);
9726#endif
9727
9728#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009729/**
9730 * Returns the approximate cubic root.
Jason Samsd2d7c182014-07-17 18:41:25 -07009731 *
9732 * Supported by API versions 21 and newer.
9733 */
9734extern float2 __attribute__((const, overloadable))native_cbrt(float2);
9735#endif
9736
9737#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009738/**
9739 * Returns the approximate cubic root.
Jason Samsd2d7c182014-07-17 18:41:25 -07009740 *
9741 * Supported by API versions 21 and newer.
9742 */
9743extern float3 __attribute__((const, overloadable))native_cbrt(float3);
9744#endif
9745
9746#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009747/**
9748 * Returns the approximate cubic root.
Jason Samsd2d7c182014-07-17 18:41:25 -07009749 *
9750 * Supported by API versions 21 and newer.
9751 */
9752extern float4 __attribute__((const, overloadable))native_cbrt(float4);
9753#endif
9754
9755#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009756/**
9757 * Returns the approximate cosine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009758 *
9759 * Supported by API versions 21 and newer.
9760 */
9761extern float __attribute__((const, overloadable))native_cos(float);
9762#endif
9763
9764#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009765/**
9766 * Returns the approximate cosine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009767 *
9768 * Supported by API versions 21 and newer.
9769 */
9770extern float2 __attribute__((const, overloadable))native_cos(float2);
9771#endif
9772
9773#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009774/**
9775 * Returns the approximate cosine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009776 *
9777 * Supported by API versions 21 and newer.
9778 */
9779extern float3 __attribute__((const, overloadable))native_cos(float3);
9780#endif
9781
9782#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009783/**
9784 * Returns the approximate cosine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -07009785 *
9786 * Supported by API versions 21 and newer.
9787 */
9788extern float4 __attribute__((const, overloadable))native_cos(float4);
9789#endif
9790
9791#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009792/**
9793 * Returns the approximate hypebolic cosine.
Jason Samsd2d7c182014-07-17 18:41:25 -07009794 *
9795 * Supported by API versions 21 and newer.
9796 */
9797extern float __attribute__((const, overloadable))native_cosh(float);
9798#endif
9799
9800#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009801/**
9802 * Returns the approximate hypebolic cosine.
Jason Samsd2d7c182014-07-17 18:41:25 -07009803 *
9804 * Supported by API versions 21 and newer.
9805 */
9806extern float2 __attribute__((const, overloadable))native_cosh(float2);
9807#endif
9808
9809#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009810/**
9811 * Returns the approximate hypebolic cosine.
Jason Samsd2d7c182014-07-17 18:41:25 -07009812 *
9813 * Supported by API versions 21 and newer.
9814 */
9815extern float3 __attribute__((const, overloadable))native_cosh(float3);
9816#endif
9817
9818#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009819/**
9820 * Returns the approximate hypebolic cosine.
Jason Samsd2d7c182014-07-17 18:41:25 -07009821 *
9822 * Supported by API versions 21 and newer.
9823 */
9824extern float4 __attribute__((const, overloadable))native_cosh(float4);
9825#endif
9826
9827#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009828/**
9829 * Returns the approximate cosine of (x * pi), where (x * pi) is measured in radians.
9830 *
9831 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -07009832 *
9833 * Supported by API versions 21 and newer.
9834 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009835extern float __attribute__((const, overloadable))native_cospi(float x);
Jason Samsd2d7c182014-07-17 18:41:25 -07009836#endif
9837
9838#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009839/**
9840 * Returns the approximate cosine of (x * pi), where (x * pi) is measured in radians.
9841 *
9842 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -07009843 *
9844 * Supported by API versions 21 and newer.
9845 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009846extern float2 __attribute__((const, overloadable))native_cospi(float2 x);
Jason Samsd2d7c182014-07-17 18:41:25 -07009847#endif
9848
9849#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009850/**
9851 * Returns the approximate cosine of (x * pi), where (x * pi) is measured in radians.
9852 *
9853 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -07009854 *
9855 * Supported by API versions 21 and newer.
9856 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009857extern float3 __attribute__((const, overloadable))native_cospi(float3 x);
Jason Samsd2d7c182014-07-17 18:41:25 -07009858#endif
9859
9860#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009861/**
9862 * Returns the approximate cosine of (x * pi), where (x * pi) is measured in radians.
9863 *
9864 * To get the cosine of a value measured in degrees, call cospi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -07009865 *
9866 * Supported by API versions 21 and newer.
9867 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009868extern float4 __attribute__((const, overloadable))native_cospi(float4 x);
Jason Samsd2d7c182014-07-17 18:41:25 -07009869#endif
9870
9871#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009872/**
9873 * Computes the approximate distance between two points.
Jason Samsd2d7c182014-07-17 18:41:25 -07009874 *
9875 * Supported by API versions 21 and newer.
9876 */
9877extern float __attribute__((const, overloadable))native_distance(float lhs, float rhs);
9878#endif
9879
9880#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009881/**
9882 * Computes the approximate distance between two points.
Jason Samsd2d7c182014-07-17 18:41:25 -07009883 *
9884 * Supported by API versions 21 and newer.
9885 */
9886extern float __attribute__((const, overloadable))native_distance(float2 lhs, float2 rhs);
9887#endif
9888
9889#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009890/**
9891 * Computes the approximate distance between two points.
Jason Samsd2d7c182014-07-17 18:41:25 -07009892 *
9893 * Supported by API versions 21 and newer.
9894 */
9895extern float __attribute__((const, overloadable))native_distance(float3 lhs, float3 rhs);
9896#endif
9897
9898#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009899/**
9900 * Computes the approximate distance between two points.
Jason Samsd2d7c182014-07-17 18:41:25 -07009901 *
9902 * Supported by API versions 21 and newer.
9903 */
9904extern float __attribute__((const, overloadable))native_distance(float4 lhs, float4 rhs);
9905#endif
9906
9907#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009908/**
9909 * Computes the approximate division result of two values.
Jason Samsd2d7c182014-07-17 18:41:25 -07009910 *
9911 * Supported by API versions 21 and newer.
9912 */
9913extern float __attribute__((const, overloadable))native_divide(float lhs, float rhs);
9914#endif
9915
9916#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009917/**
9918 * Computes the approximate division result of two values.
Jason Samsd2d7c182014-07-17 18:41:25 -07009919 *
9920 * Supported by API versions 21 and newer.
9921 */
9922extern float2 __attribute__((const, overloadable))native_divide(float2 lhs, float2 rhs);
9923#endif
9924
9925#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009926/**
9927 * Computes the approximate division result of two values.
Jason Samsd2d7c182014-07-17 18:41:25 -07009928 *
9929 * Supported by API versions 21 and newer.
9930 */
9931extern float3 __attribute__((const, overloadable))native_divide(float3 lhs, float3 rhs);
9932#endif
9933
9934#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009935/**
9936 * Computes the approximate division result of two values.
Jason Samsd2d7c182014-07-17 18:41:25 -07009937 *
9938 * Supported by API versions 21 and newer.
9939 */
9940extern float4 __attribute__((const, overloadable))native_divide(float4 lhs, float4 rhs);
9941#endif
9942
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009943#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009944/**
9945 * Fast approximate exp.
9946 *
9947 * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009948 *
9949 * Supported by API versions 18 and newer.
9950 */
9951extern float __attribute__((const, overloadable))native_exp(float v);
9952#endif
9953
9954#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009955/**
9956 * Fast approximate exp.
9957 *
9958 * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009959 *
9960 * Supported by API versions 18 and newer.
9961 */
9962extern float2 __attribute__((const, overloadable))native_exp(float2 v);
9963#endif
9964
9965#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009966/**
9967 * Fast approximate exp.
9968 *
9969 * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009970 *
9971 * Supported by API versions 18 and newer.
9972 */
9973extern float3 __attribute__((const, overloadable))native_exp(float3 v);
9974#endif
9975
9976#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009977/**
9978 * Fast approximate exp.
9979 *
9980 * It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009981 *
9982 * Supported by API versions 18 and newer.
9983 */
9984extern float4 __attribute__((const, overloadable))native_exp(float4 v);
9985#endif
9986
9987#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009988/**
9989 * Fast approximate exp10.
9990 *
9991 * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -08009992 *
9993 * Supported by API versions 18 and newer.
9994 */
9995extern float __attribute__((const, overloadable))native_exp10(float v);
9996#endif
9997
9998#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -08009999/**
10000 * Fast approximate exp10.
10001 *
10002 * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010003 *
10004 * Supported by API versions 18 and newer.
10005 */
10006extern float2 __attribute__((const, overloadable))native_exp10(float2 v);
10007#endif
10008
10009#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010010/**
10011 * Fast approximate exp10.
10012 *
10013 * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010014 *
10015 * Supported by API versions 18 and newer.
10016 */
10017extern float3 __attribute__((const, overloadable))native_exp10(float3 v);
10018#endif
10019
10020#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010021/**
10022 * Fast approximate exp10.
10023 *
10024 * It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010025 *
10026 * Supported by API versions 18 and newer.
10027 */
10028extern float4 __attribute__((const, overloadable))native_exp10(float4 v);
10029#endif
10030
10031#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010032/**
10033 * Fast approximate exp2.
10034 *
10035 * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010036 *
10037 * Supported by API versions 18 and newer.
10038 */
10039extern float __attribute__((const, overloadable))native_exp2(float v);
10040#endif
10041
10042#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010043/**
10044 * Fast approximate exp2.
10045 *
10046 * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010047 *
10048 * Supported by API versions 18 and newer.
10049 */
10050extern float2 __attribute__((const, overloadable))native_exp2(float2 v);
10051#endif
10052
10053#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010054/**
10055 * Fast approximate exp2.
10056 *
10057 * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010058 *
10059 * Supported by API versions 18 and newer.
10060 */
10061extern float3 __attribute__((const, overloadable))native_exp2(float3 v);
10062#endif
10063
10064#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010065/**
10066 * Fast approximate exp2.
10067 *
10068 * It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be expected from using 16 bit floating point values.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010069 *
10070 * Supported by API versions 18 and newer.
10071 */
10072extern float4 __attribute__((const, overloadable))native_exp2(float4 v);
10073#endif
10074
Jason Samsd2d7c182014-07-17 18:41:25 -070010075#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010076/**
10077 * Returns the approximate (e ^ value) - 1.
Jason Samsd2d7c182014-07-17 18:41:25 -070010078 *
10079 * Supported by API versions 21 and newer.
10080 */
10081extern float __attribute__((const, overloadable))native_expm1(float);
10082#endif
10083
10084#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010085/**
10086 * Returns the approximate (e ^ value) - 1.
Jason Samsd2d7c182014-07-17 18:41:25 -070010087 *
10088 * Supported by API versions 21 and newer.
10089 */
10090extern float2 __attribute__((const, overloadable))native_expm1(float2);
10091#endif
10092
10093#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010094/**
10095 * Returns the approximate (e ^ value) - 1.
Jason Samsd2d7c182014-07-17 18:41:25 -070010096 *
10097 * Supported by API versions 21 and newer.
10098 */
10099extern float3 __attribute__((const, overloadable))native_expm1(float3);
10100#endif
10101
10102#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010103/**
10104 * Returns the approximate (e ^ value) - 1.
Jason Samsd2d7c182014-07-17 18:41:25 -070010105 *
10106 * Supported by API versions 21 and newer.
10107 */
10108extern float4 __attribute__((const, overloadable))native_expm1(float4);
10109#endif
10110
10111#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010112/**
10113 * Returns the approximate native_sqrt(x*x + y*y)
Jason Samsd2d7c182014-07-17 18:41:25 -070010114 *
10115 * Supported by API versions 21 and newer.
10116 */
10117extern float __attribute__((const, overloadable))native_hypot(float x, float y);
10118#endif
10119
10120#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010121/**
10122 * Returns the approximate native_sqrt(x*x + y*y)
Jason Samsd2d7c182014-07-17 18:41:25 -070010123 *
10124 * Supported by API versions 21 and newer.
10125 */
10126extern float2 __attribute__((const, overloadable))native_hypot(float2 x, float2 y);
10127#endif
10128
10129#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010130/**
10131 * Returns the approximate native_sqrt(x*x + y*y)
Jason Samsd2d7c182014-07-17 18:41:25 -070010132 *
10133 * Supported by API versions 21 and newer.
10134 */
10135extern float3 __attribute__((const, overloadable))native_hypot(float3 x, float3 y);
10136#endif
10137
10138#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010139/**
10140 * Returns the approximate native_sqrt(x*x + y*y)
Jason Samsd2d7c182014-07-17 18:41:25 -070010141 *
10142 * Supported by API versions 21 and newer.
10143 */
10144extern float4 __attribute__((const, overloadable))native_hypot(float4 x, float4 y);
10145#endif
10146
10147#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010148/**
Jason Samsd2d7c182014-07-17 18:41:25 -070010149 * Compute the approximate length of a vector.
10150 *
10151 * Supported by API versions 21 and newer.
10152 */
10153extern float __attribute__((const, overloadable))native_length(float v);
10154#endif
10155
10156#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010157/**
Jason Samsd2d7c182014-07-17 18:41:25 -070010158 * Compute the approximate length of a vector.
10159 *
10160 * Supported by API versions 21 and newer.
10161 */
10162extern float __attribute__((const, overloadable))native_length(float2 v);
10163#endif
10164
10165#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010166/**
Jason Samsd2d7c182014-07-17 18:41:25 -070010167 * Compute the approximate length of a vector.
10168 *
10169 * Supported by API versions 21 and newer.
10170 */
10171extern float __attribute__((const, overloadable))native_length(float3 v);
10172#endif
10173
10174#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010175/**
Jason Samsd2d7c182014-07-17 18:41:25 -070010176 * Compute the approximate length of a vector.
10177 *
10178 * Supported by API versions 21 and newer.
10179 */
10180extern float __attribute__((const, overloadable))native_length(float4 v);
10181#endif
10182
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010183#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010184/**
10185 * Fast approximate log.
10186 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010187 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010188 *
10189 * Supported by API versions 18 and newer.
10190 */
10191extern float __attribute__((const, overloadable))native_log(float v);
10192#endif
10193
10194#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010195/**
10196 * Fast approximate log.
10197 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010198 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010199 *
10200 * Supported by API versions 18 and newer.
10201 */
10202extern float2 __attribute__((const, overloadable))native_log(float2 v);
10203#endif
10204
10205#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010206/**
10207 * Fast approximate log.
10208 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010209 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010210 *
10211 * Supported by API versions 18 and newer.
10212 */
10213extern float3 __attribute__((const, overloadable))native_log(float3 v);
10214#endif
10215
10216#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010217/**
10218 * Fast approximate log.
10219 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010220 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010221 *
10222 * Supported by API versions 18 and newer.
10223 */
10224extern float4 __attribute__((const, overloadable))native_log(float4 v);
10225#endif
10226
10227#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010228/**
10229 * Fast approximate log10.
10230 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010231 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010232 *
10233 * Supported by API versions 18 and newer.
10234 */
10235extern float __attribute__((const, overloadable))native_log10(float v);
10236#endif
10237
10238#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010239/**
10240 * Fast approximate log10.
10241 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010242 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010243 *
10244 * Supported by API versions 18 and newer.
10245 */
10246extern float2 __attribute__((const, overloadable))native_log10(float2 v);
10247#endif
10248
10249#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010250/**
10251 * Fast approximate log10.
10252 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010253 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010254 *
10255 * Supported by API versions 18 and newer.
10256 */
10257extern float3 __attribute__((const, overloadable))native_log10(float3 v);
10258#endif
10259
10260#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010261/**
10262 * Fast approximate log10.
10263 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010264 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010265 *
10266 * Supported by API versions 18 and newer.
10267 */
10268extern float4 __attribute__((const, overloadable))native_log10(float4 v);
10269#endif
10270
Jason Samsd2d7c182014-07-17 18:41:25 -070010271#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010272/**
10273 * Returns the approximate natural logarithm of (v + 1.0f)
Jason Samsd2d7c182014-07-17 18:41:25 -070010274 *
10275 * Supported by API versions 21 and newer.
10276 */
10277extern float __attribute__((const, overloadable))native_log1p(float);
10278#endif
10279
10280#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010281/**
10282 * Returns the approximate natural logarithm of (v + 1.0f)
Jason Samsd2d7c182014-07-17 18:41:25 -070010283 *
10284 * Supported by API versions 21 and newer.
10285 */
10286extern float2 __attribute__((const, overloadable))native_log1p(float2);
10287#endif
10288
10289#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010290/**
10291 * Returns the approximate natural logarithm of (v + 1.0f)
Jason Samsd2d7c182014-07-17 18:41:25 -070010292 *
10293 * Supported by API versions 21 and newer.
10294 */
10295extern float3 __attribute__((const, overloadable))native_log1p(float3);
10296#endif
10297
10298#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010299/**
10300 * Returns the approximate natural logarithm of (v + 1.0f)
Jason Samsd2d7c182014-07-17 18:41:25 -070010301 *
10302 * Supported by API versions 21 and newer.
10303 */
10304extern float4 __attribute__((const, overloadable))native_log1p(float4);
10305#endif
10306
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010307#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010308/**
10309 * Fast approximate log2.
10310 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010311 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010312 *
10313 * Supported by API versions 18 and newer.
10314 */
10315extern float __attribute__((const, overloadable))native_log2(float v);
10316#endif
10317
10318#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010319/**
10320 * Fast approximate log2.
10321 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010322 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010323 *
10324 * Supported by API versions 18 and newer.
10325 */
10326extern float2 __attribute__((const, overloadable))native_log2(float2 v);
10327#endif
10328
10329#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010330/**
10331 * Fast approximate log2.
10332 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010333 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010334 *
10335 * Supported by API versions 18 and newer.
10336 */
10337extern float3 __attribute__((const, overloadable))native_log2(float3 v);
10338#endif
10339
10340#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010341/**
10342 * Fast approximate log2.
10343 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010344 * It is not accurate for values very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010345 *
10346 * Supported by API versions 18 and newer.
10347 */
10348extern float4 __attribute__((const, overloadable))native_log2(float4 v);
10349#endif
10350
Jason Samsd2d7c182014-07-17 18:41:25 -070010351#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010352/**
10353 * Approximately normalizes a vector.
Jason Samsd2d7c182014-07-17 18:41:25 -070010354 *
10355 * Supported by API versions 21 and newer.
10356 */
10357extern float __attribute__((const, overloadable))native_normalize(float v);
10358#endif
10359
10360#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010361/**
10362 * Approximately normalizes a vector.
Jason Samsd2d7c182014-07-17 18:41:25 -070010363 *
10364 * Supported by API versions 21 and newer.
10365 */
10366extern float2 __attribute__((const, overloadable))native_normalize(float2 v);
10367#endif
10368
10369#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010370/**
10371 * Approximately normalizes a vector.
Jason Samsd2d7c182014-07-17 18:41:25 -070010372 *
10373 * Supported by API versions 21 and newer.
10374 */
10375extern float3 __attribute__((const, overloadable))native_normalize(float3 v);
10376#endif
10377
10378#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010379/**
10380 * Approximately normalizes a vector.
Jason Samsd2d7c182014-07-17 18:41:25 -070010381 *
10382 * Supported by API versions 21 and newer.
10383 */
10384extern float4 __attribute__((const, overloadable))native_normalize(float4 v);
10385#endif
10386
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010387#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010388/**
10389 * Fast approximate v ^ y.
10390 *
10391 * v must be between 0.f and 256.f.
10392 * y must be between -15.f and 15.f.
10393 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010394 * It is not accurate for values of v very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010395 *
10396 * Supported by API versions 18 and newer.
10397 */
10398extern float __attribute__((const, overloadable))native_powr(float v, float y);
10399#endif
10400
10401#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010402/**
10403 * Fast approximate v ^ y.
10404 *
10405 * v must be between 0.f and 256.f.
10406 * y must be between -15.f and 15.f.
10407 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010408 * It is not accurate for values of v very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010409 *
10410 * Supported by API versions 18 and newer.
10411 */
10412extern float2 __attribute__((const, overloadable))native_powr(float2 v, float2 y);
10413#endif
10414
10415#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010416/**
10417 * Fast approximate v ^ y.
10418 *
10419 * v must be between 0.f and 256.f.
10420 * y must be between -15.f and 15.f.
10421 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010422 * It is not accurate for values of v very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010423 *
10424 * Supported by API versions 18 and newer.
10425 */
10426extern float3 __attribute__((const, overloadable))native_powr(float3 v, float3 y);
10427#endif
10428
10429#if (defined(RS_VERSION) && (RS_VERSION >= 18))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010430/**
10431 * Fast approximate v ^ y.
10432 *
10433 * v must be between 0.f and 256.f.
10434 * y must be between -15.f and 15.f.
10435 *
Jean-Luc Brouillet32c18182014-07-29 13:52:45 -070010436 * It is not accurate for values of v very close to zero.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010437 *
10438 * Supported by API versions 18 and newer.
10439 */
10440extern float4 __attribute__((const, overloadable))native_powr(float4 v, float4 y);
10441#endif
10442
Jason Samsd2d7c182014-07-17 18:41:25 -070010443#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010444/**
10445 * Returns the approximate approximate reciprocal of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010446 *
10447 * Supported by API versions 21 and newer.
10448 */
10449extern float __attribute__((const, overloadable))native_recip(float v);
10450#endif
10451
10452#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010453/**
10454 * Returns the approximate approximate reciprocal of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010455 *
10456 * Supported by API versions 21 and newer.
10457 */
10458extern float2 __attribute__((const, overloadable))native_recip(float2 v);
10459#endif
10460
10461#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010462/**
10463 * Returns the approximate approximate reciprocal of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010464 *
10465 * Supported by API versions 21 and newer.
10466 */
10467extern float3 __attribute__((const, overloadable))native_recip(float3 v);
10468#endif
10469
10470#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010471/**
10472 * Returns the approximate approximate reciprocal of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010473 *
10474 * Supported by API versions 21 and newer.
10475 */
10476extern float4 __attribute__((const, overloadable))native_recip(float4 v);
10477#endif
10478
10479#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010480/**
10481 * Compute the approximate Nth root of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010482 *
10483 * Supported by API versions 21 and newer.
10484 */
10485extern float __attribute__((const, overloadable))native_rootn(float v, int n);
10486#endif
10487
10488#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010489/**
10490 * Compute the approximate Nth root of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010491 *
10492 * Supported by API versions 21 and newer.
10493 */
10494extern float2 __attribute__((const, overloadable))native_rootn(float2 v, int2 n);
10495#endif
10496
10497#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010498/**
10499 * Compute the approximate Nth root of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010500 *
10501 * Supported by API versions 21 and newer.
10502 */
10503extern float3 __attribute__((const, overloadable))native_rootn(float3 v, int3 n);
10504#endif
10505
10506#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010507/**
10508 * Compute the approximate Nth root of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010509 *
10510 * Supported by API versions 21 and newer.
10511 */
10512extern float4 __attribute__((const, overloadable))native_rootn(float4 v, int4 n);
10513#endif
10514
10515#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010516/**
10517 * Returns approximate (1 / sqrt(value)).
Jason Samsd2d7c182014-07-17 18:41:25 -070010518 *
10519 * Supported by API versions 21 and newer.
10520 */
10521extern float __attribute__((const, overloadable))native_rsqrt(float);
10522#endif
10523
10524#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010525/**
10526 * Returns approximate (1 / sqrt(value)).
Jason Samsd2d7c182014-07-17 18:41:25 -070010527 *
10528 * Supported by API versions 21 and newer.
10529 */
10530extern float2 __attribute__((const, overloadable))native_rsqrt(float2);
10531#endif
10532
10533#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010534/**
10535 * Returns approximate (1 / sqrt(value)).
Jason Samsd2d7c182014-07-17 18:41:25 -070010536 *
10537 * Supported by API versions 21 and newer.
10538 */
10539extern float3 __attribute__((const, overloadable))native_rsqrt(float3);
10540#endif
10541
10542#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010543/**
10544 * Returns approximate (1 / sqrt(value)).
Jason Samsd2d7c182014-07-17 18:41:25 -070010545 *
10546 * Supported by API versions 21 and newer.
10547 */
10548extern float4 __attribute__((const, overloadable))native_rsqrt(float4);
10549#endif
10550
10551#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010552/**
10553 * Returns the approximate sine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010554 *
10555 * Supported by API versions 21 and newer.
10556 */
10557extern float __attribute__((const, overloadable))native_sin(float);
10558#endif
10559
10560#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010561/**
10562 * Returns the approximate sine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010563 *
10564 * Supported by API versions 21 and newer.
10565 */
10566extern float2 __attribute__((const, overloadable))native_sin(float2);
10567#endif
10568
10569#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010570/**
10571 * Returns the approximate sine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010572 *
10573 * Supported by API versions 21 and newer.
10574 */
10575extern float3 __attribute__((const, overloadable))native_sin(float3);
10576#endif
10577
10578#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010579/**
10580 * Returns the approximate sine of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010581 *
10582 * Supported by API versions 21 and newer.
10583 */
10584extern float4 __attribute__((const, overloadable))native_sin(float4);
10585#endif
10586
10587#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010588/**
10589 * Returns the approximate sine and cosine of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010590 *
10591 * @return sine
10592 * @param v The incoming value in radians
10593 * @param *cosptr cosptr[0] will be set to the cosine value.
10594 *
10595 * Supported by API versions 21 and newer.
10596 */
10597extern float __attribute__((overloadable))native_sincos(float v, float* cosptr);
10598#endif
10599
10600#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010601/**
10602 * Returns the approximate sine and cosine of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010603 *
10604 * @return sine
10605 * @param v The incoming value in radians
10606 * @param *cosptr cosptr[0] will be set to the cosine value.
10607 *
10608 * Supported by API versions 21 and newer.
10609 */
10610extern float2 __attribute__((overloadable))native_sincos(float2 v, float2* cosptr);
10611#endif
10612
10613#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010614/**
10615 * Returns the approximate sine and cosine of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010616 *
10617 * @return sine
10618 * @param v The incoming value in radians
10619 * @param *cosptr cosptr[0] will be set to the cosine value.
10620 *
10621 * Supported by API versions 21 and newer.
10622 */
10623extern float3 __attribute__((overloadable))native_sincos(float3 v, float3* cosptr);
10624#endif
10625
10626#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010627/**
10628 * Returns the approximate sine and cosine of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010629 *
10630 * @return sine
10631 * @param v The incoming value in radians
10632 * @param *cosptr cosptr[0] will be set to the cosine value.
10633 *
10634 * Supported by API versions 21 and newer.
10635 */
10636extern float4 __attribute__((overloadable))native_sincos(float4 v, float4* cosptr);
10637#endif
10638
10639#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010640/**
10641 * Returns the approximate hyperbolic sine of a value specified in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010642 *
10643 * Supported by API versions 21 and newer.
10644 */
10645extern float __attribute__((const, overloadable))native_sinh(float);
10646#endif
10647
10648#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010649/**
10650 * Returns the approximate hyperbolic sine of a value specified in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010651 *
10652 * Supported by API versions 21 and newer.
10653 */
10654extern float2 __attribute__((const, overloadable))native_sinh(float2);
10655#endif
10656
10657#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010658/**
10659 * Returns the approximate hyperbolic sine of a value specified in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010660 *
10661 * Supported by API versions 21 and newer.
10662 */
10663extern float3 __attribute__((const, overloadable))native_sinh(float3);
10664#endif
10665
10666#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010667/**
10668 * Returns the approximate hyperbolic sine of a value specified in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010669 *
10670 * Supported by API versions 21 and newer.
10671 */
10672extern float4 __attribute__((const, overloadable))native_sinh(float4);
10673#endif
10674
10675#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010676/**
10677 * Returns the approximate sine of (x * pi), where (x * pi) is measured in radians.
10678 *
10679 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010680 *
10681 * Supported by API versions 21 and newer.
10682 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010683extern float __attribute__((const, overloadable))native_sinpi(float x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010684#endif
10685
10686#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010687/**
10688 * Returns the approximate sine of (x * pi), where (x * pi) is measured in radians.
10689 *
10690 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010691 *
10692 * Supported by API versions 21 and newer.
10693 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010694extern float2 __attribute__((const, overloadable))native_sinpi(float2 x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010695#endif
10696
10697#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010698/**
10699 * Returns the approximate sine of (x * pi), where (x * pi) is measured in radians.
10700 *
10701 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010702 *
10703 * Supported by API versions 21 and newer.
10704 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010705extern float3 __attribute__((const, overloadable))native_sinpi(float3 x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010706#endif
10707
10708#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010709/**
10710 * Returns the approximate sine of (x * pi), where (x * pi) is measured in radians.
10711 *
10712 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010713 *
10714 * Supported by API versions 21 and newer.
10715 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010716extern float4 __attribute__((const, overloadable))native_sinpi(float4 x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010717#endif
10718
10719#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010720/**
10721 * Returns the approximate sqrt(v).
Jason Samsd2d7c182014-07-17 18:41:25 -070010722 *
10723 * Supported by API versions 21 and newer.
10724 */
10725extern float __attribute__((const, overloadable))native_sqrt(float);
10726#endif
10727
10728#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010729/**
10730 * Returns the approximate sqrt(v).
Jason Samsd2d7c182014-07-17 18:41:25 -070010731 *
10732 * Supported by API versions 21 and newer.
10733 */
10734extern float2 __attribute__((const, overloadable))native_sqrt(float2);
10735#endif
10736
10737#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010738/**
10739 * Returns the approximate sqrt(v).
Jason Samsd2d7c182014-07-17 18:41:25 -070010740 *
10741 * Supported by API versions 21 and newer.
10742 */
10743extern float3 __attribute__((const, overloadable))native_sqrt(float3);
10744#endif
10745
10746#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010747/**
10748 * Returns the approximate sqrt(v).
Jason Samsd2d7c182014-07-17 18:41:25 -070010749 *
10750 * Supported by API versions 21 and newer.
10751 */
10752extern float4 __attribute__((const, overloadable))native_sqrt(float4);
10753#endif
10754
10755#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010756/**
10757 * Returns the approximate tangent of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010758 *
10759 * Supported by API versions 21 and newer.
10760 */
10761extern float __attribute__((const, overloadable))native_tan(float);
10762#endif
10763
10764#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010765/**
10766 * Returns the approximate tangent of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010767 *
10768 * Supported by API versions 21 and newer.
10769 */
10770extern float2 __attribute__((const, overloadable))native_tan(float2);
10771#endif
10772
10773#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010774/**
10775 * Returns the approximate tangent of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010776 *
10777 * Supported by API versions 21 and newer.
10778 */
10779extern float3 __attribute__((const, overloadable))native_tan(float3);
10780#endif
10781
10782#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010783/**
10784 * Returns the approximate tangent of an angle measured in radians.
Jason Samsd2d7c182014-07-17 18:41:25 -070010785 *
10786 * Supported by API versions 21 and newer.
10787 */
10788extern float4 __attribute__((const, overloadable))native_tan(float4);
10789#endif
10790
10791#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010792/**
10793 * Returns the approximate hyperbolic tangent of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010794 *
10795 * Supported by API versions 21 and newer.
10796 */
10797extern float __attribute__((const, overloadable))native_tanh(float);
10798#endif
10799
10800#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010801/**
10802 * Returns the approximate hyperbolic tangent of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010803 *
10804 * Supported by API versions 21 and newer.
10805 */
10806extern float2 __attribute__((const, overloadable))native_tanh(float2);
10807#endif
10808
10809#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010810/**
10811 * Returns the approximate hyperbolic tangent of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010812 *
10813 * Supported by API versions 21 and newer.
10814 */
10815extern float3 __attribute__((const, overloadable))native_tanh(float3);
10816#endif
10817
10818#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010819/**
10820 * Returns the approximate hyperbolic tangent of a value.
Jason Samsd2d7c182014-07-17 18:41:25 -070010821 *
10822 * Supported by API versions 21 and newer.
10823 */
10824extern float4 __attribute__((const, overloadable))native_tanh(float4);
10825#endif
10826
10827#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010828/**
10829 * Returns the approximate tangent of (x * pi), where (x * pi) is measured in radians.
10830 *
10831 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010832 *
10833 * Supported by API versions 21 and newer.
10834 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010835extern float __attribute__((const, overloadable))native_tanpi(float x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010836#endif
10837
10838#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010839/**
10840 * Returns the approximate tangent of (x * pi), where (x * pi) is measured in radians.
10841 *
10842 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010843 *
10844 * Supported by API versions 21 and newer.
10845 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010846extern float2 __attribute__((const, overloadable))native_tanpi(float2 x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010847#endif
10848
10849#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010850/**
10851 * Returns the approximate tangent of (x * pi), where (x * pi) is measured in radians.
10852 *
10853 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010854 *
10855 * Supported by API versions 21 and newer.
10856 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010857extern float3 __attribute__((const, overloadable))native_tanpi(float3 x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010858#endif
10859
10860#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010861/**
10862 * Returns the approximate tangent of (x * pi), where (x * pi) is measured in radians.
10863 *
10864 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Samsd2d7c182014-07-17 18:41:25 -070010865 *
10866 * Supported by API versions 21 and newer.
10867 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010868extern float4 __attribute__((const, overloadable))native_tanpi(float4 x);
Jason Samsd2d7c182014-07-17 18:41:25 -070010869#endif
10870
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010871#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010872/**
10873 * Returns the next floating point number from x towards y.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010874 *
10875 * Supported by API versions 9 and newer.
10876 */
10877extern float __attribute__((const, overloadable))nextafter(float x, float y);
10878#endif
10879
10880#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010881/**
10882 * Returns the next floating point number from x towards y.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010883 *
10884 * Supported by API versions 9 and newer.
10885 */
10886extern float2 __attribute__((const, overloadable))nextafter(float2 x, float2 y);
10887#endif
10888
10889#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010890/**
10891 * Returns the next floating point number from x towards y.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010892 *
10893 * Supported by API versions 9 and newer.
10894 */
10895extern float3 __attribute__((const, overloadable))nextafter(float3 x, float3 y);
10896#endif
10897
10898#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010899/**
10900 * Returns the next floating point number from x towards y.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010901 *
10902 * Supported by API versions 9 and newer.
10903 */
10904extern float4 __attribute__((const, overloadable))nextafter(float4 x, float4 y);
10905#endif
10906
10907#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010908/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010909 * Normalize a vector.
10910 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010911 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
10912 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010913 * Supported by API versions 9 and newer.
10914 */
10915extern float __attribute__((const, overloadable))normalize(float v);
10916#endif
10917
10918#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010919/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010920 * Normalize a vector.
10921 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010922 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
10923 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010924 * Supported by API versions 9 and newer.
10925 */
10926extern float2 __attribute__((const, overloadable))normalize(float2 v);
10927#endif
10928
10929#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010930/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010931 * Normalize a vector.
10932 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010933 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
10934 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010935 * Supported by API versions 9 and newer.
10936 */
10937extern float3 __attribute__((const, overloadable))normalize(float3 v);
10938#endif
10939
10940#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010941/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010942 * Normalize a vector.
10943 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010944 * For vectors of size 1, returns -1.f for negative values, 0.f for null values, and 1.f for positive values.
10945 *
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010946 * Supported by API versions 9 and newer.
10947 */
10948extern float4 __attribute__((const, overloadable))normalize(float4 v);
10949#endif
10950
10951#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010952/**
10953 * Returns x raised to the power y, i.e. x ^ y.
10954 *
10955 * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010956 *
10957 * Supported by API versions 9 and newer.
10958 */
10959extern float __attribute__((const, overloadable))pow(float x, float y);
10960#endif
10961
10962#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010963/**
10964 * Returns x raised to the power y, i.e. x ^ y.
10965 *
10966 * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010967 *
10968 * Supported by API versions 9 and newer.
10969 */
10970extern float2 __attribute__((const, overloadable))pow(float2 x, float2 y);
10971#endif
10972
10973#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010974/**
10975 * Returns x raised to the power y, i.e. x ^ y.
10976 *
10977 * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010978 *
10979 * Supported by API versions 9 and newer.
10980 */
10981extern float3 __attribute__((const, overloadable))pow(float3 x, float3 y);
10982#endif
10983
10984#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010985/**
10986 * Returns x raised to the power y, i.e. x ^ y.
10987 *
10988 * pown() and powr() are similar. pown() takes an integer exponent. powr() assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080010989 *
10990 * Supported by API versions 9 and newer.
10991 */
10992extern float4 __attribute__((const, overloadable))pow(float4 x, float4 y);
10993#endif
10994
10995#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080010996/**
10997 * Returns x raised to the power y, i.e. x ^ y.
10998 *
10999 * pow() and powr() are similar. The both take a float exponent. powr() also assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011000 *
11001 * Supported by API versions 9 and newer.
11002 */
11003extern float __attribute__((const, overloadable))pown(float x, int y);
11004#endif
11005
11006#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011007/**
11008 * Returns x raised to the power y, i.e. x ^ y.
11009 *
11010 * pow() and powr() are similar. The both take a float exponent. powr() also assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011011 *
11012 * Supported by API versions 9 and newer.
11013 */
11014extern float2 __attribute__((const, overloadable))pown(float2 x, int2 y);
11015#endif
11016
11017#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011018/**
11019 * Returns x raised to the power y, i.e. x ^ y.
11020 *
11021 * pow() and powr() are similar. The both take a float exponent. powr() also assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011022 *
11023 * Supported by API versions 9 and newer.
11024 */
11025extern float3 __attribute__((const, overloadable))pown(float3 x, int3 y);
11026#endif
11027
11028#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011029/**
11030 * Returns x raised to the power y, i.e. x ^ y.
11031 *
11032 * pow() and powr() are similar. The both take a float exponent. powr() also assumes the base to be non-negative.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011033 *
11034 * Supported by API versions 9 and newer.
11035 */
11036extern float4 __attribute__((const, overloadable))pown(float4 x, int4 y);
11037#endif
11038
11039#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011040/**
11041 * Returns x raised to the power y, i.e. x ^ y. x must be >= 0.
11042 *
11043 * pow() and pown() are similar. They both make no assumptions about the base. pow() takes a float exponent while pown() take an integer.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011044 *
11045 * Supported by API versions 9 and newer.
11046 */
11047extern float __attribute__((const, overloadable))powr(float x, float y);
11048#endif
11049
11050#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011051/**
11052 * Returns x raised to the power y, i.e. x ^ y. x must be >= 0.
11053 *
11054 * pow() and pown() are similar. They both make no assumptions about the base. pow() takes a float exponent while pown() take an integer.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011055 *
11056 * Supported by API versions 9 and newer.
11057 */
11058extern float2 __attribute__((const, overloadable))powr(float2 x, float2 y);
11059#endif
11060
11061#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011062/**
11063 * Returns x raised to the power y, i.e. x ^ y. x must be >= 0.
11064 *
11065 * pow() and pown() are similar. They both make no assumptions about the base. pow() takes a float exponent while pown() take an integer.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011066 *
11067 * Supported by API versions 9 and newer.
11068 */
11069extern float3 __attribute__((const, overloadable))powr(float3 x, float3 y);
11070#endif
11071
11072#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011073/**
11074 * Returns x raised to the power y, i.e. x ^ y. x must be >= 0.
11075 *
11076 * pow() and pown() are similar. They both make no assumptions about the base. pow() takes a float exponent while pown() take an integer.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011077 *
11078 * Supported by API versions 9 and newer.
11079 */
11080extern float4 __attribute__((const, overloadable))powr(float4 x, float4 y);
11081#endif
11082
11083#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011084/**
11085 * Converts from degrees to radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011086 *
11087 * Supported by API versions 9 and newer.
11088 */
11089extern float __attribute__((const, overloadable))radians(float value);
11090#endif
11091
11092#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011093/**
11094 * Converts from degrees to radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011095 *
11096 * Supported by API versions 9 and newer.
11097 */
11098extern float2 __attribute__((const, overloadable))radians(float2 value);
11099#endif
11100
11101#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011102/**
11103 * Converts from degrees to radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011104 *
11105 * Supported by API versions 9 and newer.
11106 */
11107extern float3 __attribute__((const, overloadable))radians(float3 value);
11108#endif
11109
11110#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011111/**
11112 * Converts from degrees to radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011113 *
11114 * Supported by API versions 9 and newer.
11115 */
11116extern float4 __attribute__((const, overloadable))radians(float4 value);
11117#endif
11118
11119#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011120/**
11121 * Returns the remainder of x / y, where the quotient is rounded towards the nearest integer.
11122 *
11123 * The function fmod() is similar but rounds toward the closest interger.
11124 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
11125 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011126 *
11127 * Supported by API versions 9 and newer.
11128 */
11129extern float __attribute__((const, overloadable))remainder(float x, float y);
11130#endif
11131
11132#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011133/**
11134 * Returns the remainder of x / y, where the quotient is rounded towards the nearest integer.
11135 *
11136 * The function fmod() is similar but rounds toward the closest interger.
11137 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
11138 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011139 *
11140 * Supported by API versions 9 and newer.
11141 */
11142extern float2 __attribute__((const, overloadable))remainder(float2 x, float2 y);
11143#endif
11144
11145#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011146/**
11147 * Returns the remainder of x / y, where the quotient is rounded towards the nearest integer.
11148 *
11149 * The function fmod() is similar but rounds toward the closest interger.
11150 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
11151 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011152 *
11153 * Supported by API versions 9 and newer.
11154 */
11155extern float3 __attribute__((const, overloadable))remainder(float3 x, float3 y);
11156#endif
11157
11158#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011159/**
11160 * Returns the remainder of x / y, where the quotient is rounded towards the nearest integer.
11161 *
11162 * The function fmod() is similar but rounds toward the closest interger.
11163 * For example, fmod(-3.8f, 2.f) returns -1.8f (-3.8f - -1.f * 2.f)
11164 * while remainder(-3.8f, 2.f) returns 0.2f (-3.8f - -2.f * 2.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011165 *
11166 * Supported by API versions 9 and newer.
11167 */
11168extern float4 __attribute__((const, overloadable))remainder(float4 x, float4 y);
11169#endif
11170
11171#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011172/**
11173 * Returns the quotient and the remainder of b / c.
11174 *
11175 * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
11176 *
11177 * This function is useful for implementing periodic functions. The low three bits of the quotient gives the quadrant and the remainder the distance within the quadrant. For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant) to reduce very large value of x to something within a limited range.
11178 *
11179 * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3 and the sign negative. It returns 0.5f.
11180 *
11181 * @param b The numerator.
11182 * @param c The denominator.
11183 * @param *d d[0] will be set to the integer quotient.
11184 * @return The remainder, precise only for the low three bits.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011185 *
11186 * Supported by API versions 9 and newer.
11187 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011188extern float __attribute__((overloadable))remquo(float b, float c, int* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011189#endif
11190
11191#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011192/**
11193 * Returns the quotient and the remainder of b / c.
11194 *
11195 * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
11196 *
11197 * This function is useful for implementing periodic functions. The low three bits of the quotient gives the quadrant and the remainder the distance within the quadrant. For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant) to reduce very large value of x to something within a limited range.
11198 *
11199 * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3 and the sign negative. It returns 0.5f.
11200 *
11201 * @param b The numerator.
11202 * @param c The denominator.
11203 * @param *d d[0] will be set to the integer quotient.
11204 * @return The remainder, precise only for the low three bits.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011205 *
11206 * Supported by API versions 9 and newer.
11207 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011208extern float2 __attribute__((overloadable))remquo(float2 b, float2 c, int2* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011209#endif
11210
11211#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011212/**
11213 * Returns the quotient and the remainder of b / c.
11214 *
11215 * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
11216 *
11217 * This function is useful for implementing periodic functions. The low three bits of the quotient gives the quadrant and the remainder the distance within the quadrant. For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant) to reduce very large value of x to something within a limited range.
11218 *
11219 * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3 and the sign negative. It returns 0.5f.
11220 *
11221 * @param b The numerator.
11222 * @param c The denominator.
11223 * @param *d d[0] will be set to the integer quotient.
11224 * @return The remainder, precise only for the low three bits.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011225 *
11226 * Supported by API versions 9 and newer.
11227 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011228extern float3 __attribute__((overloadable))remquo(float3 b, float3 c, int3* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011229#endif
11230
11231#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011232/**
11233 * Returns the quotient and the remainder of b / c.
11234 *
11235 * Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
11236 *
11237 * This function is useful for implementing periodic functions. The low three bits of the quotient gives the quadrant and the remainder the distance within the quadrant. For example, an implementation of sin(x) could call remquo(x, PI / 2.f, &quadrant) to reduce very large value of x to something within a limited range.
11238 *
11239 * Example: remquo(-23.5f, 8.f, &quot) sets the lowest three bits of quot to 3 and the sign negative. It returns 0.5f.
11240 *
11241 * @param b The numerator.
11242 * @param c The denominator.
11243 * @param *d d[0] will be set to the integer quotient.
11244 * @return The remainder, precise only for the low three bits.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011245 *
11246 * Supported by API versions 9 and newer.
11247 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011248extern float4 __attribute__((overloadable))remquo(float4 b, float4 c, int4* d);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011249#endif
11250
11251#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011252/**
11253 * Rounds to the nearest integral value.
11254 *
11255 * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and rint(-1.5f) returns -2.f.
11256 *
11257 * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011258 *
11259 * Supported by API versions 9 and newer.
11260 */
11261extern float __attribute__((const, overloadable))rint(float);
11262#endif
11263
11264#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011265/**
11266 * Rounds to the nearest integral value.
11267 *
11268 * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and rint(-1.5f) returns -2.f.
11269 *
11270 * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011271 *
11272 * Supported by API versions 9 and newer.
11273 */
11274extern float2 __attribute__((const, overloadable))rint(float2);
11275#endif
11276
11277#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011278/**
11279 * Rounds to the nearest integral value.
11280 *
11281 * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and rint(-1.5f) returns -2.f.
11282 *
11283 * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011284 *
11285 * Supported by API versions 9 and newer.
11286 */
11287extern float3 __attribute__((const, overloadable))rint(float3);
11288#endif
11289
11290#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011291/**
11292 * Rounds to the nearest integral value.
11293 *
11294 * rint() rounds half values to even. For example, rint(0.5f) returns 0.f and rint(1.5f) returns 2.f. Similarly, rint(-0.5f) returns -0.f and rint(-1.5f) returns -2.f.
11295 *
11296 * round() is similar but rounds away from zero. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011297 *
11298 * Supported by API versions 9 and newer.
11299 */
11300extern float4 __attribute__((const, overloadable))rint(float4);
11301#endif
11302
11303#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011304/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011305 * Compute the Nth root of a value.
11306 *
11307 * Supported by API versions 9 and newer.
11308 */
11309extern float __attribute__((const, overloadable))rootn(float v, int n);
11310#endif
11311
11312#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011313/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011314 * Compute the Nth root of a value.
11315 *
11316 * Supported by API versions 9 and newer.
11317 */
11318extern float2 __attribute__((const, overloadable))rootn(float2 v, int2 n);
11319#endif
11320
11321#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011322/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011323 * Compute the Nth root of a value.
11324 *
11325 * Supported by API versions 9 and newer.
11326 */
11327extern float3 __attribute__((const, overloadable))rootn(float3 v, int3 n);
11328#endif
11329
11330#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011331/**
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011332 * Compute the Nth root of a value.
11333 *
11334 * Supported by API versions 9 and newer.
11335 */
11336extern float4 __attribute__((const, overloadable))rootn(float4 v, int4 n);
11337#endif
11338
11339#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011340/**
11341 * Round to the nearest integral value.
11342 *
11343 * round() rounds half values away from zero. For example, round(0.5f) returns 1.f and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f and round(-1.5f) returns -2.f.
11344 *
11345 * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011346 *
11347 * Supported by API versions 9 and newer.
11348 */
11349extern float __attribute__((const, overloadable))round(float);
11350#endif
11351
11352#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011353/**
11354 * Round to the nearest integral value.
11355 *
11356 * round() rounds half values away from zero. For example, round(0.5f) returns 1.f and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f and round(-1.5f) returns -2.f.
11357 *
11358 * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011359 *
11360 * Supported by API versions 9 and newer.
11361 */
11362extern float2 __attribute__((const, overloadable))round(float2);
11363#endif
11364
11365#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011366/**
11367 * Round to the nearest integral value.
11368 *
11369 * round() rounds half values away from zero. For example, round(0.5f) returns 1.f and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f and round(-1.5f) returns -2.f.
11370 *
11371 * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011372 *
11373 * Supported by API versions 9 and newer.
11374 */
11375extern float3 __attribute__((const, overloadable))round(float3);
11376#endif
11377
11378#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011379/**
11380 * Round to the nearest integral value.
11381 *
11382 * round() rounds half values away from zero. For example, round(0.5f) returns 1.f and round(1.5f) returns 2.f. Similarly, round(-0.5f) returns -1.f and round(-1.5f) returns -2.f.
11383 *
11384 * rint() is similar but rounds half values toward even. trunc() truncates the decimal fraction.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011385 *
11386 * Supported by API versions 9 and newer.
11387 */
11388extern float4 __attribute__((const, overloadable))round(float4);
11389#endif
11390
11391#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011392/**
11393 * Returns (1 / sqrt(value)).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011394 *
11395 * Supported by API versions 9 and newer.
11396 */
11397extern float __attribute__((const, overloadable))rsqrt(float);
11398#endif
11399
11400#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011401/**
11402 * Returns (1 / sqrt(value)).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011403 *
11404 * Supported by API versions 9 and newer.
11405 */
11406extern float2 __attribute__((const, overloadable))rsqrt(float2);
11407#endif
11408
11409#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011410/**
11411 * Returns (1 / sqrt(value)).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011412 *
11413 * Supported by API versions 9 and newer.
11414 */
11415extern float3 __attribute__((const, overloadable))rsqrt(float3);
11416#endif
11417
11418#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011419/**
11420 * Returns (1 / sqrt(value)).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011421 *
11422 * Supported by API versions 9 and newer.
11423 */
11424extern float4 __attribute__((const, overloadable))rsqrt(float4);
11425#endif
11426
11427#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011428/**
11429 * Returns the sign of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011430 *
11431 * if (v < 0) return -1.f;
11432 * else if (v > 0) return 1.f;
11433 * else return 0.f;
11434 *
11435 * Supported by API versions 9 and newer.
11436 */
11437extern float __attribute__((const, overloadable))sign(float v);
11438#endif
11439
11440#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011441/**
11442 * Returns the sign of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011443 *
11444 * if (v < 0) return -1.f;
11445 * else if (v > 0) return 1.f;
11446 * else return 0.f;
11447 *
11448 * Supported by API versions 9 and newer.
11449 */
11450extern float2 __attribute__((const, overloadable))sign(float2 v);
11451#endif
11452
11453#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011454/**
11455 * Returns the sign of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011456 *
11457 * if (v < 0) return -1.f;
11458 * else if (v > 0) return 1.f;
11459 * else return 0.f;
11460 *
11461 * Supported by API versions 9 and newer.
11462 */
11463extern float3 __attribute__((const, overloadable))sign(float3 v);
11464#endif
11465
11466#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011467/**
11468 * Returns the sign of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011469 *
11470 * if (v < 0) return -1.f;
11471 * else if (v > 0) return 1.f;
11472 * else return 0.f;
11473 *
11474 * Supported by API versions 9 and newer.
11475 */
11476extern float4 __attribute__((const, overloadable))sign(float4 v);
11477#endif
11478
11479#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011480/**
11481 * Returns the sine of an angle measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011482 *
11483 * Supported by API versions 9 and newer.
11484 */
11485extern float __attribute__((const, overloadable))sin(float);
11486#endif
11487
11488#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011489/**
11490 * Returns the sine of an angle measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011491 *
11492 * Supported by API versions 9 and newer.
11493 */
11494extern float2 __attribute__((const, overloadable))sin(float2);
11495#endif
11496
11497#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011498/**
11499 * Returns the sine of an angle measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011500 *
11501 * Supported by API versions 9 and newer.
11502 */
11503extern float3 __attribute__((const, overloadable))sin(float3);
11504#endif
11505
11506#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011507/**
11508 * Returns the sine of an angle measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011509 *
11510 * Supported by API versions 9 and newer.
11511 */
11512extern float4 __attribute__((const, overloadable))sin(float4);
11513#endif
11514
11515#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011516/**
11517 * Returns the sine and cosine of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011518 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011519 * @return sine of v
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011520 * @param v The incoming value in radians
11521 * @param *cosptr cosptr[0] will be set to the cosine value.
11522 *
11523 * Supported by API versions 9 and newer.
11524 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011525extern float __attribute__((overloadable))sincos(float v, float* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011526#endif
11527
11528#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011529/**
11530 * Returns the sine and cosine of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011531 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011532 * @return sine of v
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011533 * @param v The incoming value in radians
11534 * @param *cosptr cosptr[0] will be set to the cosine value.
11535 *
11536 * Supported by API versions 9 and newer.
11537 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011538extern float2 __attribute__((overloadable))sincos(float2 v, float2* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011539#endif
11540
11541#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011542/**
11543 * Returns the sine and cosine of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011544 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011545 * @return sine of v
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011546 * @param v The incoming value in radians
11547 * @param *cosptr cosptr[0] will be set to the cosine value.
11548 *
11549 * Supported by API versions 9 and newer.
11550 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011551extern float3 __attribute__((overloadable))sincos(float3 v, float3* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011552#endif
11553
11554#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011555/**
11556 * Returns the sine and cosine of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011557 *
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011558 * @return sine of v
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011559 * @param v The incoming value in radians
11560 * @param *cosptr cosptr[0] will be set to the cosine value.
11561 *
11562 * Supported by API versions 9 and newer.
11563 */
Jean-Luc Brouillet46341432014-02-21 22:49:22 -080011564extern float4 __attribute__((overloadable))sincos(float4 v, float4* cosptr);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011565#endif
11566
11567#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011568/**
11569 * Returns the hyperbolic sine of x, where x is measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011570 *
11571 * Supported by API versions 9 and newer.
11572 */
11573extern float __attribute__((const, overloadable))sinh(float);
11574#endif
11575
11576#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011577/**
11578 * Returns the hyperbolic sine of x, where x is measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011579 *
11580 * Supported by API versions 9 and newer.
11581 */
11582extern float2 __attribute__((const, overloadable))sinh(float2);
11583#endif
11584
11585#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011586/**
11587 * Returns the hyperbolic sine of x, where x is measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011588 *
11589 * Supported by API versions 9 and newer.
11590 */
11591extern float3 __attribute__((const, overloadable))sinh(float3);
11592#endif
11593
11594#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011595/**
11596 * Returns the hyperbolic sine of x, where x is measured in radians.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011597 *
11598 * Supported by API versions 9 and newer.
11599 */
11600extern float4 __attribute__((const, overloadable))sinh(float4);
11601#endif
11602
11603#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011604/**
11605 * Returns the sine of (x * pi), where (x * pi) is measured in radians.
11606 *
11607 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011608 *
11609 * Supported by API versions 9 and newer.
11610 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011611extern float __attribute__((const, overloadable))sinpi(float x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011612#endif
11613
11614#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011615/**
11616 * Returns the sine of (x * pi), where (x * pi) is measured in radians.
11617 *
11618 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011619 *
11620 * Supported by API versions 9 and newer.
11621 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011622extern float2 __attribute__((const, overloadable))sinpi(float2 x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011623#endif
11624
11625#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011626/**
11627 * Returns the sine of (x * pi), where (x * pi) is measured in radians.
11628 *
11629 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011630 *
11631 * Supported by API versions 9 and newer.
11632 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011633extern float3 __attribute__((const, overloadable))sinpi(float3 x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011634#endif
11635
11636#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011637/**
11638 * Returns the sine of (x * pi), where (x * pi) is measured in radians.
11639 *
11640 * To get the sine of a value measured in degrees, call sinpi(a / 180.f).
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011641 *
11642 * Supported by API versions 9 and newer.
11643 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011644extern float4 __attribute__((const, overloadable))sinpi(float4 x);
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011645#endif
11646
11647#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011648/**
11649 * Returns the square root of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011650 *
11651 * Supported by API versions 9 and newer.
11652 */
11653extern float __attribute__((const, overloadable))sqrt(float);
11654#endif
11655
11656#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011657/**
11658 * Returns the square root of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011659 *
11660 * Supported by API versions 9 and newer.
11661 */
11662extern float2 __attribute__((const, overloadable))sqrt(float2);
11663#endif
11664
11665#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011666/**
11667 * Returns the square root of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011668 *
11669 * Supported by API versions 9 and newer.
11670 */
11671extern float3 __attribute__((const, overloadable))sqrt(float3);
11672#endif
11673
11674#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011675/**
11676 * Returns the square root of a value.
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011677 *
11678 * Supported by API versions 9 and newer.
11679 */
11680extern float4 __attribute__((const, overloadable))sqrt(float4);
11681#endif
11682
11683#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011684/**
11685 * Returns 0.f if v < edge, 1.f otherwise.
11686 *
11687 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i]) for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011688 *
11689 * Supported by API versions 9 and newer.
11690 */
11691extern float __attribute__((const, overloadable))step(float edge, float v);
11692#endif
11693
11694#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011695/**
11696 * Returns 0.f if v < edge, 1.f otherwise.
11697 *
11698 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i]) for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011699 *
11700 * Supported by API versions 9 and newer.
11701 */
11702extern float2 __attribute__((const, overloadable))step(float2 edge, float2 v);
11703#endif
11704
11705#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011706/**
11707 * Returns 0.f if v < edge, 1.f otherwise.
11708 *
11709 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i]) for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011710 *
11711 * Supported by API versions 9 and newer.
11712 */
11713extern float3 __attribute__((const, overloadable))step(float3 edge, float3 v);
11714#endif
11715
11716#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011717/**
11718 * Returns 0.f if v < edge, 1.f otherwise.
11719 *
11720 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b[i]) ? 0.f : atan2(a[i], b[i]) for the corresponding elements of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011721 *
11722 * Supported by API versions 9 and newer.
11723 */
11724extern float4 __attribute__((const, overloadable))step(float4 edge, float4 v);
11725#endif
11726
11727#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011728/**
11729 * Returns 0.f if v < edge, 1.f otherwise.
11730 *
11731 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b) ? 0.f : atan2(a[i], b) for each element of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011732 *
11733 * Supported by API versions 9 and newer.
11734 */
11735extern float2 __attribute__((const, overloadable))step(float2 edge, float v);
11736#endif
11737
11738#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011739/**
11740 * Returns 0.f if v < edge, 1.f otherwise.
11741 *
11742 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b) ? 0.f : atan2(a[i], b) for each element of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011743 *
11744 * Supported by API versions 9 and newer.
11745 */
11746extern float3 __attribute__((const, overloadable))step(float3 edge, float v);
11747#endif
11748
11749#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011750/**
11751 * Returns 0.f if v < edge, 1.f otherwise.
11752 *
11753 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a[i] < b) ? 0.f : atan2(a[i], b) for each element of a vector, you could instead use step(a, b) * atan2(a, b).
Jason Sams29087fa2014-01-09 17:06:17 -080011754 *
11755 * Supported by API versions 9 and newer.
11756 */
11757extern float4 __attribute__((const, overloadable))step(float4 edge, float v);
11758#endif
11759
Jason Samsaa456932014-08-18 16:20:51 -070011760#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011761/**
11762 * Returns 0.f if v < edge, 1.f otherwise.
11763 *
11764 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a < b[i]) ? 0.f : atan2(a, b[i]) for each element of a vector, you could instead use step(a, b) * atan2(a, b).
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -080011765 *
Jason Samsaa456932014-08-18 16:20:51 -070011766 * Supported by API versions 21 and newer.
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -080011767 */
11768extern float2 __attribute__((const, overloadable))step(float edge, float2 v);
11769#endif
11770
Jason Samsaa456932014-08-18 16:20:51 -070011771#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011772/**
11773 * Returns 0.f if v < edge, 1.f otherwise.
11774 *
11775 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a < b[i]) ? 0.f : atan2(a, b[i]) for each element of a vector, you could instead use step(a, b) * atan2(a, b).
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -080011776 *
Jason Samsaa456932014-08-18 16:20:51 -070011777 * Supported by API versions 21 and newer.
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -080011778 */
11779extern float3 __attribute__((const, overloadable))step(float edge, float3 v);
11780#endif
11781
Jason Samsaa456932014-08-18 16:20:51 -070011782#if (defined(RS_VERSION) && (RS_VERSION >= 21))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011783/**
11784 * Returns 0.f if v < edge, 1.f otherwise.
11785 *
11786 * This can be useful to create conditional computations without using loops and branching instructions. For example, instead of computing (a < b[i]) ? 0.f : atan2(a, b[i]) for each element of a vector, you could instead use step(a, b) * atan2(a, b).
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -080011787 *
Jason Samsaa456932014-08-18 16:20:51 -070011788 * Supported by API versions 21 and newer.
Jean-Luc Brouillet0ec16352014-01-22 15:23:30 -080011789 */
11790extern float4 __attribute__((const, overloadable))step(float edge, float4 v);
11791#endif
11792
Jason Sams29087fa2014-01-09 17:06:17 -080011793#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011794/**
11795 * Returns the tangent of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011796 *
11797 * Supported by API versions 9 and newer.
11798 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011799extern float __attribute__((const, overloadable))tan(float x);
Jason Sams29087fa2014-01-09 17:06:17 -080011800#endif
11801
11802#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011803/**
11804 * Returns the tangent of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011805 *
11806 * Supported by API versions 9 and newer.
11807 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011808extern float2 __attribute__((const, overloadable))tan(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -080011809#endif
11810
11811#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011812/**
11813 * Returns the tangent of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011814 *
11815 * Supported by API versions 9 and newer.
11816 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011817extern float3 __attribute__((const, overloadable))tan(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -080011818#endif
11819
11820#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011821/**
11822 * Returns the tangent of an angle measured in radians.
Jason Sams29087fa2014-01-09 17:06:17 -080011823 *
11824 * Supported by API versions 9 and newer.
11825 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011826extern float4 __attribute__((const, overloadable))tan(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -080011827#endif
11828
11829#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011830/**
11831 * Returns the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011832 *
11833 * Supported by API versions 9 and newer.
11834 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011835extern float __attribute__((const, overloadable))tanh(float);
Jason Sams29087fa2014-01-09 17:06:17 -080011836#endif
11837
11838#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011839/**
11840 * Returns the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011841 *
11842 * Supported by API versions 9 and newer.
11843 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011844extern float2 __attribute__((const, overloadable))tanh(float2);
Jason Sams29087fa2014-01-09 17:06:17 -080011845#endif
11846
11847#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011848/**
11849 * Returns the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011850 *
11851 * Supported by API versions 9 and newer.
11852 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011853extern float3 __attribute__((const, overloadable))tanh(float3);
Jason Sams29087fa2014-01-09 17:06:17 -080011854#endif
11855
11856#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011857/**
11858 * Returns the hyperbolic tangent of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011859 *
11860 * Supported by API versions 9 and newer.
11861 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011862extern float4 __attribute__((const, overloadable))tanh(float4);
Jason Sams29087fa2014-01-09 17:06:17 -080011863#endif
11864
11865#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011866/**
11867 * Returns the tangent of (x * pi), where (x * pi) is measured in radians.
11868 *
11869 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -080011870 *
11871 * Supported by API versions 9 and newer.
11872 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011873extern float __attribute__((const, overloadable))tanpi(float x);
Jason Sams29087fa2014-01-09 17:06:17 -080011874#endif
11875
11876#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011877/**
11878 * Returns the tangent of (x * pi), where (x * pi) is measured in radians.
11879 *
11880 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -080011881 *
11882 * Supported by API versions 9 and newer.
11883 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011884extern float2 __attribute__((const, overloadable))tanpi(float2 x);
Jason Sams29087fa2014-01-09 17:06:17 -080011885#endif
11886
11887#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011888/**
11889 * Returns the tangent of (x * pi), where (x * pi) is measured in radians.
11890 *
11891 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -080011892 *
11893 * Supported by API versions 9 and newer.
11894 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011895extern float3 __attribute__((const, overloadable))tanpi(float3 x);
Jason Sams29087fa2014-01-09 17:06:17 -080011896#endif
11897
11898#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011899/**
11900 * Returns the tangent of (x * pi), where (x * pi) is measured in radians.
11901 *
11902 * To get the tangent of a value measured in degrees, call tanpi(a / 180.f).
Jason Sams29087fa2014-01-09 17:06:17 -080011903 *
11904 * Supported by API versions 9 and newer.
11905 */
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011906extern float4 __attribute__((const, overloadable))tanpi(float4 x);
Jason Sams29087fa2014-01-09 17:06:17 -080011907#endif
11908
11909#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011910/**
11911 * Returns the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011912 *
11913 * Supported by API versions 9 and newer.
11914 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011915extern float __attribute__((const, overloadable))tgamma(float);
Jason Sams29087fa2014-01-09 17:06:17 -080011916#endif
11917
11918#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011919/**
11920 * Returns the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011921 *
11922 * Supported by API versions 9 and newer.
11923 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011924extern float2 __attribute__((const, overloadable))tgamma(float2);
Jason Sams29087fa2014-01-09 17:06:17 -080011925#endif
11926
11927#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011928/**
11929 * Returns the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011930 *
11931 * Supported by API versions 9 and newer.
11932 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011933extern float3 __attribute__((const, overloadable))tgamma(float3);
Jason Sams29087fa2014-01-09 17:06:17 -080011934#endif
11935
11936#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011937/**
11938 * Returns the gamma function of a value.
Jason Sams29087fa2014-01-09 17:06:17 -080011939 *
11940 * Supported by API versions 9 and newer.
11941 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011942extern float4 __attribute__((const, overloadable))tgamma(float4);
Jason Sams29087fa2014-01-09 17:06:17 -080011943#endif
11944
11945#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011946/**
11947 * Rounds to integral using truncation.
11948 *
11949 * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
11950 *
11951 * See rint() and round() for other rounding options.
Jason Sams29087fa2014-01-09 17:06:17 -080011952 *
11953 * Supported by API versions 9 and newer.
11954 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011955extern float __attribute__((const, overloadable))trunc(float);
Jason Sams29087fa2014-01-09 17:06:17 -080011956#endif
11957
11958#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011959/**
11960 * Rounds to integral using truncation.
11961 *
11962 * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
11963 *
11964 * See rint() and round() for other rounding options.
Jason Sams29087fa2014-01-09 17:06:17 -080011965 *
11966 * Supported by API versions 9 and newer.
11967 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011968extern float2 __attribute__((const, overloadable))trunc(float2);
Jason Sams29087fa2014-01-09 17:06:17 -080011969#endif
11970
11971#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011972/**
11973 * Rounds to integral using truncation.
11974 *
11975 * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
11976 *
11977 * See rint() and round() for other rounding options.
Jason Sams29087fa2014-01-09 17:06:17 -080011978 *
11979 * Supported by API versions 9 and newer.
11980 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011981extern float3 __attribute__((const, overloadable))trunc(float3);
Jason Sams29087fa2014-01-09 17:06:17 -080011982#endif
11983
11984#if (defined(RS_VERSION) && (RS_VERSION >= 9))
Jean-Luc Brouillet462e62c2014-12-12 13:42:24 -080011985/**
11986 * Rounds to integral using truncation.
11987 *
11988 * For example, trunc(1.7f) returns 1.f and trunc(-1.7f) returns -1.f.
11989 *
11990 * See rint() and round() for other rounding options.
Jason Sams29087fa2014-01-09 17:06:17 -080011991 *
11992 * Supported by API versions 9 and newer.
11993 */
Jean-Luc Brouillet963c3672014-02-12 20:58:47 -080011994extern float4 __attribute__((const, overloadable))trunc(float4);
Jason Sams29087fa2014-01-09 17:06:17 -080011995#endif
11996
11997#endif // __rs_core_math_rsh__