Update RS prebuilts for LLVM 3.4.

Change-Id: Ia8840135dd2e0a58fa3e39d91cc1b9512c34d300
diff --git a/renderscript/include/rs_core_math.rsh b/renderscript/include/rs_core_math.rsh
index 2b7c362..8fe6ad2 100644
--- a/renderscript/include/rs_core_math.rsh
+++ b/renderscript/include/rs_core_math.rsh
@@ -14,10 +14,1623 @@
  * limitations under the License.
  */
 
+// Don't edit this file!  It is auto-generated by frameworks/rs/api/gen_runtime.
+
 #ifndef __rs_core_math_rsh__
 #define __rs_core_math_rsh__
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar __attribute__((const, overloadable))abs(char value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar2 __attribute__((const, overloadable))abs(char2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar3 __attribute__((const, overloadable))abs(char3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar4 __attribute__((const, overloadable))abs(char4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort __attribute__((const, overloadable))abs(short value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort2 __attribute__((const, overloadable))abs(short2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort3 __attribute__((const, overloadable))abs(short3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort4 __attribute__((const, overloadable))abs(short4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint __attribute__((const, overloadable))abs(int value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint2 __attribute__((const, overloadable))abs(int2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint3 __attribute__((const, overloadable))abs(int3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the absolute value of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint4 __attribute__((const, overloadable))abs(int4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acos
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))acos(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acos
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))acos(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acos
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))acos(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acos
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))acos(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acosh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))acosh(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acosh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))acosh(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acosh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))acosh(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acosh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))acosh(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acospi
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))acospi(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acospi
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))acospi(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acospi
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))acospi(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * acospi
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))acospi(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asin
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))asin(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asin
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))asin(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asin
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))asin(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asin
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))asin(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asinh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))asinh(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asinh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))asinh(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asinh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))asinh(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * asinh
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))asinh(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse sine divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))asinpi(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse sine divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))asinpi(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse sine divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))asinpi(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse sine divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))asinpi(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))atan(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))atan(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))atan(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))atan(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))atan2(float y, float x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))atan2(float2 y, float2 x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))atan2(float3 y, float3 x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))atan2(float4 y, float4 x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x, divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))atan2pi(float y, float x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x, divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))atan2pi(float2 y, float2 x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x, divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))atan2pi(float3 y, float3 x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent of y / x, divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))atan2pi(float4 y, float4 x);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse hyperbolic tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))atanh(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse hyperbolic tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))atanh(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse hyperbolic tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))atanh(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse hyperbolic tangent.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))atanh(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))atanpi(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))atanpi(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))atanpi(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the inverse tangent divided by PI.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))atanpi(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the cube root.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))cbrt(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the cube root.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))cbrt(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the cube root.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))cbrt(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the cube root.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))cbrt(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the smallest integer not less than a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))ceil(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the smallest integer not less than a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))ceil(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the smallest integer not less than a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))ceil(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the smallest integer not less than a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))ceil(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))clamp(float value, float min_value, float max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))clamp(float2 value, float2 min_value, float2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))clamp(float3 value, float3 min_value, float3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))clamp(float4 value, float4 min_value, float4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))clamp(float2 value, float min_value, float max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))clamp(float3 value, float min_value, float max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))clamp(float4 value, float min_value, float max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char __attribute__((const, overloadable))clamp(char value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char2 __attribute__((const, overloadable))clamp(char2 value, char2 min_value, char2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char3 __attribute__((const, overloadable))clamp(char3 value, char3 min_value, char3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char4 __attribute__((const, overloadable))clamp(char4 value, char4 min_value, char4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar __attribute__((const, overloadable))clamp(uchar value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short __attribute__((const, overloadable))clamp(short value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short2 __attribute__((const, overloadable))clamp(short2 value, short2 min_value, short2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short3 __attribute__((const, overloadable))clamp(short3 value, short3 min_value, short3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short4 __attribute__((const, overloadable))clamp(short4 value, short4 min_value, short4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort __attribute__((const, overloadable))clamp(ushort value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int __attribute__((const, overloadable))clamp(int value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int2 __attribute__((const, overloadable))clamp(int2 value, int2 min_value, int2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int3 __attribute__((const, overloadable))clamp(int3 value, int3 min_value, int3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int4 __attribute__((const, overloadable))clamp(int4 value, int4 min_value, int4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint __attribute__((const, overloadable))clamp(uint value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint2 min_value, uint2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint3 min_value, uint3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint4 min_value, uint4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long __attribute__((const, overloadable))clamp(long value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long2 __attribute__((const, overloadable))clamp(long2 value, long2 min_value, long2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long3 __attribute__((const, overloadable))clamp(long3 value, long3 min_value, long3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long4 __attribute__((const, overloadable))clamp(long4 value, long4 min_value, long4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong __attribute__((const, overloadable))clamp(ulong value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char2 __attribute__((const, overloadable))clamp(char2 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char3 __attribute__((const, overloadable))clamp(char3 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern char4 __attribute__((const, overloadable))clamp(char4 value, char min_value, char max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar min_value, uchar max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short2 __attribute__((const, overloadable))clamp(short2 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short3 __attribute__((const, overloadable))clamp(short3 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern short4 __attribute__((const, overloadable))clamp(short4 value, short min_value, short max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort min_value, ushort max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int2 __attribute__((const, overloadable))clamp(int2 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int3 __attribute__((const, overloadable))clamp(int3 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern int4 __attribute__((const, overloadable))clamp(int4 value, int min_value, int max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint min_value, uint max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long2 __attribute__((const, overloadable))clamp(long2 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long3 __attribute__((const, overloadable))clamp(long3 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern long4 __attribute__((const, overloadable))clamp(long4 value, long min_value, long max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+/*
+ * Clamp a value to a specified high and low bound.
+ *
+ * @param amount value to be clamped.  Supports 1,2,3,4 components
+ * @param min_value Lower bound, must be scalar or matching vector.
+ * @param max_value High bound, must match type of low
+ *
+ * Supported by API versions 19 and newer.
+ */
+extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong min_value, ulong max_value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern char __attribute__((const, overloadable))clz(char value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern char2 __attribute__((const, overloadable))clz(char2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern char3 __attribute__((const, overloadable))clz(char3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern char4 __attribute__((const, overloadable))clz(char4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar __attribute__((const, overloadable))clz(uchar value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar2 __attribute__((const, overloadable))clz(uchar2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar3 __attribute__((const, overloadable))clz(uchar3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uchar4 __attribute__((const, overloadable))clz(uchar4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern short __attribute__((const, overloadable))clz(short value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern short2 __attribute__((const, overloadable))clz(short2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern short3 __attribute__((const, overloadable))clz(short3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern short4 __attribute__((const, overloadable))clz(short4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort __attribute__((const, overloadable))clz(ushort value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort2 __attribute__((const, overloadable))clz(ushort2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort3 __attribute__((const, overloadable))clz(ushort3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern ushort4 __attribute__((const, overloadable))clz(ushort4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern int __attribute__((const, overloadable))clz(int value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern int2 __attribute__((const, overloadable))clz(int2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern int3 __attribute__((const, overloadable))clz(int3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern int4 __attribute__((const, overloadable))clz(int4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint __attribute__((const, overloadable))clz(uint value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint2 __attribute__((const, overloadable))clz(uint2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint3 __attribute__((const, overloadable))clz(uint3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the number of leading 0-bits in a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern uint4 __attribute__((const, overloadable))clz(uint4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
  * Component wise conversion from float2 to float2
  *
  * Supported by API versions 9 and newer.
@@ -2718,474 +4331,6 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * acos
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))acos(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acos
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))acos(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acos
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))acos(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acos
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))acos(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acosh
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))acosh(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acosh
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))acosh(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acosh
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))acosh(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acosh
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))acosh(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acospi
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))acospi(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acospi
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))acospi(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acospi
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))acospi(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * acospi
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))acospi(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asin
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))asin(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asin
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))asin(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asin
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))asin(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asin
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))asin(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asinh
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))asinh(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asinh
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))asinh(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asinh
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))asinh(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * asinh
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))asinh(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse sine divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))asinpi(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse sine divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))asinpi(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse sine divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))asinpi(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse sine divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))asinpi(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))atan(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))atan(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))atan(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))atan(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))atan2(float y, float x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))atan2(float2 y, float2 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))atan2(float3 y, float3 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))atan2(float4 y, float4 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse hyperbolic tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))atanh(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse hyperbolic tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))atanh(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse hyperbolic tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))atanh(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse hyperbolic tangent.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))atanh(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))atanpi(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))atanpi(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))atanpi(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))atanpi(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x, divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))atan2pi(float y, float x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x, divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))atan2pi(float2 y, float2 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x, divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))atan2pi(float3 y, float3 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the inverse tangent of y / x, divided by PI.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))atan2pi(float4 y, float4 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the cube root.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))cbrt(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the cube root.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))cbrt(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the cube root.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))cbrt(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the cube root.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))cbrt(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the smallest integer not less than a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))ceil(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the smallest integer not less than a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))ceil(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the smallest integer not less than a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))ceil(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the smallest integer not less than a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))ceil(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
  * Copy the sign bit from y to x.
  *
  * Supported by API versions 9 and newer.
@@ -3330,38 +4475,128 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the complementary error function.
+ * Compute the cross product of two vectors.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))erfc(float);
+extern float3 __attribute__((const, overloadable))cross(float3 lhs, float3 rhs);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the complementary error function.
+ * Compute the cross product of two vectors.
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))erfc(float2);
+extern float4 __attribute__((const, overloadable))cross(float4 lhs, float4 rhs);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the complementary error function.
+ * Convert from radians to degrees.
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))erfc(float3);
+extern float __attribute__((const, overloadable))degrees(float value);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the complementary error function.
+ * Convert from radians to degrees.
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))erfc(float4);
+extern float2 __attribute__((const, overloadable))degrees(float2 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Convert from radians to degrees.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))degrees(float3 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Convert from radians to degrees.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))degrees(float4 value);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the distance between two points.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))distance(float lhs, float rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the distance between two points.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))distance(float2 lhs, float2 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the distance between two points.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))distance(float3 lhs, float3 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the distance between two points.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))distance(float4 lhs, float4 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the dot product of two vectors.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))dot(float lhs, float rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the dot product of two vectors.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))dot(float2 lhs, float2 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the dot product of two vectors.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))dot(float3 lhs, float3 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the dot product of two vectors.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))dot(float4 lhs, float4 rhs);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3402,6 +4637,42 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
+ * Return the complementary error function.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))erfc(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the complementary error function.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))erfc(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the complementary error function.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))erfc(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the complementary error function.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))erfc(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
  * Return e ^ value.
  *
  * Supported by API versions 9 and newer.
@@ -3438,42 +4709,6 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return 2 ^ value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))exp2(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return 2 ^ value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))exp2(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return 2 ^ value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))exp2(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return 2 ^ value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))exp2(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
  * Return 10 ^ value.
  *
  * Supported by API versions 9 and newer.
@@ -3510,6 +4745,42 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
+ * Return 2 ^ value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))exp2(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return 2 ^ value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))exp2(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return 2 ^ value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))exp2(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return 2 ^ value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))exp2(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
  * Return (e ^ value) - 1.
  *
  * Supported by API versions 9 and newer.
@@ -3580,13 +4851,112 @@
 extern float4 __attribute__((const, overloadable))fabs(float4);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
 /*
- * Return the positive difference between two values.
+ * Compute the approximate distance between two points.
  *
- * Supported by API versions 9 and newer.
+ * Supported by API versions 17 and newer.
  */
-extern float __attribute__((const, overloadable))fdim(float, float);
+extern float __attribute__((const, overloadable))fast_distance(float lhs, float rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate distance between two points.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_distance(float2 lhs, float2 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate distance between two points.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_distance(float3 lhs, float3 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate distance between two points.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_distance(float4 lhs, float4 rhs);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate length of a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_length(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate length of a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_length(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate length of a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_length(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Compute the approximate length of a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_length(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Approximately normalize a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))fast_normalize(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Approximately normalize a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float2 __attribute__((const, overloadable))fast_normalize(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Approximately normalize a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float3 __attribute__((const, overloadable))fast_normalize(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Approximately normalize a vector.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float4 __attribute__((const, overloadable))fast_normalize(float4 v);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3595,7 +4965,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))fdim(float2, float2);
+extern float __attribute__((const, overloadable))fdim(float a, float b);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3604,7 +4974,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))fdim(float3, float3);
+extern float2 __attribute__((const, overloadable))fdim(float2 a, float2 b);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3613,7 +4983,16 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))fdim(float4, float4);
+extern float3 __attribute__((const, overloadable))fdim(float3 a, float3 b);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the positive difference between two values.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))fdim(float4 a, float4 b);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3854,44 +5233,44 @@
 /*
  * Return fractional part of v
  *
- * @param iptr  iptr[0] will be set to the floor of the input value.
+ * @param floor  floor[0] will be set to the floor of the input value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))fract(float v, float *iptr);
+extern float __attribute__((overloadable))fract(float v, float *floor);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
  * Return fractional part of v
  *
- * @param iptr  iptr[0] will be set to the floor of the input value.
+ * @param floor  floor[0] will be set to the floor of the input value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))fract(float2 v, float2 *iptr);
+extern float2 __attribute__((overloadable))fract(float2 v, float2 *floor);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
  * Return fractional part of v
  *
- * @param iptr  iptr[0] will be set to the floor of the input value.
+ * @param floor  floor[0] will be set to the floor of the input value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))fract(float3 v, float3 *iptr);
+extern float3 __attribute__((overloadable))fract(float3 v, float3 *floor);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
  * Return fractional part of v
  *
- * @param iptr  iptr[0] will be set to the floor of the input value.
+ * @param floor  floor[0] will be set to the floor of the input value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))fract(float4 v, float4 *iptr);
+extern float4 __attribute__((overloadable))fract(float4 v, float4 *floor);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3950,7 +5329,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))frexp(float v, int *iptr);
+extern float __attribute__((overloadable))frexp(float v, int *iptr);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3961,7 +5340,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))frexp(float2 v, int2 *iptr);
+extern float2 __attribute__((overloadable))frexp(float2 v, int2 *iptr);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3972,7 +5351,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))frexp(float3 v, int3 *iptr);
+extern float3 __attribute__((overloadable))frexp(float3 v, int3 *iptr);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -3983,7 +5362,115 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))frexp(float4 v, int4 *iptr);
+extern float4 __attribute__((overloadable))frexp(float4 v, int4 *iptr);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate reciprocal of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))half_recip(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate reciprocal of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float2 __attribute__((const, overloadable))half_recip(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate reciprocal of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float3 __attribute__((const, overloadable))half_recip(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate reciprocal of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float4 __attribute__((const, overloadable))half_recip(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate value of (1.f / sqrt(value)).
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))half_rsqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate value of (1.f / sqrt(value)).
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float2 __attribute__((const, overloadable))half_rsqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate value of (1.f / sqrt(value)).
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float3 __attribute__((const, overloadable))half_rsqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate value of (1.f / sqrt(value)).
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float4 __attribute__((const, overloadable))half_rsqrt(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate square root of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float __attribute__((const, overloadable))half_sqrt(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate square root of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float2 __attribute__((const, overloadable))half_sqrt(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate square root of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float3 __attribute__((const, overloadable))half_sqrt(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 17))
+/*
+ * Return the approximate square root of a value.
+ *
+ * Supported by API versions 17 and newer.
+ */
+extern float4 __attribute__((const, overloadable))half_sqrt(float4 v);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4144,11 +5631,38 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the log gamma and sign
+ * Compute the length of a vector.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))lgamma(float x);
+extern float __attribute__((const, overloadable))length(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the length of a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))length(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the length of a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))length(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the length of a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))length(float4 v);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4157,7 +5671,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))lgamma(float2 x);
+extern float __attribute__((const, overloadable))lgamma(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4166,7 +5680,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))lgamma(float3 x);
+extern float2 __attribute__((const, overloadable))lgamma(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4175,7 +5689,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))lgamma(float4 x);
+extern float3 __attribute__((const, overloadable))lgamma(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4184,7 +5698,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))lgamma(float x, int *y);
+extern float4 __attribute__((const, overloadable))lgamma(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4193,7 +5707,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))lgamma(float2 x, int2 *y);
+extern float __attribute__((overloadable))lgamma(float x, int *y);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4202,7 +5716,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))lgamma(float3 x, int3 *y);
+extern float2 __attribute__((overloadable))lgamma(float2 x, int2 *y);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4211,7 +5725,16 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))lgamma(float4 x, int4 *y);
+extern float3 __attribute__((overloadable))lgamma(float3 x, int3 *y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the log gamma and sign
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((overloadable))lgamma(float4 x, int4 *y);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4220,7 +5743,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))log(float x);
+extern float __attribute__((const, overloadable))log(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4229,7 +5752,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))log(float2 x);
+extern float2 __attribute__((const, overloadable))log(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4238,7 +5761,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))log(float3 x);
+extern float3 __attribute__((const, overloadable))log(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4247,43 +5770,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))log(float4 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the base 2 logarithm.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))log2(float x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the base 2 logarithm.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))log2(float2 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the base 2 logarithm.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))log2(float3 x);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the base 2 logarithm.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))log2(float4 x);
+extern float4 __attribute__((const, overloadable))log(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4292,7 +5779,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))log10(float x);
+extern float __attribute__((const, overloadable))log10(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4301,7 +5788,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))log10(float2 x);
+extern float2 __attribute__((const, overloadable))log10(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4310,7 +5797,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))log10(float3 x);
+extern float3 __attribute__((const, overloadable))log10(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4319,7 +5806,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))log10(float4 x);
+extern float4 __attribute__((const, overloadable))log10(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4328,7 +5815,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))log1p(float x);
+extern float __attribute__((const, overloadable))log1p(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4337,7 +5824,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))log1p(float2 x);
+extern float2 __attribute__((const, overloadable))log1p(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4346,7 +5833,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))log1p(float3 x);
+extern float3 __attribute__((const, overloadable))log1p(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4355,7 +5842,43 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))log1p(float4 x);
+extern float4 __attribute__((const, overloadable))log1p(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the base 2 logarithm.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))log2(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the base 2 logarithm.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))log2(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the base 2 logarithm.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))log2(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the base 2 logarithm.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))log2(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4364,7 +5887,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))logb(float x);
+extern float __attribute__((const, overloadable))logb(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4373,7 +5896,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))logb(float2 x);
+extern float2 __attribute__((const, overloadable))logb(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4382,7 +5905,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))logb(float3 x);
+extern float3 __attribute__((const, overloadable))logb(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4391,7 +5914,7 @@
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))logb(float4 x);
+extern float4 __attribute__((const, overloadable))logb(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -4432,1791 +5955,6 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the integral and fractional components of a number.
- *
- * @param x Source value
- * @param iret iret[0] will be set to the integral portion of the number.
- * @return The floating point portion of the value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))modf(float x, float *iret);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the integral and fractional components of a number.
- *
- * @param x Source value
- * @param iret iret[0] will be set to the integral portion of the number.
- * @return The floating point portion of the value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))modf(float2 x, float2 *iret);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the integral and fractional components of a number.
- *
- * @param x Source value
- * @param iret iret[0] will be set to the integral portion of the number.
- * @return The floating point portion of the value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))modf(float3 x, float3 *iret);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the integral and fractional components of a number.
- *
- * @param x Source value
- * @param iret iret[0] will be set to the integral portion of the number.
- * @return The floating point portion of the value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))modf(float4 x, float4 *iret);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * generate a nan
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))nan(uint);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the next floating point number from x towards y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))nextafter(float x, float y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the next floating point number from x towards y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))nextafter(float2 x, float2 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the next floating point number from x towards y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))nextafter(float3 x, float3 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the next floating point number from x towards y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))nextafter(float4 x, float4 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))pow(float x, float y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))pow(float2 x, float2 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))pow(float3 x, float3 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))pow(float4 x, float4 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))pown(float x, int y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))pown(float2 x, int2 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))pown(float3 x, int3 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))pown(float4 x, int4 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- * y must be > 0
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))powr(float x, float y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- * y must be > 0
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))powr(float2 x, float2 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- * y must be > 0
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))powr(float3 x, float3 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return x ^ y.
- * y must be > 0
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))powr(float4 x, float4 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return round x/y to the nearest integer then compute the remander.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))remainder(float x, float y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return round x/y to the nearest integer then compute the remander.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))remainder(float2 x, float2 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return round x/y to the nearest integer then compute the remander.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))remainder(float3 x, float3 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return round x/y to the nearest integer then compute the remander.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))remainder(float4 x, float4 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * todo
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))remquo(float, float, int *);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * todo
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))remquo(float2, float2, int2 *);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * todo
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))remquo(float3, float3, int3 *);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * todo
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))remquo(float4, float4, int4 *);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))rint(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))rint(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))rint(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))rint(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the Nth root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))rootn(float v, int n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the Nth root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))rootn(float2 v, int2 n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the Nth root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))rootn(float3 v, int3 n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the Nth root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))rootn(float4 v, int4 n);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.  Half values are rounded away from zero.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))round(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.  Half values are rounded away from zero.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))round(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.  Half values are rounded away from zero.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))round(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Round to the nearest integral value.  Half values are rounded away from zero.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))round(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return (1 / sqrt(value)).
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))rsqrt(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return (1 / sqrt(value)).
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))rsqrt(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return (1 / sqrt(value)).
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))rsqrt(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return (1 / sqrt(value)).
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))rsqrt(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the square root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))sqrt(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the square root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))sqrt(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the square root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))sqrt(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the square root of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))sqrt(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))sin(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))sin(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))sin(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))sin(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine and cosine of a value.
- *
- * @return sine
- * @param v The incoming value in radians
- * @param *cosptr cosptr[0] will be set to the cosine value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))sincos(float v, float *cosptr);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine and cosine of a value.
- *
- * @return sine
- * @param v The incoming value in radians
- * @param *cosptr cosptr[0] will be set to the cosine value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))sincos(float2 v, float2 *cosptr);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine and cosine of a value.
- *
- * @return sine
- * @param v The incoming value in radians
- * @param *cosptr cosptr[0] will be set to the cosine value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))sincos(float3 v, float3 *cosptr);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sine and cosine of a value.
- *
- * @return sine
- * @param v The incoming value in radians
- * @param *cosptr cosptr[0] will be set to the cosine value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))sincos(float4 v, float4 *cosptr);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))sinh(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))sinh(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))sinh(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic sine of a value specified in radians.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))sinh(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sin(v * PI).
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))sinpi(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sin(v * PI).
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))sinpi(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sin(v * PI).
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))sinpi(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the sin(v * PI).
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))sinpi(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))tan(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))tan(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))tan(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))tan(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))tanh(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))tanh(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))tanh(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the hyperbolic tangent of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))tanh(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return tan(v * PI)
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))tanpi(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return tan(v * PI)
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))tanpi(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return tan(v * PI)
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))tanpi(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return tan(v * PI)
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))tanpi(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the gamma function of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))tgamma(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the gamma function of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))tgamma(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the gamma function of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))tgamma(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Compute the gamma function of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))tgamma(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * ound to integral using truncation.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))trunc(float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * ound to integral using truncation.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))trunc(float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * ound to integral using truncation.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))trunc(float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * ound to integral using truncation.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))trunc(float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar __attribute__((const, overloadable))abs(char value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar2 __attribute__((const, overloadable))abs(char2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar3 __attribute__((const, overloadable))abs(char3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar4 __attribute__((const, overloadable))abs(char4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort __attribute__((const, overloadable))abs(short value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort2 __attribute__((const, overloadable))abs(short2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort3 __attribute__((const, overloadable))abs(short3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort4 __attribute__((const, overloadable))abs(short4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint __attribute__((const, overloadable))abs(int value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint2 __attribute__((const, overloadable))abs(int2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint3 __attribute__((const, overloadable))abs(int3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the absolute value of a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint4 __attribute__((const, overloadable))abs(int4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern char __attribute__((const, overloadable))clz(char value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern char2 __attribute__((const, overloadable))clz(char2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern char3 __attribute__((const, overloadable))clz(char3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern char4 __attribute__((const, overloadable))clz(char4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar __attribute__((const, overloadable))clz(uchar value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar2 __attribute__((const, overloadable))clz(uchar2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar3 __attribute__((const, overloadable))clz(uchar3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uchar4 __attribute__((const, overloadable))clz(uchar4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern short __attribute__((const, overloadable))clz(short value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern short2 __attribute__((const, overloadable))clz(short2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern short3 __attribute__((const, overloadable))clz(short3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern short4 __attribute__((const, overloadable))clz(short4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort __attribute__((const, overloadable))clz(ushort value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort2 __attribute__((const, overloadable))clz(ushort2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort3 __attribute__((const, overloadable))clz(ushort3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern ushort4 __attribute__((const, overloadable))clz(ushort4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern int __attribute__((const, overloadable))clz(int value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern int2 __attribute__((const, overloadable))clz(int2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern int3 __attribute__((const, overloadable))clz(int3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern int4 __attribute__((const, overloadable))clz(int4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint __attribute__((const, overloadable))clz(uint value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint2 __attribute__((const, overloadable))clz(uint2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint3 __attribute__((const, overloadable))clz(uint3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the number of leading 0-bits in a value.
- *
- * Supported by API versions 9 and newer.
- */
-extern uint4 __attribute__((const, overloadable))clz(uint4 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))min(float, float);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))min(float2, float2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))min(float3, float3);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))min(float4, float4);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static char __attribute__((const, overloadable))min(char v1, char v2) {
- return (v1 < v2 ? v1 : v2);
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uchar __attribute__((const, overloadable))min(uchar v1, uchar v2) {
- return (v1 < v2 ? v1 : v2);
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static short __attribute__((const, overloadable))min(short v1, short v2) {
- return (v1 < v2 ? v1 : v2);
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static ushort __attribute__((const, overloadable))min(ushort v1, ushort v2) {
- return (v1 < v2 ? v1 : v2);
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static int __attribute__((const, overloadable))min(int v1, int v2) {
- return (v1 < v2 ? v1 : v2);
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uint __attribute__((const, overloadable))min(uint v1, uint v2) {
- return (v1 < v2 ? v1 : v2);
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static char2 __attribute__((const, overloadable))min(char2 v1, char2 v2) {
- char2 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2) {
- uchar2 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static short2 __attribute__((const, overloadable))min(short2 v1, short2 v2) {
- short2 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2) {
- ushort2 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static int2 __attribute__((const, overloadable))min(int2 v1, int2 v2) {
- int2 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2) {
- uint2 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static char3 __attribute__((const, overloadable))min(char3 v1, char3 v2) {
- char3 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2) {
- uchar3 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static short3 __attribute__((const, overloadable))min(short3 v1, short3 v2) {
- short3 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2) {
- ushort3 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static int3 __attribute__((const, overloadable))min(int3 v1, int3 v2) {
- int3 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2) {
- uint3 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static char4 __attribute__((const, overloadable))min(char4 v1, char4 v2) {
- char4 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- tmp.w = (v1.w < v2.w ? v1.w : v2.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2) {
- uchar4 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- tmp.w = (v1.w < v2.w ? v1.w : v2.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static short4 __attribute__((const, overloadable))min(short4 v1, short4 v2) {
- short4 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- tmp.w = (v1.w < v2.w ? v1.w : v2.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2) {
- ushort4 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- tmp.w = (v1.w < v2.w ? v1.w : v2.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static int4 __attribute__((const, overloadable))min(int4 v1, int4 v2) {
- int4 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- tmp.w = (v1.w < v2.w ? v1.w : v2.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
-/*
- * Return the minimum value from two arguments
- *
- * Suppored by API versions 9 - 19
- */
-static uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2) {
- uint4 tmp;
- tmp.x = (v1.x < v2.x ? v1.x : v2.x);
- tmp.y = (v1.y < v2.y ? v1.y : v2.y);
- tmp.z = (v1.z < v2.z ? v1.z : v2.z);
- tmp.w = (v1.w < v2.w ? v1.w : v2.w);
- return tmp;
-}
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern char __attribute__((const, overloadable))min(char v1, char v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern char2 __attribute__((const, overloadable))min(char2 v1, char2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern char3 __attribute__((const, overloadable))min(char3 v1, char3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern char4 __attribute__((const, overloadable))min(char4 v1, char4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uchar __attribute__((const, overloadable))min(uchar v1, uchar v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern short __attribute__((const, overloadable))min(short v1, short v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern short2 __attribute__((const, overloadable))min(short2 v1, short2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern short3 __attribute__((const, overloadable))min(short3 v1, short3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern short4 __attribute__((const, overloadable))min(short4 v1, short4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ushort __attribute__((const, overloadable))min(ushort v1, ushort v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern int __attribute__((const, overloadable))min(int v1, int v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern int2 __attribute__((const, overloadable))min(int2 v1, int2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern int3 __attribute__((const, overloadable))min(int3 v1, int3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern int4 __attribute__((const, overloadable))min(int4 v1, int4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uint __attribute__((const, overloadable))min(uint v1, uint v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern long __attribute__((const, overloadable))min(long v1, long v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern long2 __attribute__((const, overloadable))min(long2 v1, long2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern long3 __attribute__((const, overloadable))min(long3 v1, long3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern long4 __attribute__((const, overloadable))min(long4 v1, long4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ulong __attribute__((const, overloadable))min(ulong v1, ulong v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ulong2 __attribute__((const, overloadable))min(ulong2 v1, ulong2 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ulong3 __attribute__((const, overloadable))min(ulong3 v1, ulong3 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 20))
-/*
- * Return the minimum value from two arguments
- *
- * Supported by API versions 20 and newer.
- */
-extern ulong4 __attribute__((const, overloadable))min(ulong4 v1, ulong4 v2);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
  * Return the maximum value from two arguments
  *
  * Supported by API versions 9 and newer.
@@ -6877,857 +6615,662 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
+ * Return the minimum value from two arguments
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))clamp(float value, float min_value, float max_value);
+extern float __attribute__((const, overloadable))min(float, float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
+ * Return the minimum value from two arguments
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))clamp(float2 value, float2 min_value, float2 max_value);
+extern float2 __attribute__((const, overloadable))min(float2, float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
+ * Return the minimum value from two arguments
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))clamp(float3 value, float3 min_value, float3 max_value);
+extern float3 __attribute__((const, overloadable))min(float3, float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
+ * Return the minimum value from two arguments
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))clamp(float4 value, float4 min_value, float4 max_value);
+extern float4 __attribute__((const, overloadable))min(float4, float4);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 9 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern float2 __attribute__((const, overloadable))clamp(float2 value, float min_value, float max_value);
+static char __attribute__((const, overloadable))min(char v1, char v2) {
+ return (v1 < v2 ? v1 : v2);
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 9 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern float3 __attribute__((const, overloadable))clamp(float3 value, float min_value, float max_value);
+static uchar __attribute__((const, overloadable))min(uchar v1, uchar v2) {
+ return (v1 < v2 ? v1 : v2);
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 9 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern float4 __attribute__((const, overloadable))clamp(float4 value, float min_value, float max_value);
+static short __attribute__((const, overloadable))min(short v1, short v2) {
+ return (v1 < v2 ? v1 : v2);
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern char __attribute__((const, overloadable))clamp(char value, char min_value, char max_value);
+static ushort __attribute__((const, overloadable))min(ushort v1, ushort v2) {
+ return (v1 < v2 ? v1 : v2);
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern char2 __attribute__((const, overloadable))clamp(char2 value, char2 min_value, char2 max_value);
+static int __attribute__((const, overloadable))min(int v1, int v2) {
+ return (v1 < v2 ? v1 : v2);
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern char3 __attribute__((const, overloadable))clamp(char3 value, char3 min_value, char3 max_value);
+static uint __attribute__((const, overloadable))min(uint v1, uint v2) {
+ return (v1 < v2 ? v1 : v2);
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern char4 __attribute__((const, overloadable))clamp(char4 value, char4 min_value, char4 max_value);
+static char2 __attribute__((const, overloadable))min(char2 v1, char2 v2) {
+ char2 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern uchar __attribute__((const, overloadable))clamp(uchar value, uchar min_value, uchar max_value);
+static uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2) {
+ uchar2 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar2 min_value, uchar2 max_value);
+static short2 __attribute__((const, overloadable))min(short2 v1, short2 v2) {
+ short2 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar3 min_value, uchar3 max_value);
+static ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2) {
+ ushort2 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar4 min_value, uchar4 max_value);
+static int2 __attribute__((const, overloadable))min(int2 v1, int2 v2) {
+ int2 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern short __attribute__((const, overloadable))clamp(short value, short min_value, short max_value);
+static uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2) {
+ uint2 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern short2 __attribute__((const, overloadable))clamp(short2 value, short2 min_value, short2 max_value);
+static char3 __attribute__((const, overloadable))min(char3 v1, char3 v2) {
+ char3 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern short3 __attribute__((const, overloadable))clamp(short3 value, short3 min_value, short3 max_value);
+static uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2) {
+ uchar3 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern short4 __attribute__((const, overloadable))clamp(short4 value, short4 min_value, short4 max_value);
+static short3 __attribute__((const, overloadable))min(short3 v1, short3 v2) {
+ short3 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern ushort __attribute__((const, overloadable))clamp(ushort value, ushort min_value, ushort max_value);
+static ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2) {
+ ushort3 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort2 min_value, ushort2 max_value);
+static int3 __attribute__((const, overloadable))min(int3 v1, int3 v2) {
+ int3 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort3 min_value, ushort3 max_value);
+static uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2) {
+ uint3 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort4 min_value, ushort4 max_value);
+static char4 __attribute__((const, overloadable))min(char4 v1, char4 v2) {
+ char4 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ tmp.w = (v1.w < v2.w ? v1.w : v2.w);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern int __attribute__((const, overloadable))clamp(int value, int min_value, int max_value);
+static uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2) {
+ uchar4 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ tmp.w = (v1.w < v2.w ? v1.w : v2.w);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern int2 __attribute__((const, overloadable))clamp(int2 value, int2 min_value, int2 max_value);
+static short4 __attribute__((const, overloadable))min(short4 v1, short4 v2) {
+ short4 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ tmp.w = (v1.w < v2.w ? v1.w : v2.w);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern int3 __attribute__((const, overloadable))clamp(int3 value, int3 min_value, int3 max_value);
+static ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2) {
+ ushort4 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ tmp.w = (v1.w < v2.w ? v1.w : v2.w);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern int4 __attribute__((const, overloadable))clamp(int4 value, int4 min_value, int4 max_value);
+static int4 __attribute__((const, overloadable))min(int4 v1, int4 v2) {
+ int4 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ tmp.w = (v1.w < v2.w ? v1.w : v2.w);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 9) && (RS_VERSION <= 19))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Suppored by API versions 9 - 19
  */
-extern uint __attribute__((const, overloadable))clamp(uint value, uint min_value, uint max_value);
+static uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2) {
+ uint4 tmp;
+ tmp.x = (v1.x < v2.x ? v1.x : v2.x);
+ tmp.y = (v1.y < v2.y ? v1.y : v2.y);
+ tmp.z = (v1.z < v2.z ? v1.z : v2.z);
+ tmp.w = (v1.w < v2.w ? v1.w : v2.w);
+ return tmp;
+}
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint2 min_value, uint2 max_value);
+extern char __attribute__((const, overloadable))min(char v1, char v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint3 min_value, uint3 max_value);
+extern char2 __attribute__((const, overloadable))min(char2 v1, char2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint4 min_value, uint4 max_value);
+extern char3 __attribute__((const, overloadable))min(char3 v1, char3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long __attribute__((const, overloadable))clamp(long value, long min_value, long max_value);
+extern char4 __attribute__((const, overloadable))min(char4 v1, char4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long2 __attribute__((const, overloadable))clamp(long2 value, long2 min_value, long2 max_value);
+extern uchar __attribute__((const, overloadable))min(uchar v1, uchar v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long3 __attribute__((const, overloadable))clamp(long3 value, long3 min_value, long3 max_value);
+extern uchar2 __attribute__((const, overloadable))min(uchar2 v1, uchar2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long4 __attribute__((const, overloadable))clamp(long4 value, long4 min_value, long4 max_value);
+extern uchar3 __attribute__((const, overloadable))min(uchar3 v1, uchar3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ulong __attribute__((const, overloadable))clamp(ulong value, ulong min_value, ulong max_value);
+extern uchar4 __attribute__((const, overloadable))min(uchar4 v1, uchar4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong2 min_value, ulong2 max_value);
+extern short __attribute__((const, overloadable))min(short v1, short v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong3 min_value, ulong3 max_value);
+extern short2 __attribute__((const, overloadable))min(short2 v1, short2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong4 min_value, ulong4 max_value);
+extern short3 __attribute__((const, overloadable))min(short3 v1, short3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern char2 __attribute__((const, overloadable))clamp(char2 value, char min_value, char max_value);
+extern short4 __attribute__((const, overloadable))min(short4 v1, short4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern char3 __attribute__((const, overloadable))clamp(char3 value, char min_value, char max_value);
+extern ushort __attribute__((const, overloadable))min(ushort v1, ushort v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern char4 __attribute__((const, overloadable))clamp(char4 value, char min_value, char max_value);
+extern ushort2 __attribute__((const, overloadable))min(ushort2 v1, ushort2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uchar2 __attribute__((const, overloadable))clamp(uchar2 value, uchar min_value, uchar max_value);
+extern ushort3 __attribute__((const, overloadable))min(ushort3 v1, ushort3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uchar3 __attribute__((const, overloadable))clamp(uchar3 value, uchar min_value, uchar max_value);
+extern ushort4 __attribute__((const, overloadable))min(ushort4 v1, ushort4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uchar4 __attribute__((const, overloadable))clamp(uchar4 value, uchar min_value, uchar max_value);
+extern int __attribute__((const, overloadable))min(int v1, int v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern short2 __attribute__((const, overloadable))clamp(short2 value, short min_value, short max_value);
+extern int2 __attribute__((const, overloadable))min(int2 v1, int2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern short3 __attribute__((const, overloadable))clamp(short3 value, short min_value, short max_value);
+extern int3 __attribute__((const, overloadable))min(int3 v1, int3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern short4 __attribute__((const, overloadable))clamp(short4 value, short min_value, short max_value);
+extern int4 __attribute__((const, overloadable))min(int4 v1, int4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ushort2 __attribute__((const, overloadable))clamp(ushort2 value, ushort min_value, ushort max_value);
+extern uint __attribute__((const, overloadable))min(uint v1, uint v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ushort3 __attribute__((const, overloadable))clamp(ushort3 value, ushort min_value, ushort max_value);
+extern uint2 __attribute__((const, overloadable))min(uint2 v1, uint2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern ushort4 __attribute__((const, overloadable))clamp(ushort4 value, ushort min_value, ushort max_value);
+extern uint3 __attribute__((const, overloadable))min(uint3 v1, uint3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern int2 __attribute__((const, overloadable))clamp(int2 value, int min_value, int max_value);
+extern uint4 __attribute__((const, overloadable))min(uint4 v1, uint4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern int3 __attribute__((const, overloadable))clamp(int3 value, int min_value, int max_value);
+extern long __attribute__((const, overloadable))min(long v1, long v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern int4 __attribute__((const, overloadable))clamp(int4 value, int min_value, int max_value);
+extern long2 __attribute__((const, overloadable))min(long2 v1, long2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uint2 __attribute__((const, overloadable))clamp(uint2 value, uint min_value, uint max_value);
+extern long3 __attribute__((const, overloadable))min(long3 v1, long3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uint3 __attribute__((const, overloadable))clamp(uint3 value, uint min_value, uint max_value);
+extern long4 __attribute__((const, overloadable))min(long4 v1, long4 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern uint4 __attribute__((const, overloadable))clamp(uint4 value, uint min_value, uint max_value);
+extern ulong __attribute__((const, overloadable))min(ulong v1, ulong v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long2 __attribute__((const, overloadable))clamp(long2 value, long min_value, long max_value);
+extern ulong2 __attribute__((const, overloadable))min(ulong2 v1, ulong2 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long3 __attribute__((const, overloadable))clamp(long3 value, long min_value, long max_value);
+extern ulong3 __attribute__((const, overloadable))min(ulong3 v1, ulong3 v2);
 #endif
 
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
+#if (defined(RS_VERSION) && (RS_VERSION >= 20))
 /*
- * Clamp a value to a specified high and low bound.
+ * Return the minimum value from two arguments
  *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
+ * Supported by API versions 20 and newer.
  */
-extern long4 __attribute__((const, overloadable))clamp(long4 value, long min_value, long max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-/*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
- */
-extern ulong2 __attribute__((const, overloadable))clamp(ulong2 value, ulong min_value, ulong max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-/*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
- */
-extern ulong3 __attribute__((const, overloadable))clamp(ulong3 value, ulong min_value, ulong max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 19))
-/*
- * Clamp a value to a specified high and low bound.
- *
- * @param amount value to be clamped.  Supports 1,2,3,4 components
- * @param min_value Lower bound, must be scalar or matching vector.
- * @param max_value High bound, must match type of low
- *
- * Supported by API versions 19 and newer.
- */
-extern ulong4 __attribute__((const, overloadable))clamp(ulong4 value, ulong min_value, ulong max_value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Convert from radians to degrees.
- *
- * Supported by API versions 9 and newer.
- */
-extern float __attribute__((const, overloadable))degrees(float value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Convert from radians to degrees.
- *
- * Supported by API versions 9 and newer.
- */
-extern float2 __attribute__((const, overloadable))degrees(float2 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Convert from radians to degrees.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))degrees(float3 value);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Convert from radians to degrees.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))degrees(float4 value);
+extern ulong4 __attribute__((const, overloadable))min(ulong4 v1, ulong4 v2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
@@ -7795,6 +7338,527 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
+ * Return the integral and fractional components of a number.
+ *
+ * @param x Source value
+ * @param iret iret[0] will be set to the integral portion of the number.
+ * @return The floating point portion of the value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((overloadable))modf(float x, float *iret);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the integral and fractional components of a number.
+ *
+ * @param x Source value
+ * @param iret iret[0] will be set to the integral portion of the number.
+ * @return The floating point portion of the value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((overloadable))modf(float2 x, float2 *iret);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the integral and fractional components of a number.
+ *
+ * @param x Source value
+ * @param iret iret[0] will be set to the integral portion of the number.
+ * @return The floating point portion of the value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((overloadable))modf(float3 x, float3 *iret);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the integral and fractional components of a number.
+ *
+ * @param x Source value
+ * @param iret iret[0] will be set to the integral portion of the number.
+ * @return The floating point portion of the value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((overloadable))modf(float4 x, float4 *iret);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * generate a nan
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))nan(uint);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp
+ * valid for inputs -86.f to 86.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_exp(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp
+ * valid for inputs -86.f to 86.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_exp(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp
+ * valid for inputs -86.f to 86.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_exp(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp
+ * valid for inputs -86.f to 86.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_exp(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp10
+ * valid for inputs -37.f to 37.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_exp10(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp10
+ * valid for inputs -37.f to 37.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_exp10(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp10
+ * valid for inputs -37.f to 37.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_exp10(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp10
+ * valid for inputs -37.f to 37.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_exp10(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp2
+ * valid for inputs -125.f to 125.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_exp2(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp2
+ * valid for inputs -125.f to 125.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_exp2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp2
+ * valid for inputs -125.f to 125.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_exp2(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate exp2
+ * valid for inputs -125.f to 125.f
+ * Max 8192 ulps of error
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_exp2(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_log(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_log(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_log(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_log(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log10
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_log10(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log10
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_log10(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log10
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_log10(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log10
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_log10(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log2
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_log2(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log2
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_log2(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log2
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_log2(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate log2
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_log2(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate v ^ y
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float __attribute__((const, overloadable))native_powr(float v, float y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate v ^ y
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float2 __attribute__((const, overloadable))native_powr(float2 v, float2 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate v ^ y
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float3 __attribute__((const, overloadable))native_powr(float3 v, float3 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 18))
+/*
+ * Fast approximate v ^ y
+ *
+ * Supported by API versions 18 and newer.
+ */
+extern float4 __attribute__((const, overloadable))native_powr(float4 v, float4 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the next floating point number from x towards y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))nextafter(float x, float y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the next floating point number from x towards y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))nextafter(float2 x, float2 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the next floating point number from x towards y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))nextafter(float3 x, float3 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the next floating point number from x towards y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))nextafter(float4 x, float4 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Normalize a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))normalize(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Normalize a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))normalize(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Normalize a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))normalize(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Normalize a vector.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))normalize(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))pow(float x, float y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))pow(float2 x, float2 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))pow(float3 x, float3 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))pow(float4 x, float4 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))pown(float x, int y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))pown(float2 x, int2 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))pown(float3 x, int3 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))pown(float4 x, int4 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ * y must be > 0
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))powr(float x, float y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ * y must be > 0
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))powr(float2 x, float2 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ * y must be > 0
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))powr(float3 x, float3 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return x ^ y.
+ * y must be > 0
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))powr(float4 x, float4 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
  * Convert from degrees to radians.
  *
  * Supported by API versions 9 and newer.
@@ -7831,6 +7895,470 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
+ * Return round x/y to the nearest integer then compute the remander.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))remainder(float x, float y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return round x/y to the nearest integer then compute the remander.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))remainder(float2 x, float2 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return round x/y to the nearest integer then compute the remander.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))remainder(float3 x, float3 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return round x/y to the nearest integer then compute the remander.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))remainder(float4 x, float4 y);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * todo
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((overloadable))remquo(float b, float c, int *d);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * todo
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((overloadable))remquo(float2 b, float2 c, int2 *d);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * todo
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((overloadable))remquo(float3 b, float3 c, int3 *d);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * todo
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((overloadable))remquo(float4 b, float4 c, int4 *d);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))rint(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))rint(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))rint(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))rint(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the Nth root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))rootn(float v, int n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the Nth root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))rootn(float2 v, int2 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the Nth root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))rootn(float3 v, int3 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Compute the Nth root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))rootn(float4 v, int4 n);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.  Half values are rounded away from zero.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))round(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.  Half values are rounded away from zero.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))round(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.  Half values are rounded away from zero.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))round(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Round to the nearest integral value.  Half values are rounded away from zero.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))round(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return (1 / sqrt(value)).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))rsqrt(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return (1 / sqrt(value)).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))rsqrt(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return (1 / sqrt(value)).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))rsqrt(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return (1 / sqrt(value)).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))rsqrt(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sign of a value.
+ *
+ * if (v < 0) return -1.f;
+ * else if (v > 0) return 1.f;
+ * else return 0.f;
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))sign(float v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sign of a value.
+ *
+ * if (v < 0) return -1.f;
+ * else if (v > 0) return 1.f;
+ * else return 0.f;
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))sign(float2 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sign of a value.
+ *
+ * if (v < 0) return -1.f;
+ * else if (v > 0) return 1.f;
+ * else return 0.f;
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))sign(float3 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sign of a value.
+ *
+ * if (v < 0) return -1.f;
+ * else if (v > 0) return 1.f;
+ * else return 0.f;
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))sign(float4 v);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))sin(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))sin(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))sin(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))sin(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine and cosine of a value.
+ *
+ * @return sine
+ * @param v The incoming value in radians
+ * @param *cosptr cosptr[0] will be set to the cosine value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((overloadable))sincos(float v, float *cosptr);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine and cosine of a value.
+ *
+ * @return sine
+ * @param v The incoming value in radians
+ * @param *cosptr cosptr[0] will be set to the cosine value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((overloadable))sincos(float2 v, float2 *cosptr);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine and cosine of a value.
+ *
+ * @return sine
+ * @param v The incoming value in radians
+ * @param *cosptr cosptr[0] will be set to the cosine value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((overloadable))sincos(float3 v, float3 *cosptr);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sine and cosine of a value.
+ *
+ * @return sine
+ * @param v The incoming value in radians
+ * @param *cosptr cosptr[0] will be set to the cosine value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((overloadable))sincos(float4 v, float4 *cosptr);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the hyperbolic sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))sinh(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the hyperbolic sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))sinh(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the hyperbolic sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))sinh(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the hyperbolic sine of a value specified in radians.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))sinh(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sin(v * PI).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))sinpi(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sin(v * PI).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))sinpi(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sin(v * PI).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))sinpi(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the sin(v * PI).
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))sinpi(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the square root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float __attribute__((const, overloadable))sqrt(float);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the square root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float2 __attribute__((const, overloadable))sqrt(float2);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the square root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float3 __attribute__((const, overloadable))sqrt(float3);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
+ * Return the square root of a value.
+ *
+ * Supported by API versions 9 and newer.
+ */
+extern float4 __attribute__((const, overloadable))sqrt(float4);
+#endif
+
+#if (defined(RS_VERSION) && (RS_VERSION >= 9))
+/*
  * if (v < edge)
  * return 0.f;
  * else
@@ -7951,708 +8479,182 @@
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the sign of a value.
- *
- * if (v < 0) return -1.f;
- * else if (v > 0) return 1.f;
- * else return 0.f;
+ * Return the tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))sign(float v);
+extern float __attribute__((const, overloadable))tan(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the sign of a value.
- *
- * if (v < 0) return -1.f;
- * else if (v > 0) return 1.f;
- * else return 0.f;
+ * Return the tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))sign(float2 v);
+extern float2 __attribute__((const, overloadable))tan(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the sign of a value.
- *
- * if (v < 0) return -1.f;
- * else if (v > 0) return 1.f;
- * else return 0.f;
+ * Return the tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))sign(float3 v);
+extern float3 __attribute__((const, overloadable))tan(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Return the sign of a value.
- *
- * if (v < 0) return -1.f;
- * else if (v > 0) return 1.f;
- * else return 0.f;
+ * Return the tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))sign(float4 v);
+extern float4 __attribute__((const, overloadable))tan(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the cross product of two vectors.
+ * Return the hyperbolic tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float3 __attribute__((const, overloadable))cross(float3 lhs, float3 rhs);
+extern float __attribute__((const, overloadable))tanh(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the cross product of two vectors.
+ * Return the hyperbolic tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float4 __attribute__((const, overloadable))cross(float4 lhs, float4 rhs);
+extern float2 __attribute__((const, overloadable))tanh(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the dot product of two vectors.
+ * Return the hyperbolic tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))dot(float lhs, float rhs);
+extern float3 __attribute__((const, overloadable))tanh(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the dot product of two vectors.
+ * Return the hyperbolic tangent of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))dot(float2 lhs, float2 rhs);
+extern float4 __attribute__((const, overloadable))tanh(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the dot product of two vectors.
+ * Return tan(v * PI)
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))dot(float3 lhs, float3 rhs);
+extern float __attribute__((const, overloadable))tanpi(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the dot product of two vectors.
+ * Return tan(v * PI)
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))dot(float4 lhs, float4 rhs);
+extern float2 __attribute__((const, overloadable))tanpi(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the length of a vector.
+ * Return tan(v * PI)
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))length(float v);
+extern float3 __attribute__((const, overloadable))tanpi(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the length of a vector.
+ * Return tan(v * PI)
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))length(float2 v);
+extern float4 __attribute__((const, overloadable))tanpi(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the length of a vector.
+ * Compute the gamma function of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))length(float3 v);
+extern float __attribute__((const, overloadable))tgamma(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the length of a vector.
+ * Compute the gamma function of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))length(float4 v);
+extern float2 __attribute__((const, overloadable))tgamma(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the distance between two points.
+ * Compute the gamma function of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))distance(float lhs, float rhs);
+extern float3 __attribute__((const, overloadable))tgamma(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the distance between two points.
+ * Compute the gamma function of a value.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))distance(float2 lhs, float2 rhs);
+extern float4 __attribute__((const, overloadable))tgamma(float4);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the distance between two points.
+ * ound to integral using truncation.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))distance(float3 lhs, float3 rhs);
+extern float __attribute__((const, overloadable))trunc(float);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Compute the distance between two points.
+ * ound to integral using truncation.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))distance(float4 lhs, float4 rhs);
+extern float2 __attribute__((const, overloadable))trunc(float2);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Normalize a vector.
+ * ound to integral using truncation.
  *
  * Supported by API versions 9 and newer.
  */
-extern float __attribute__((const, overloadable))normalize(float v);
+extern float3 __attribute__((const, overloadable))trunc(float3);
 #endif
 
 #if (defined(RS_VERSION) && (RS_VERSION >= 9))
 /*
- * Normalize a vector.
+ * ound to integral using truncation.
  *
  * Supported by API versions 9 and newer.
  */
-extern float2 __attribute__((const, overloadable))normalize(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Normalize a vector.
- *
- * Supported by API versions 9 and newer.
- */
-extern float3 __attribute__((const, overloadable))normalize(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 9))
-/*
- * Normalize a vector.
- *
- * Supported by API versions 9 and newer.
- */
-extern float4 __attribute__((const, overloadable))normalize(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate reciprocal of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))half_recip(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate reciprocal of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float2 __attribute__((const, overloadable))half_recip(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate reciprocal of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float3 __attribute__((const, overloadable))half_recip(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate reciprocal of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float4 __attribute__((const, overloadable))half_recip(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate square root of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))half_sqrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate square root of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float2 __attribute__((const, overloadable))half_sqrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate square root of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float3 __attribute__((const, overloadable))half_sqrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate square root of a value.
- *
- * Supported by API versions 17 and newer.
- */
-extern float4 __attribute__((const, overloadable))half_sqrt(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate value of (1.f / sqrt(value)).
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))half_rsqrt(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate value of (1.f / sqrt(value)).
- *
- * Supported by API versions 17 and newer.
- */
-extern float2 __attribute__((const, overloadable))half_rsqrt(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate value of (1.f / sqrt(value)).
- *
- * Supported by API versions 17 and newer.
- */
-extern float3 __attribute__((const, overloadable))half_rsqrt(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Return the approximate value of (1.f / sqrt(value)).
- *
- * Supported by API versions 17 and newer.
- */
-extern float4 __attribute__((const, overloadable))half_rsqrt(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate length of a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_length(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate length of a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_length(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate length of a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_length(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate length of a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_length(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate distance between two points.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_distance(float lhs, float rhs);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate distance between two points.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_distance(float2 lhs, float2 rhs);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate distance between two points.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_distance(float3 lhs, float3 rhs);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Compute the approximate distance between two points.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_distance(float4 lhs, float4 rhs);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Approximately normalize a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float __attribute__((const, overloadable))fast_normalize(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Approximately normalize a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float2 __attribute__((const, overloadable))fast_normalize(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Approximately normalize a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float3 __attribute__((const, overloadable))fast_normalize(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 17))
-/*
- * Approximately normalize a vector.
- *
- * Supported by API versions 17 and newer.
- */
-extern float4 __attribute__((const, overloadable))fast_normalize(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp
- * valid for inputs -86.f to 86.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_exp(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp
- * valid for inputs -86.f to 86.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_exp(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp
- * valid for inputs -86.f to 86.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_exp(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp
- * valid for inputs -86.f to 86.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_exp(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp2
- * valid for inputs -125.f to 125.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_exp2(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp2
- * valid for inputs -125.f to 125.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_exp2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp2
- * valid for inputs -125.f to 125.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_exp2(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp2
- * valid for inputs -125.f to 125.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_exp2(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp10
- * valid for inputs -37.f to 37.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_exp10(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp10
- * valid for inputs -37.f to 37.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_exp10(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp10
- * valid for inputs -37.f to 37.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_exp10(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate exp10
- * valid for inputs -37.f to 37.f
- * Max 8192 ulps of error
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_exp10(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_log(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_log(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_log(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_log(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log2
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_log2(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log2
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_log2(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log2
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_log2(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log2
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_log2(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log10
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_log10(float v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log10
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_log10(float2 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log10
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_log10(float3 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate log10
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_log10(float4 v);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate v ^ y
- *
- * Supported by API versions 18 and newer.
- */
-extern float __attribute__((const, overloadable))native_powr(float v, float y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate v ^ y
- *
- * Supported by API versions 18 and newer.
- */
-extern float2 __attribute__((const, overloadable))native_powr(float2 v, float2 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate v ^ y
- *
- * Supported by API versions 18 and newer.
- */
-extern float3 __attribute__((const, overloadable))native_powr(float3 v, float3 y);
-#endif
-
-#if (defined(RS_VERSION) && (RS_VERSION >= 18))
-/*
- * Fast approximate v ^ y
- *
- * Supported by API versions 18 and newer.
- */
-extern float4 __attribute__((const, overloadable))native_powr(float4 v, float4 y);
+extern float4 __attribute__((const, overloadable))trunc(float4);
 #endif
 
 #endif // __rs_core_math_rsh__
diff --git a/renderscript/include/rs_dct.rsh b/renderscript/include/rs_dct.rsh
new file mode 100644
index 0000000..d7289dd
--- /dev/null
+++ b/renderscript/include/rs_dct.rsh
@@ -0,0 +1,14 @@
+#ifndef __RS_DCT_RSH__
+#define __RS_DCT_RSH__
+
+#if RS_VERSION > 19
+
+extern void rsDct4x4(rs_allocation input, rs_allocation output, int xoff, int yoff);
+extern void rsDct8x8(rs_allocation input, rs_allocation output, int xoff, int yoff);
+extern void rsDct16x16(rs_allocation input, rs_allocation output, int xoff, int yoff);
+extern void rsDct32x32(rs_allocation input, rs_allocation out, int xoff, int yoff);
+extern void rsDct32x32_rd(rs_allocation input, rs_allocation out,  int xoff, int yoff);
+
+#endif
+
+#endif
diff --git a/renderscript/include/rs_fadst.rsh b/renderscript/include/rs_fadst.rsh
new file mode 100644
index 0000000..1dfe58f
--- /dev/null
+++ b/renderscript/include/rs_fadst.rsh
@@ -0,0 +1,14 @@
+#ifndef __RS_FADST_RSH__
+#define __RS_FADST_RSH__
+
+#if RS_VERSION > 19
+
+extern void rsFadst4(const rs_allocation input, rs_allocation output, int32_t xoff);
+
+extern void rsFadst8(const rs_allocation input, rs_allocation output, int32_t xoff);
+
+extern void rsFadst16(const rs_allocation input, rs_allocation output, int32_t xoff);
+
+#endif
+
+#endif
\ No newline at end of file
diff --git a/renderscript/include/rs_iadst.rsh b/renderscript/include/rs_iadst.rsh
new file mode 100644
index 0000000..3208814
--- /dev/null
+++ b/renderscript/include/rs_iadst.rsh
@@ -0,0 +1,14 @@
+#ifndef __RS_IADST_RSH__
+#define __RS_IADST_RSH__
+
+#if RS_VERSION > 19
+
+extern void rsIadst4(const rs_allocation input, rs_allocation output, int32_t xoff);
+
+extern void rsIadst8(const rs_allocation input, rs_allocation output, int32_t xoff);
+
+extern void rsIadst16(const rs_allocation input, rs_allocation output, int32_t xoff);
+
+#endif
+
+#endif
\ No newline at end of file
diff --git a/renderscript/include/rs_idct.rsh b/renderscript/include/rs_idct.rsh
new file mode 100644
index 0000000..d602e34
--- /dev/null
+++ b/renderscript/include/rs_idct.rsh
@@ -0,0 +1,13 @@
+#ifndef __RS_IDCT_RSH__
+#define __RS_IDCT_RSH__
+
+#if RS_VERSION > 19
+
+extern void rsIdct4x4(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
+extern void rsIdct8x8(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
+extern void rsIdct16x16(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
+extern void rsIdct32x32(const rs_allocation input, rs_allocation dest, int eob, int xoff, int yoff);
+
+#endif
+
+#endif
diff --git a/renderscript/include/rs_vp9.rsh b/renderscript/include/rs_vp9.rsh
new file mode 100644
index 0000000..52fbe81
--- /dev/null
+++ b/renderscript/include/rs_vp9.rsh
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __RS_VP9_RSH__
+#define __RS_VP9_RSH__
+
+
+#include "rs_idct.rsh"
+#include "rs_dct.rsh"
+#include "rs_iadst.rsh"
+#include "rs_fadst.rsh"
+#include "rs_walsh.rsh"
+
+#endif
+
diff --git a/renderscript/include/rs_walsh.rsh b/renderscript/include/rs_walsh.rsh
new file mode 100644
index 0000000..6f7445d
--- /dev/null
+++ b/renderscript/include/rs_walsh.rsh
@@ -0,0 +1,11 @@
+#ifndef __RS_WALSH_RSH__
+#define __RS_WALSH_RSH__
+
+#if RS_VERSION > 19
+
+extern void rsWalsh4x4(rs_allocation input, rs_allocation dest, int xoff, int yoff);
+extern void rsWalsh4x4_1(rs_allocation input, rs_allocation dest, int xoff, int yoff);
+
+#endif
+
+#endif
diff --git a/renderscript/lib/arm/libRSSupport.so b/renderscript/lib/arm/libRSSupport.so
index 7e7bf9f..787cd2f 100755
--- a/renderscript/lib/arm/libRSSupport.so
+++ b/renderscript/lib/arm/libRSSupport.so
Binary files differ
diff --git a/renderscript/lib/arm/libc.so b/renderscript/lib/arm/libc.so
index 46d46c3..20c5a4a 100755
--- a/renderscript/lib/arm/libc.so
+++ b/renderscript/lib/arm/libc.so
Binary files differ
diff --git a/renderscript/lib/arm/libclcore.bc b/renderscript/lib/arm/libclcore.bc
index 6a02cec..7ac2f3f 100644
--- a/renderscript/lib/arm/libclcore.bc
+++ b/renderscript/lib/arm/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/arm/libm.so b/renderscript/lib/arm/libm.so
index 0b9b87a..91e5c14 100755
--- a/renderscript/lib/arm/libm.so
+++ b/renderscript/lib/arm/libm.so
Binary files differ
diff --git a/renderscript/lib/arm/librsjni.so b/renderscript/lib/arm/librsjni.so
index 96c4d96..e3cbd86 100755
--- a/renderscript/lib/arm/librsjni.so
+++ b/renderscript/lib/arm/librsjni.so
Binary files differ
diff --git a/renderscript/lib/arm/librsrt_arm.bc b/renderscript/lib/arm/librsrt_arm.bc
index 6a02cec..7ac2f3f 100644
--- a/renderscript/lib/arm/librsrt_arm.bc
+++ b/renderscript/lib/arm/librsrt_arm.bc
Binary files differ
diff --git a/renderscript/lib/javalib.jar b/renderscript/lib/javalib.jar
index 8983735..c8b1446 100644
--- a/renderscript/lib/javalib.jar
+++ b/renderscript/lib/javalib.jar
Binary files differ
diff --git a/renderscript/lib/mips/libRSSupport.so b/renderscript/lib/mips/libRSSupport.so
index bb0969f..2427107 100755
--- a/renderscript/lib/mips/libRSSupport.so
+++ b/renderscript/lib/mips/libRSSupport.so
Binary files differ
diff --git a/renderscript/lib/mips/libc.so b/renderscript/lib/mips/libc.so
index f8d4a8e..70238f6 100755
--- a/renderscript/lib/mips/libc.so
+++ b/renderscript/lib/mips/libc.so
Binary files differ
diff --git a/renderscript/lib/mips/libclcore.bc b/renderscript/lib/mips/libclcore.bc
index d41677b..7e3c61f 100644
--- a/renderscript/lib/mips/libclcore.bc
+++ b/renderscript/lib/mips/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/mips/libm.so b/renderscript/lib/mips/libm.so
index aab0670..1f5f29b 100755
--- a/renderscript/lib/mips/libm.so
+++ b/renderscript/lib/mips/libm.so
Binary files differ
diff --git a/renderscript/lib/mips/librsjni.so b/renderscript/lib/mips/librsjni.so
index 4ed0bbd..c007072 100755
--- a/renderscript/lib/mips/librsjni.so
+++ b/renderscript/lib/mips/librsjni.so
Binary files differ
diff --git a/renderscript/lib/mips/librsrt_mips.bc b/renderscript/lib/mips/librsrt_mips.bc
index d41677b..7e3c61f 100644
--- a/renderscript/lib/mips/librsrt_mips.bc
+++ b/renderscript/lib/mips/librsrt_mips.bc
Binary files differ
diff --git a/renderscript/lib/x86/libRSSupport.so b/renderscript/lib/x86/libRSSupport.so
index 32b456f..cf868a7 100755
--- a/renderscript/lib/x86/libRSSupport.so
+++ b/renderscript/lib/x86/libRSSupport.so
Binary files differ
diff --git a/renderscript/lib/x86/libc.so b/renderscript/lib/x86/libc.so
index 6f6abe0..051cd3b 100755
--- a/renderscript/lib/x86/libc.so
+++ b/renderscript/lib/x86/libc.so
Binary files differ
diff --git a/renderscript/lib/x86/libclcore.bc b/renderscript/lib/x86/libclcore.bc
index a40a671..a2ecd96 100644
--- a/renderscript/lib/x86/libclcore.bc
+++ b/renderscript/lib/x86/libclcore.bc
Binary files differ
diff --git a/renderscript/lib/x86/libm.so b/renderscript/lib/x86/libm.so
index db8ac1e..7e1714f 100755
--- a/renderscript/lib/x86/libm.so
+++ b/renderscript/lib/x86/libm.so
Binary files differ
diff --git a/renderscript/lib/x86/librsjni.so b/renderscript/lib/x86/librsjni.so
index 2777b36..aaf9b0d 100755
--- a/renderscript/lib/x86/librsjni.so
+++ b/renderscript/lib/x86/librsjni.so
Binary files differ
diff --git a/renderscript/lib/x86/librsrt_x86.bc b/renderscript/lib/x86/librsrt_x86.bc
index 5d089c0..2791542 100644
--- a/renderscript/lib/x86/librsrt_x86.bc
+++ b/renderscript/lib/x86/librsrt_x86.bc
Binary files differ
diff --git a/tools/linux/libLLVM.so b/tools/linux/libLLVM.so
index 0b7c8ec..4eab4cb 100755
--- a/tools/linux/libLLVM.so
+++ b/tools/linux/libLLVM.so
Binary files differ
diff --git a/tools/linux/libbcc.so b/tools/linux/libbcc.so
index bd624a9..362208d 100755
--- a/tools/linux/libbcc.so
+++ b/tools/linux/libbcc.so
Binary files differ
diff --git a/tools/linux/llvm-rs-cc b/tools/linux/llvm-rs-cc
index c1deb85..9feb8c0 100755
--- a/tools/linux/llvm-rs-cc
+++ b/tools/linux/llvm-rs-cc
Binary files differ