From 17991fe6a6e0abfe7856763643f6d2db0e8dd403 Mon Sep 17 00:00:00 2001 From: Greg Lueck Date: Thu, 23 May 2024 10:51:33 -0400 Subject: [PATCH] Reflow The reflow script doesn't check text within tables. Now that we have removed the tables in the sections describing the builtin functions, rerun reflow. --- adoc/chapters/programming_interface.adoc | 1038 +++++++++++----------- 1 file changed, 530 insertions(+), 508 deletions(-) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index 10985e1d..0436f4fb 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -20949,8 +20949,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x#, the value -[code]#acos(x[i]) / {pi}#. +_Returns:_ For each element of [code]#x#, the value [code]#acos(x[i]) / {pi}#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21288,8 +21287,8 @@ template (4) *Overloads (1) - (3):* -_Returns:_ The value of [code]#x# with its sign changed to match -the sign of [code]#y#. +_Returns:_ The value of [code]#x# with its sign changed to match the sign of +[code]#y#. *Overload (4):* @@ -21366,8 +21365,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x#, the hyperbolic cosine of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the hyperbolic cosine of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21648,8 +21646,8 @@ _Constraints:_ Available only if all of the following conditions are met: * The element type of [code]#NonScalar1# and [code]#NonScalar2# is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x# and [code]#y#, the value -[code]#x[i] - y[i]# if [code]#x[i] > y[i]#, otherwise +0. +_Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] - +y[i]# if [code]#x[i] > y[i]#, otherwise +0. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21703,8 +21701,8 @@ template (4) _Returns:_ The correctly rounded floating-point representation of the sum of [code]#c# with the infinitely precise product of [code]#a# and [code]#b#. -Rounding of intermediate products shall not occur. Edge case behavior is per -the IEEE 754-2008 standard. +Rounding of intermediate products shall not occur. +Edge case behavior is per the IEEE 754-2008 standard. *Overload (4):* @@ -21723,11 +21721,11 @@ _Constraints:_ Available only if all of the following conditions are met: * The element type of [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#a#, [code]#b#, and [ode]#c#; the -correctly rounded floating-point representation of the sum of [code]#c[i]# with -the infinitely precise product of [code]#a[i]# and [code]#b[i]#. Rounding of -intermediate products shall not occur. Edge case behavior is per the IEEE -754-2008 standard. +_Returns:_ For each element of [code]#a#, [code]#b#, and [ode]#c#; the correctly +rounded floating-point representation of the sum of [code]#c[i]# with the +infinitely precise product of [code]#a[i]# and [code]#b[i]#. +Rounding of intermediate products shall not occur. +Edge case behavior is per the IEEE 754-2008 standard. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21750,8 +21748,9 @@ template (5) *Overloads (1) - (3):* -_Returns:_ [code]#y# if [code]#x < y#, otherwise [code]#x#. If one argument is -a NaN, returns the other argument. If both arguments are NaNs, returns a NaN. +_Returns:_ [code]#y# if [code]#x < y#, otherwise [code]#x#. +If one argument is a NaN, returns the other argument. +If both arguments are NaNs, returns a NaN. *Overload (4):* @@ -21768,8 +21767,9 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#y[i]# -if [code]#x[i] < y[i]#, otherwise [code]#x[i]#. If one element is a NaN, the -result is the other element. If both elements are NaNs, the result is NaN. +if [code]#x[i] < y[i]#, otherwise [code]#x[i]#. +If one element is a NaN, the result is the other element. +If both elements are NaNs, the result is NaN. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21783,9 +21783,10 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x#, the value [code]#y# if -[code]#x[i] < y#, otherwise [code]#x[i]#. If one value is a NaN, the result is -the other value. If both value are NaNs, the result is a NaN. +_Returns:_ For each element of [code]#x#, the value [code]#y# if [code]#x[i] < +y#, otherwise [code]#x[i]#. +If one value is a NaN, the result is the other value. +If both value are NaNs, the result is a NaN. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21808,8 +21809,9 @@ template (5) *Overloads (1) - (3):* -_Returns:_ [code]#y# if [code]#y < x#, otherwise [code]#x#. If one argument is -a NaN, returns the other argument. If both arguments are NaNs, returns a NaN. +_Returns:_ [code]#y# if [code]#y < x#, otherwise [code]#x#. +If one argument is a NaN, returns the other argument. +If both arguments are NaNs, returns a NaN. *Overload (4):* @@ -21826,8 +21828,9 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#y[i]# -if [code]#y[i] < x[i]#, otherwise [code]#x[i]#. If one element is a NaN, the -result is the other element. If both elements are NaNs, the result is NaN. +if [code]#y[i] < x[i]#, otherwise [code]#x[i]#. +If one element is a NaN, the result is the other element. +If both elements are NaNs, the result is NaN. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21841,9 +21844,10 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x#, the value [code]#y# if -[code]#y < x[i]#, otherwise [code]#x[i]#. If one value is a NaN, the result is -the other value. If both value are NaNs, the result is a NaN. +_Returns:_ For each element of [code]#x#, the value [code]#y# if [code]#y < +x[i]#, otherwise [code]#x[i]#. +If one value is a NaN, the result is the other value. +If both value are NaNs, the result is a NaN. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21879,8 +21883,8 @@ _Constraints:_ Available only if all of the following conditions are met: * The element type of [code]#NonScalar1# and [code]#NonScalar2# is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x# and [code]#y#, the value -[code]#x[i] - y[i] * trunc(x[i]/y[i])#. +_Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] - +y[i] * trunc(x[i]/y[i])#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21923,16 +21927,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#double#, or [code]#half#; * [code]#Ptr# is [code]#multi_ptr# with [code]#ElementType# equal to [code]#NonScalar#, unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# - type, in which case the [code]#ElementType# is the corresponding - [code]#vec#; and + type, in which case the [code]#ElementType# is the corresponding [code]#vec#; + and * [code]#Ptr# is [code]#multi_ptr# with [code]#Space# equal to one of the _writeable address spaces_ as defined above. _Effects:_ Writes the value [code]#floor(x)# to [code]#iptr#. -_Returns:_ For each element of [code]#x#, the value -[code]#fmin(x[i] - floor(x[i]), nextafter(T{1.0}, T{0.0}) )#, where -[code]#T# is the element type of [code]#x#. +_Returns:_ For each element of [code]#x#, the value [code]#fmin(x[i] - +floor(x[i]), nextafter(T{1.0}, T{0.0}) )#, where [code]#T# is the element type +of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -21961,10 +21965,12 @@ _Constraints:_ Available only if [code]#Ptr# is [code]#multi_ptr# with [code]#ElementType# of [code]#int# and with [code]#Space# equal to one of the _writeable address spaces_ as defined above. -_Effects:_ Extracts the mantissa and exponent from [code]#x#. The mantissa is -a floating point number whose magnitude is in the interval +[0.5, 1)+ or 0. The -extracted mantissa and exponent are such that mantissa * 2^exp^ equals -[code]#x#. The exponent is written to [code]#exp#. +_Effects:_ Extracts the mantissa and exponent from [code]#x#. +The mantissa is a floating point number whose magnitude is in the interval ++[0.5, 1)+ or 0. +The extracted mantissa and exponent are such that mantissa * 2^exp^ equals +[code]#x#. +The exponent is written to [code]#exp#. _Returns:_ The mantissa of [code]#x#. @@ -21976,20 +21982,20 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is [code]#multi_ptr# with the following [code]#ElementType#: -** If [code]#NonScalar# is [code]#marray#, [code]#ElementType# is - [code]#marray# of [code]#int# with the same number of elements as - [code]#NonScalar#; +** If [code]#NonScalar# is [code]#marray#, [code]#ElementType# is [code]#marray# + of [code]#int# with the same number of elements as [code]#NonScalar#; ** If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number - of elements as [code]#NonScalar#; + [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number of + elements as [code]#NonScalar#; * [code]#Ptr# is [code]#multi_ptr# with [code]#Space# equal to one of the _writeable address spaces_ as defined above. _Effects:_ Extracts the mantissa and exponent from each element of [code]#x#. Each mantissa is a floating point number whose magnitude is in the interval -+[0.5, 1)+ or 0. Each extracted mantissa and exponent are such that -mantissa * 2^exp^ equals [code]#x[i]#. The exponent of each element of -[code]#x# is written to [code]#exp#. ++[0.5, 1)+ or 0. +Each extracted mantissa and exponent are such that mantissa * 2^exp^ equals +[code]#x[i]#. +The exponent of each element of [code]#x# is written to [code]#exp#. _Returns:_ For each element of [code]#x#, the mantissa of [code]#x[i]#. @@ -22011,8 +22017,8 @@ template (4) *Overloads (1) - (3):* -_Returns:_ The value of the square root of x^2^ + y^2^ without undue overflow -or underflow. +_Returns:_ The value of the square root of x^2^ + y^2^ without undue overflow or +underflow. *Overload (4):* @@ -22065,11 +22071,12 @@ _Returns:_ For each element of [code]#x#, compute the integral part of log~r~|x[i]| and return the result as an integer, where r is the value returned by [code]#std::numeric_limits::radix#. -The return type depends on [code]#NonScalar#. If [code]#NonScalar# is -[code]#marray#, the return type is [code]#marray# of [code]#int# with the same -number of element as [code]#NonScalar#. If [code]#NonScalar# is [code]#vec# or -the [code]#+__swizzled_vec__+# type, the return type is [code]#vec# of -[code]#int32_t# with the same number of elements as [code]#NonScalar#. +The return type depends on [code]#NonScalar#. +If [code]#NonScalar# is [code]#marray#, the return type is [code]#marray# of +[code]#int# with the same number of element as [code]#NonScalar#. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, the +return type is [code]#vec# of [code]#int32_t# with the same number of elements +as [code]#NonScalar#. ''' @@ -22104,8 +22111,8 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#NonScalar2# is [code]#vec# or the [code]#+__swizzled_vec__+# type of [code]#int32_t# with the same number of elements as [code]#NonScalar1#. -_Returns:_ For each element of [code]#x# and [code]#k#, the value -[code]#x[i]# multiplied by 2^k[i]^. +_Returns:_ For each element of [code]#x# and [code]#k#, the value [code]#x[i]# +multiplied by 2^k[i]^. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22195,12 +22202,11 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type with element type [code]#float#, [code]#double#, or [code]#half#; * [code]#Ptr# is [code]#multi_ptr# with the following [code]#ElementType#: -** If [code]#NonScalar# is [code]#marray#, [code]#ElementType# is - [code]#marray# of [code]#int# with the same number of elements as - [code]#NonScalar#; +** If [code]#NonScalar# is [code]#marray#, [code]#ElementType# is [code]#marray# + of [code]#int# with the same number of elements as [code]#NonScalar#; ** If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number - of elements as [code]#NonScalar#; + [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number of + elements as [code]#NonScalar#; * [code]#Ptr# is [code]#multi_ptr# with [code]#Space# equal to one of the _writeable address spaces_ as defined above. @@ -22238,8 +22244,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x#, the natural logarithm of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the natural logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22299,8 +22304,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x#, the base 10 logarithm of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the base 10 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22383,10 +22387,11 @@ template (4) *Overloads (1) - (3):* -_Effects:_ Computes the approximate value of [code]#a * b + c#. Whether or how -the product of [code]#a * b# is rounded and how supernormal or subnormal -intermediate products are handled is not defined. The [code]#mad# function is -intended to be used where speed is preferred over accuracy. +_Effects:_ Computes the approximate value of [code]#a * b + c#. +Whether or how the product of [code]#a * b# is rounded and how supernormal or +subnormal intermediate products are handled is not defined. +The [code]#mad# function is intended to be used where speed is preferred over +accuracy. _Returns:_ The approximate value of [code]#a * b + c#. @@ -22407,8 +22412,8 @@ _Constraints:_ Available only if all of the following conditions are met: * The element type of [code]#NonScalar1#, [code]#NonScalar2#, and [code]#NonScalar3# is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#a#, [code]#b#, and [ode]#c#; the -The approximate value of [code]#a[i] * b[i] + c[i]#. +_Returns:_ For each element of [code]#a#, [code]#b#, and [ode]#c#; the The +approximate value of [code]#a[i] * b[i] + c[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22446,8 +22451,8 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i]# -if |x[i]| > |y[i]|, [code]#y[i]# if |y[i]| > |x[i]|, otherwise -[code]#fmax(x[i], y[i])#. +if |x[i]| > |y[i]|, [code]#y[i]# if |y[i]| > |x[i]|, otherwise [code]#fmax(x[i], +y[i])#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22485,8 +22490,8 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#float#, [code]#double#, or [code]#half#. _Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i]# -if |x[i]| < |y[i]|, [code]#y[i]# if |y[i]| < |x[i]|, otherwise -[code]#fmin(x[i], y[i])#. +if |x[i]| < |y[i]|, [code]#y[i]# if |y[i]| < |x[i]|, otherwise [code]#fmin(x[i], +y[i])#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22515,8 +22520,8 @@ _Constraints:_ Available only if [code]#Ptr# is [code]#multi_ptr# with [code]#ElementType# equal to the same type as [code]#x# and with [code]#Space# equal to one of the _writeable address spaces_ as defined above. -_Effects:_ The [code]#modf# function breaks the argument [code]#x# into -integral and fractional parts, each of which has the same sign as the argument. +_Effects:_ The [code]#modf# function breaks the argument [code]#x# into integral +and fractional parts, each of which has the same sign as the argument. It stores the integral part to the object pointed to by [code]#iptr#. _Returns:_ The fractional part of the argument [code]#x#. @@ -22530,15 +22535,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#double#, or [code]#half#; * [code]#Ptr# is [code]#multi_ptr# with [code]#ElementType# equal to [code]#NonScalar#, unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# - type, in which case the [code]#ElementType# is the corresponding - [code]#vec#; and + type, in which case the [code]#ElementType# is the corresponding [code]#vec#; + and * [code]#Ptr# is [code]#multi_ptr# with [code]#Space# equal to one of the _writeable address spaces_ as defined above. _Effects:_ The [code]#modf# function breaks each element of the argument -[code]#x# into integral and fractional parts, each of which has the same sign -as the element. It stores the integral parts of each element to the object -pointed to by [code]#iptr#. +[code]#x# into integral and fractional parts, each of which has the same sign as +the element. +It stores the integral parts of each element to the object pointed to by +[code]#iptr#. _Returns:_ The fractional parts of each element of the argument [code]#x#. @@ -22560,8 +22566,8 @@ template (4) *Overloads (1) - (3):* -_Returns:_ A quiet NaN. The [code]#nancode# may be placed -in the significand of the resulting NaN. +_Returns:_ A quiet NaN. +The [code]#nancode# may be placed in the significand of the resulting NaN. *Overload (4):* @@ -22571,8 +22577,8 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#uint32_t#, [code]#uint64_t#, or [code]#uint16_t#. -_Returns:_ A quiet NaN for each element of [code]#nancode#. Each -[code]#nancode[i]# may be placed in the significand of the resulting NaN. +_Returns:_ A quiet NaN for each element of [code]#nancode#. +Each [code]#nancode[i]# may be placed in the significand of the resulting NaN. The return type depends on [code]#NonScalar#: @@ -22611,9 +22617,9 @@ template (4) *Overloads (1) - (3):* _Returns:_ The next representable floating-point value following [code]#x# in -the direction of [code]#y#. Thus, if [code]#y# is less than [code]#x#, -[code]#nextafter# returns the largest representable floating-point number less -than [code]#x#. +the direction of [code]#y#. +Thus, if [code]#y# is less than [code]#x#, [code]#nextafter# returns the largest +representable floating-point number less than [code]#x#. *Overload (4):* @@ -22629,9 +22635,8 @@ _Constraints:_ Available only if all of the following conditions are met: * The element type of [code]#NonScalar1# and [code]#NonScalar2# is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x# and [code]#y#, the -next representable floating-point value following [code]#x[i]# in the direction -of [code]#y[i]#. +_Returns:_ For each element of [code]#x# and [code]#y#, the next representable +floating-point value following [code]#x[i]# in the direction of [code]#y[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22767,10 +22772,11 @@ template (4) *Overloads (1) - (3):* -_Returns:_ The value [code]#r# such that [code]#r = x - n*y#, where [code]#n# -is the integer nearest the exact value of [code]#x/y#. If there are two -integers closest to [code]#x/y#, [code]#n# shall be the even one. If [code]#r# -is zero, it is given the same sign as [code]#x#. +_Returns:_ The value [code]#r# such that [code]#r = x - n*y#, where [code]#n# is +the integer nearest the exact value of [code]#x/y#. +If there are two integers closest to [code]#x/y#, [code]#n# shall be the even +one. +If [code]#r# is zero, it is given the same sign as [code]#x#. *Overload (4):* @@ -22786,11 +22792,12 @@ _Constraints:_ Available only if all of the following conditions are met: * The element type of [code]#NonScalar1# and [code]#NonScalar2# is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#r# -such that [code]#r = x[i] - n*y[i]#, where [code]#n# is the integer nearest the -exact value of [code]#x[i]/y[i]#. If there are two integers closest to -[code]#x[i]/y[i]#, [code]#n# shall be the even one. If [code]#r# is zero, it -is given the same sign as [code]#x[i]#. +_Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#r# such +that [code]#r = x[i] - n*y[i]#, where [code]#n# is the integer nearest the exact +value of [code]#x[i]/y[i]#. +If there are two integers closest to [code]#x[i]/y[i]#, [code]#n# shall be the +even one. +If [code]#r# is zero, it is given the same sign as [code]#x[i]#. The return type is [code]#NonScalar1# unless [code]#NonScalar1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -22820,13 +22827,14 @@ _Constraints:_ Available only if [code]#Ptr# is [code]#multi_ptr# with _writeable address spaces_ as defined above. _Effects:_ Computes the value [code]#r# such that [code]#r = x - k*y#, where -[code]#k# is the integer nearest the exact value of [code]#x/y#. If there are -two integers closest to [code]#x/y#, [code]#k# shall be the even one. If -[code]#r# is zero, it is given the same sign as [code]#x#. This is the same -value that is returned by the [code]#remainder# function. The [code]#remquo# -function also calculates the lower seven bits of the integral quotient -[code]#x/y# and gives that value the same sign as [code]#x/y#. It stores this -signed value to the object pointed to by [code]#quo#. +[code]#k# is the integer nearest the exact value of [code]#x/y#. +If there are two integers closest to [code]#x/y#, [code]#k# shall be the even +one. +If [code]#r# is zero, it is given the same sign as [code]#x#. +This is the same value that is returned by the [code]#remainder# function. +The [code]#remquo# function also calculates the lower seven bits of the integral +quotient [code]#x/y# and gives that value the same sign as [code]#x/y#. +It stores this signed value to the object pointed to by [code]#quo#. _Returns:_ The value [code]#r# defined above. @@ -22844,19 +22852,21 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#marray# of [code]#int# with the same number of elements as [code]#NonScalar1#; ** If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number - of elements as [code]#NonScalar1#; + [code]#ElementType# is [code]#vec# of [code]#int32_t# with the same number of + elements as [code]#NonScalar1#; * [code]#Ptr# is [code]#multi_ptr# with [code]#Space# equal to one of the _writeable address spaces_ as defined above. _Effects:_ Computes the value [code]#r# for each element of [code]#x# and [code]#y# such that [code]#r = x[i] - k*y[i]#, where [code]#k# is the integer -nearest the exact value of [code]#x[i]/y[i]#. If there are two integers -closest to [code]#x[i]/y[i]#, [code]#k# shall be the even one. If [code]#r# is -zero, it is given the same sign as [code]#x[i]#. This is the same value that -is returned by the [code]#remainder# function. The [code]#remquo# function -also calculates the lower seven bits of the integral quotient -[code]#x[i]/y[i]# and gives that value the same sign as [code]#x[i]/y[i]#. +nearest the exact value of [code]#x[i]/y[i]#. +If there are two integers closest to [code]#x[i]/y[i]#, [code]#k# shall be the +even one. +If [code]#r# is zero, it is given the same sign as [code]#x[i]#. +This is the same value that is returned by the [code]#remainder# function. +The [code]#remquo# function also calculates the lower seven bits of the integral +quotient [code]#x[i]/y[i]# and gives that value the same sign as +[code]#x[i]/y[i]#. It stores these signed values to the object pointed to by [code]#quo#. _Returns:_ The values of [code]#r# defined above. @@ -22880,9 +22890,9 @@ template (4) *Overloads (1) - (3):* _Returns:_ The value [code]#x# rounded to an integral value (using round to -nearest even rounding mode) in floating-point format. Refer to <> for a description of the -rounding modes. +nearest even rounding mode) in floating-point format. +Refer to <> for +a description of the rounding modes. *Overload (4):* @@ -23054,8 +23064,8 @@ _Constraints:_ Available only if [code]#Ptr# is [code]#multi_ptr# with [code]#ElementType# equal to the same type as [code]#x# and with [code]#Space# equal to one of the _writeable address spaces_ as defined above. -_Effects:_ Compute the sine and cosine of [code]#x#. The computed cosine is -written to [code]#cosval#. +_Effects:_ Compute the sine and cosine of [code]#x#. +The computed cosine is written to [code]#cosval#. _Returns:_ The sine of [code]#x#. @@ -23068,13 +23078,13 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#double#, or [code]#half#; * [code]#Ptr# is [code]#multi_ptr# with [code]#ElementType# equal to [code]#NonScalar#, unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# - type, in which case the [code]#ElementType# is the corresponding - [code]#vec#; and + type, in which case the [code]#ElementType# is the corresponding [code]#vec#; + and * [code]#Ptr# is [code]#multi_ptr# with [code]#Space# equal to one of the _writeable address spaces_ as defined above. -_Effects:_ Compute the sine and cosine of each element of [code]#x#. The -computed cosine values are written to [code]#cosval#. +_Effects:_ Compute the sine and cosine of each element of [code]#x#. +The computed cosine values are written to [code]#cosval#. _Returns:_ The sine of each element of [code]#x#. @@ -23389,8 +23399,8 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#. -_Returns:_ For each element of [code]#x# and [code]#y#, the value -[code]#x[i] / y[i]#. +_Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] / +y[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -23505,8 +23515,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#. -_Returns:_ For each element of [code]#x#, the natural logarithm of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the natural logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -23562,8 +23571,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#. -_Returns:_ For each element of [code]#x#, the base 10 logarithm of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the base 10 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -23812,8 +23820,8 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#. -_Returns:_ For each element of [code]#x# and [code]#y#, the value -[code]#x[i] / y[i]#. +_Returns:_ For each element of [code]#x# and [code]#y#, the value [code]#x[i] / +y[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -23928,8 +23936,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#. -_Returns:_ For each element of [code]#x#, the natural logarithm of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the natural logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -23985,8 +23992,7 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#. -_Returns:_ For each element of [code]#x#, the base 10 logarithm of -[code]#x[i]#. +_Returns:_ For each element of [code]#x#, the base 10 logarithm of [code]#x[i]#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24239,9 +24245,10 @@ template _Constraints:_ Available only if [code]#GenInt# is a _generic integer type_ as defined above. -_Returns:_ When the input is a scalar, returns |x|. Otherwise, returns |x[i]| -for each element of [code]#x#. The behavior is undefined if the result cannot -be represented by the return type. +_Returns:_ When the input is a scalar, returns |x|. +Otherwise, returns |x[i]| for each element of [code]#x#. +The behavior is undefined if the result cannot be represented by the return +type. The return type is [code]#GenInt# unless [code]#GenInt# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24260,15 +24267,16 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. -_Returns:_ When the inputs are scalars, returns |x - y|. Otherwise, returns -|x[i] - y[i]| for each element of [code]#x# and [code]#y#. The subtraction is -done without modulo overflow. The behavior is undefined if the result cannot -be represented by the return type. +_Returns:_ When the inputs are scalars, returns |x - y|. +Otherwise, returns |x[i] - y[i]| for each element of [code]#x# and [code]#y#. +The subtraction is done without modulo overflow. +The behavior is undefined if the result cannot be represented by the return +type. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24287,14 +24295,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. -_Returns:_ When the inputs are scalars, returns [code]#x + y#. Otherwise, -returns [code]#x[i] + y[i]# for each element of [code]#x# and [code]#y#. The -addition operation saturates the result. +_Returns:_ When the inputs are scalars, returns [code]#x + y#. +Otherwise, returns [code]#x[i] + y[i]# for each element of [code]#x# and +[code]#y#. +The addition operation saturates the result. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24313,14 +24322,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. _Returns:_ When the inputs are scalars, returns [code]#(x + y) >> 1#. Otherwise, returns [code]#(x[i] + y[i]) >> 1# for each element of [code]#x# and -[code]#y#. The intermediate sum does not modulo overflow. +[code]#y#. +The intermediate sum does not modulo overflow. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24339,14 +24349,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. _Returns:_ When the inputs are scalars, returns [code]#(x + y + 1) >> 1#. Otherwise, returns [code]#(x[i] + y[i] + 1) >> 1# for each element of [code]#x# -and [code]#y#. The intermediate sum does not modulo overflow. +and [code]#y#. +The intermediate sum does not modulo overflow. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24372,20 +24383,20 @@ _Constraints:_ Available only if all of the following conditions are met: * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. _Preconditions:_ If the inputs are scalars, the value of [code]#minval# must be -less than or equal to the value of [code]#maxval#. If the inputs are not -scalars, each [code]#minval# must be less than or equal to the corresponding -[code]#maxval# value. +less than or equal to the value of [code]#maxval#. +If the inputs are not scalars, each [code]#minval# must be less than or equal to +the corresponding [code]#maxval# value. -_Returns:_ When the inputs are scalars, returns -[code]#min(max(x, minval), maxval)#. Otherwise, returns -[code]#min(max(x[i], minval[i]), maxval[i])# for each element of [code]#x#, -[code]#minval#, and [code]#maxval#. +_Returns:_ When the inputs are scalars, returns [code]#min(max(x, minval), +maxval)#. +Otherwise, returns [code]#min(max(x[i], minval[i]), maxval[i])# for each element +of [code]#x#, [code]#minval#, and [code]#maxval#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24400,8 +24411,7 @@ type_ as defined above. _Preconditions:_ The value of [code]#minval# must be less than or equal to the value of [code]#maxval#. -_Returns:_ [code]#min(max(x[i], minval), maxval)# for each element of -[code]#x#. +_Returns:_ [code]#min(max(x[i], minval), maxval)# for each element of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24419,9 +24429,9 @@ _Constraints:_ Available only if [code]#GenInt# is a _generic integer type_ as defined above. _Returns:_ When the input is a scalar, returns the number of leading 0-bits in -[code]#x#, starting at the most significant bit position. Otherwise, returns -the number of leading 0-bits in each element of [code]#x#. When a value is 0, -the computed count is the size in bits of that value. +[code]#x#, starting at the most significant bit position. +Otherwise, returns the number of leading 0-bits in each element of [code]#x#. +When a value is 0, the computed count is the size in bits of that value. The return type is [code]#GenInt# unless [code]#GenInt# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24439,9 +24449,9 @@ _Constraints:_ Available only if [code]#GenInt# is a _generic integer type_ as defined above. _Returns:_ When the input is a scalar, returns the number of trailing 0-bits in -[code]#x#. Otherwise, returns the number of trailing 0-bits in each element of -[code]#x#. When a value is 0, the computed count is the size in bits of that -value. +[code]#x#. +Otherwise, returns the number of trailing 0-bits in each element of [code]#x#. +When a value is 0, the computed count is the size in bits of that value. The return type is [code]#GenInt# unless [code]#GenInt# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24461,10 +24471,10 @@ _Constraints:_ Available only if all of the following conditions are met: * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. _Returns:_ When the inputs are scalars, returns [code]#mul_hi(a, b)+c#. Otherwise, returns [code]#mul_hi(a[i], b[i])+c[i]# for each element of @@ -24488,14 +24498,15 @@ _Constraints:_ Available only if all of the following conditions are met: * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# and [code]#GenInt3# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# and [code]#GenInt3# must also be [code]#vec# or the + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. -_Returns:_ When the inputs are scalars, returns [code]#a * b + c#. Otherwise, -returns [code]#a[i] * b[i] + c[i]# for each element of [code]#a#, [code]#b#, -and [code]#c#. The operation saturates the result. +_Returns:_ When the inputs are scalars, returns [code]#a * b + c#. +Otherwise, returns [code]#a[i] * b[i] + c[i]# for each element of [code]#a#, +[code]#b#, and [code]#c#. +The operation saturates the result. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24519,15 +24530,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. _Returns:_ When the inputs are scalars, returns [code]#y# if [code]#x < y# -otherwise [code]#x#. When the inputs are not scalars, returns [code]#y[i]# if -[code]#x[i] < y[i]# otherwise [code]#x[i]# for each element of [code]#x# and -[code]#y#. +otherwise [code]#x#. +When the inputs are not scalars, returns [code]#y[i]# if [code]#x[i] < y[i]# +otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24539,8 +24550,8 @@ _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic integer type_ as defined above. -_Returns:_ [code]#y# if [code]#x[i] < y# otherwise [code]#x[i]# for each -element of [code]#x#. +_Returns:_ [code]#y# if [code]#x[i] < y# otherwise [code]#x[i]# for each element +of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24564,15 +24575,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. _Returns:_ When the inputs are scalars, returns [code]#y# if [code]#y < x# -otherwise [code]#x#. When the inputs are not scalars, returns [code]#y[i]# if -[code]#y[i] < x[i]# otherwise [code]#x[i]# for each element of [code]#x# and -[code]#y#. +otherwise [code]#x#. +When the inputs are not scalars, returns [code]#y[i]# if [code]#y[i] < x[i]# +otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24584,8 +24595,8 @@ _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic integer type_ as defined above. -_Returns:_ [code]#y# if [code]#y < x[i]# otherwise [code]#x[i]# for each -element of [code]#x#. +_Returns:_ [code]#y# if [code]#y < x[i]# otherwise [code]#x[i]# for each element +of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24604,17 +24615,18 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. _Effects:_ Computes [code]#x * y# and returns the high half of the product of [code]#x# and [code]#y#. _Returns:_ When the inputs are scalars, returns the high half of the product of -[code]#x * y#. Otherwise, returns the high half of the product of -[code]#x[i] * y[i]# for each element of [code]#x# and [code]#y#. +[code]#x * y#. +Otherwise, returns the high half of the product of [code]#x[i] * y[i]# for each +element of [code]#x# and [code]#y#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24633,21 +24645,22 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. _Effects:_ For each element in [code]#v#, the bits are shifted left by the number of bits given by the corresponding element in [code]#count# (subject to -usual shift modulo rules described in the OpenCL 1.2 specification -<>). Bits shifted off the left side of the element are -shifted back in from the right. +usual shift modulo rules described in the OpenCL 1.2 specification <>). +Bits shifted off the left side of the element are shifted back in from the +right. _Returns:_ When the inputs are scalars, the result of rotating [code]#v# by -[code]#count# as described above. Otherwise, the result of rotating -[code]#v[i]# by [code]#count[i]# for each element of [code]#v# and -[code]#count#. +[code]#count# as described above. +Otherwise, the result of rotating [code]#v[i]# by [code]#count[i]# for each +element of [code]#v# and [code]#count#. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24666,14 +24679,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GenInt1# is a _generic integer type_ as defined above; * If [code]#GenInt1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenInt2# must be the same as [code]#GenInt1#; and -* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, - then [code]#GenInt2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type and - the same number of elements. +* If [code]#GenInt1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then + [code]#GenInt2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements. -_Returns:_ When the inputs are scalars, returns [code]#x - y#. Otherwise, returns -[code]#x[i] - y[i]# for each element of [code]#x# and [code]#y#. The subtraction -operation saturates the result. +_Returns:_ When the inputs are scalars, returns [code]#x - y#. +Otherwise, returns [code]#x[i] - y[i]# for each element of [code]#x# and +[code]#y#. +The subtraction operation saturates the result. The return type is [code]#GenInt1# unless [code]#GenInt1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24696,16 +24710,16 @@ _Constraints:_ Available only if one of the following conditions is met: the [code]#+__swizzled_vec__+# type with element type [code]#uint8_t# and the same number of elements. -_Returns:_ When the inputs are scalars, returns -[code]#((uint16_t)hi << 8) | lo#. Otherwise, returns -[code]#((uint16_t)hi[i] << 8) | lo[i]# for each element of [code]#hi# and -[code]#lo#. +_Returns:_ When the inputs are scalars, returns [code]#((uint16_t)hi << 8) | +lo#. +Otherwise, returns [code]#((uint16_t)hi[i] << 8) | lo[i]# for each element of +[code]#hi# and [code]#lo#. -The return type is [code]#uint16_t# when the inputs are scalar. When the -inputs are [code]#marray#, the return type is [code]#marray# with element -type [code]#uint16_t# and the same number of elements as the inputs. -Otherwise, the return type is [code]#vec# with element type [code]#uint16_t# -and the same number of elements as the inputs. +The return type is [code]#uint16_t# when the inputs are scalar. +When the inputs are [code]#marray#, the return type is [code]#marray# with +element type [code]#uint16_t# and the same number of elements as the inputs. +Otherwise, the return type is [code]#vec# with element type [code]#uint16_t# and +the same number of elements as the inputs. ''' @@ -24719,23 +24733,22 @@ _Constraints:_ Available only if one of the following conditions is met: * [code]#Int8Bit# is [code]#int8_t# and [code]#UInt8Bit# is [code]#uint8_t#; * [code]#Int8Bit# is [code]#marray# with element type [code]#int8_t# and - [code]#UInt8Bit# is [code]#marray# with element type [code]#uint8_t# and - both have the same number of elements; or + [code]#UInt8Bit# is [code]#marray# with element type [code]#uint8_t# and both + have the same number of elements; or * [code]#Int8Bit# is [code]#vec# or the [code]#+__swizzled_vec__+# type with element type [code]#int8_t# and [code]#UInt8Bit# is [code]#vec# or the [code]#+__swizzled_vec__+# type with element type [code]#uint8_t# and both have the same number of elements. -_Returns:_ When the inputs are scalars, returns -[code]#((int16_t)hi << 8) | lo#. Otherwise, returns -[code]#((int16_t)hi[i] << 8) | lo[i]# for each element of [code]#hi# and -[code]#lo#. +_Returns:_ When the inputs are scalars, returns [code]#((int16_t)hi << 8) | lo#. +Otherwise, returns [code]#((int16_t)hi[i] << 8) | lo[i]# for each element of +[code]#hi# and [code]#lo#. -The return type is [code]#int16_t# when the inputs are scalar. When the -inputs are [code]#marray#, the return type is [code]#marray# with element -type [code]#int16_t# and the same number of elements as the inputs. -Otherwise, the return type is [code]#vec# with element type [code]#int16_t# -and the same number of elements as the inputs. +The return type is [code]#int16_t# when the inputs are scalar. +When the inputs are [code]#marray#, the return type is [code]#marray# with +element type [code]#int16_t# and the same number of elements as the inputs. +Otherwise, the return type is [code]#vec# with element type [code]#int16_t# and +the same number of elements as the inputs. ''' @@ -24748,22 +24761,22 @@ template _Constraints:_ Available only if one of the following conditions is met: * [code]#UInt16Bit1# and [code]#UInt16Bit2# are both [code]#uint16_t#; -* [code]#UInt16Bit1# and [code]#UInt16Bit2# are both [code]#marray# with - element type [code]#uint16_t# and the same number of elements; or +* [code]#UInt16Bit1# and [code]#UInt16Bit2# are both [code]#marray# with element + type [code]#uint16_t# and the same number of elements; or * [code]#UInt16Bit1# and [code]#UInt16Bit2# are any combination of [code]#vec# or the [code]#+__swizzled_vec__+# type with element type [code]#uint16_t# and the same number of elements. -_Returns:_ When the inputs are scalars, returns -[code]#((uint32_t)hi << 16) | lo#. Otherwise, returns -[code]#((uint32_t)hi[i] << 16) | lo[i]# for each element of [code]#hi# and -[code]#lo#. +_Returns:_ When the inputs are scalars, returns [code]#((uint32_t)hi << 16) | +lo#. +Otherwise, returns [code]#((uint32_t)hi[i] << 16) | lo[i]# for each element of +[code]#hi# and [code]#lo#. -The return type is [code]#uint32_t# when the inputs are scalar. When the -inputs are [code]#marray#, the return type is [code]#marray# with element -type [code]#uint32_t# and the same number of elements as the inputs. -Otherwise, the return type is [code]#vec# with element type [code]#uint32_t# -and the same number of elements as the inputs. +The return type is [code]#uint32_t# when the inputs are scalar. +When the inputs are [code]#marray#, the return type is [code]#marray# with +element type [code]#uint32_t# and the same number of elements as the inputs. +Otherwise, the return type is [code]#vec# with element type [code]#uint32_t# and +the same number of elements as the inputs. ''' @@ -24775,8 +24788,7 @@ template _Constraints:_ Available only if one of the following conditions is met: -* [code]#Int16Bit# is [code]#int16_t# and [code]#UInt16Bit# is - [code]#uint16_t#; +* [code]#Int16Bit# is [code]#int16_t# and [code]#UInt16Bit# is [code]#uint16_t#; * [code]#Int16Bit# is [code]#marray# with element type [code]#int16_t# and [code]#UInt16Bit# is [code]#marray# with element type [code]#uint16_t# and both have the same number of elements; or @@ -24785,16 +24797,16 @@ _Constraints:_ Available only if one of the following conditions is met: [code]#+__swizzled_vec__+# type with element type [code]#uint16_t# and both have the same number of elements. -_Returns:_ When the inputs are scalars, returns -[code]#((int32_t)hi << 16) | lo#. Otherwise, returns -[code]#((int32_t)hi[i] << 16) | lo[i]# for each element of [code]#hi# and -[code]#lo#. +_Returns:_ When the inputs are scalars, returns [code]#((int32_t)hi << 16) | +lo#. +Otherwise, returns [code]#((int32_t)hi[i] << 16) | lo[i]# for each element of +[code]#hi# and [code]#lo#. -The return type is [code]#int32_t# when the inputs are scalar. When the -inputs are [code]#marray#, the return type is [code]#marray# with element -type [code]#int32_t# and the same number of elements as the inputs. -Otherwise, the return type is [code]#vec# with element type [code]#int32_t# -and the same number of elements as the inputs. +The return type is [code]#int32_t# when the inputs are scalar. +When the inputs are [code]#marray#, the return type is [code]#marray# with +element type [code]#int32_t# and the same number of elements as the inputs. +Otherwise, the return type is [code]#vec# with element type [code]#int32_t# and +the same number of elements as the inputs. ''' @@ -24807,22 +24819,22 @@ template _Constraints:_ Available only if one of the following conditions is met: * [code]#UInt32Bit1# and [code]#UInt32Bit2# are both [code]#uint32_t#; -* [code]#UInt32Bit1# and [code]#UInt32Bit2# are both [code]#marray# with - element type [code]#uint32_t# and the same number of elements; or +* [code]#UInt32Bit1# and [code]#UInt32Bit2# are both [code]#marray# with element + type [code]#uint32_t# and the same number of elements; or * [code]#UInt32Bit1# and [code]#UInt32Bit2# are any combination of [code]#vec# or the [code]#+__swizzled_vec__+# type with element type [code]#uint32_t# and the same number of elements. -_Returns:_ When the inputs are scalars, returns -[code]#((uint64_t)hi << 32) | lo#. Otherwise, returns -[code]#((uint64_t)hi[i] << 32) | lo[i]# for each element of [code]#hi# and -[code]#lo#. +_Returns:_ When the inputs are scalars, returns [code]#((uint64_t)hi << 32) | +lo#. +Otherwise, returns [code]#((uint64_t)hi[i] << 32) | lo[i]# for each element of +[code]#hi# and [code]#lo#. -The return type is [code]#uint64_t# when the inputs are scalar. When the -inputs are [code]#marray#, the return type is [code]#marray# with element -type [code]#uint64_t# and the same number of elements as the inputs. -Otherwise, the return type is [code]#vec# with element type [code]#uint64_t# -and the same number of elements as the inputs. +The return type is [code]#uint64_t# when the inputs are scalar. +When the inputs are [code]#marray#, the return type is [code]#marray# with +element type [code]#uint64_t# and the same number of elements as the inputs. +Otherwise, the return type is [code]#vec# with element type [code]#uint64_t# and +the same number of elements as the inputs. ''' @@ -24834,8 +24846,7 @@ template _Constraints:_ Available only if one of the following conditions is met: -* [code]#Int32Bit# is [code]#int32_t# and [code]#UInt32Bit# is - [code]#uint32_t#; +* [code]#Int32Bit# is [code]#int32_t# and [code]#UInt32Bit# is [code]#uint32_t#; * [code]#Int32Bit# is [code]#marray# with element type [code]#int32_t# and [code]#UInt32Bit# is [code]#marray# with element type [code]#uint32_t# and both have the same number of elements; or @@ -24844,16 +24855,16 @@ _Constraints:_ Available only if one of the following conditions is met: [code]#+__swizzled_vec__+# type with element type [code]#uint32_t# and both have the same number of elements. -_Returns:_ When the inputs are scalars, returns -[code]#((int64_t)hi << 32) | lo#. Otherwise, returns -[code]#((int64_t)hi[i] << 32) | lo[i]# for each element of [code]#hi# and -[code]#lo#. +_Returns:_ When the inputs are scalars, returns [code]#((int64_t)hi << 32) | +lo#. +Otherwise, returns [code]#((int64_t)hi[i] << 32) | lo[i]# for each element of +[code]#hi# and [code]#lo#. -The return type is [code]#int64_t# when the inputs are scalar. When the -inputs are [code]#marray#, the return type is [code]#marray# with element -type [code]#int64_t# and the same number of elements as the inputs. -Otherwise, the return type is [code]#vec# with element type [code]#int64_t# -and the same number of elements as the inputs. +The return type is [code]#int64_t# when the inputs are scalar. +When the inputs are [code]#marray#, the return type is [code]#marray# with +element type [code]#int64_t# and the same number of elements as the inputs. +Otherwise, the return type is [code]#vec# with element type [code]#int64_t# and +the same number of elements as the inputs. ''' @@ -24867,8 +24878,9 @@ _Constraints:_ Available only if [code]#GenInt# is a _generic integer type_ as defined above. _Returns:_ When the input is a scalar, returns the number of non-zero bits in -[code]#x#. Otherwise, returns the number of non-zero bits in [code]#x[i]# for -each element of [code]#x#. +[code]#x#. +Otherwise, returns the number of non-zero bits in [code]#x[i]# for each element +of [code]#x#. The return type is [code]#GenInt# unless [code]#GenInt# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24898,18 +24910,19 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#Int32Bit1#; and * If [code]#Int32Bit1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#Int32Bit2# and [code]#Int32Bit3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. -_Preconditions:_ If the inputs are signed scalars, the values of [code]#x# and -[code]#y# must be in the range [-2^23^, 2^23^-1]. If the inputs are unsigned -scalars, the values of [code]#x# and [code]#y# must be in the range -[0, 2^24^-1]. If the inputs are not scalars, each element of [code]#x# and -[code]#y# must be in these ranges. +_Preconditions:_ If the inputs are signed scalars, the values of [code]#x# and +[code]#y# must be in the range [-2^23^, 2^23^-1]. +If the inputs are unsigned scalars, the values of [code]#x# and [code]#y# must +be in the range [0, 2^24^-1]. +If the inputs are not scalars, each element of [code]#x# and [code]#y# must be +in these ranges. -_Returns:_ When the inputs are scalars, returns [code]#x * y + z#. Otherwise, -returns [code]#x[i] * y[i] + z[i]# for each element of [code]#x#, [code]#y#, -and [code]#z#. +_Returns:_ When the inputs are scalars, returns [code]#x * y + z#. +Otherwise, returns [code]#x[i] * y[i] + z[i]# for each element of [code]#x#, +[code]#y#, and [code]#z#. The return type is [code]#Int32Bit1# unless [code]#Int32Bit1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -24941,14 +24954,16 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type, and both must have the same element type and the same number of elements. -_Preconditions:_ If the inputs are signed scalars, the values of [code]#x# and -[code]#y# must be in the range [-2^23^, 2^23^-1]. If the inputs are unsigned -scalars, the values of [code]#x# and [code]#y# must be in the range -[0, 2^24^-1]. If the inputs are not scalars, each element of [code]#x# and -[code]#y# must be in these ranges. +_Preconditions:_ If the inputs are signed scalars, the values of [code]#x# and +[code]#y# must be in the range [-2^23^, 2^23^-1]. +If the inputs are unsigned scalars, the values of [code]#x# and [code]#y# must +be in the range [0, 2^24^-1]. +If the inputs are not scalars, each element of [code]#x# and [code]#y# must be +in these ranges. -_Returns:_ When the inputs are scalars, returns [code]#x * y#. Otherwise, -returns [code]#x[i] * y[i]# for each element of [code]#x# and [code]#y#. +_Returns:_ When the inputs are scalars, returns [code]#x * y#. +Otherwise, returns [code]#x[i] * y[i]# for each element of [code]#x# and +[code]#y#. The return type is [code]#Int32Bit1# unless [code]#Int32Bit1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25000,18 +25015,18 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#GenFloat1#; and * If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. _Preconditions:_ If the inputs are scalars, the value of [code]#minval# must be -less than or equal to the value of [code]#maxval#. If the inputs are not -scalars, each element of [code]#minval# must be less than or equal to the -corresponding element of [code]#maxval#. +less than or equal to the value of [code]#maxval#. +If the inputs are not scalars, each element of [code]#minval# must be less than +or equal to the corresponding element of [code]#maxval#. -_Returns:_ When the inputs are scalars, returns -[code]#fmin(fmax(x, minval), maxval)#. Otherwise, returns -[code]#fmin(fmax(x[i], minval[i]), maxval[i])# for each element of [code]#x#, -[code]#minval#, and [code]#maxval#. +_Returns:_ When the inputs are scalars, returns [code]#fmin(fmax(x, minval), +maxval)#. +Otherwise, returns [code]#fmin(fmax(x[i], minval[i]), maxval[i])# for each +element of [code]#x#, [code]#minval#, and [code]#maxval#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25078,13 +25093,14 @@ _Constraints:_ Available only if all of the following conditions are met: the same number of elements. _Preconditions:_ When the inputs are scalars, [code]#x# and [code]#y# must not -be infinite or NaN. When the inputs are not scalars, no element of [code]#x# -or [code]#y# may be infinite or NaN. +be infinite or NaN. +When the inputs are not scalars, no element of [code]#x# or [code]#y# may be +infinite or NaN. _Returns:_ When the inputs are scalars, returns [code]#y# if [code]#x < y# -otherwise [code]#x#. When the inputs are not scalars, returns [code]#y[i]# if -[code]#x[i] < y[i]# otherwise [code]#x[i]# for each element of [code]#x# and -[code]#y#. +otherwise [code]#x#. +When the inputs are not scalars, returns [code]#y[i]# if [code]#x[i] < y[i]# +otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25096,11 +25112,11 @@ _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating point type_ as defined above. -_Preconditions:_ No element of [code]#x# may be infinite or NaN. The value of -[code]#y# must not be infinite or NaN. +_Preconditions:_ No element of [code]#x# may be infinite or NaN. +The value of [code]#y# must not be infinite or NaN. -_Returns:_ [code]#y# if [code]#x[i] < y# otherwise [code]#x[i]# for each -element of [code]#x#. +_Returns:_ [code]#y# if [code]#x[i] < y# otherwise [code]#x[i]# for each element +of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25130,13 +25146,14 @@ _Constraints:_ Available only if all of the following conditions are met: the same number of elements. _Preconditions:_ When the inputs are scalars, [code]#x# and [code]#y# must not -be infinite or NaN. When the inputs are not scalars, no element of [code]#x# -or [code]#y# may be infinite or NaN. +be infinite or NaN. +When the inputs are not scalars, no element of [code]#x# or [code]#y# may be +infinite or NaN. _Returns:_ When the inputs are scalars, returns [code]#y# if [code]#y < x# -otherwise [code]#x#. When the inputs are not scalars, returns [code]#y[i]# if -[code]#y[i] < x[i]# otherwise [code]#x[i]# for each element of [code]#x# and -[code]#y#. +otherwise [code]#x#. +When the inputs are not scalars, returns [code]#y[i]# if [code]#y[i] < x[i]# +otherwise [code]#x[i]# for each element of [code]#x# and [code]#y#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25148,11 +25165,11 @@ _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, [code]#vec#, or the [code]#+__swizzled_vec__+# type and is a _generic floating point type_ as defined above. -_Preconditions:_ No element of [code]#x# may be infinite or NaN. The value of -[code]#y# must not be infinite or NaN. +_Preconditions:_ No element of [code]#x# may be infinite or NaN. +The value of [code]#y# must not be infinite or NaN. -_Returns:_ [code]#y# if [code]#y < x[i]# otherwise [code]#x[i]# for each -element of [code]#x#. +_Returns:_ [code]#y# if [code]#y < x[i]# otherwise [code]#x[i]# for each element +of [code]#x#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25179,17 +25196,18 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#GenFloat1#; and * If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. -_Preconditions:_ If the inputs are scalars, the value of [code]#a# must be -in the range [0.0, 1.0]. If the inputs are not scalars, each element of -[code]#a# must be in the range [0.0, 1.0]. +_Preconditions:_ If the inputs are scalars, the value of [code]#a# must be in +the range [0.0, 1.0]. +If the inputs are not scalars, each element of [code]#a# must be in the range +[0.0, 1.0]. -_Returns:_ The linear blend of [code]#x# and [code]#y#. When the inputs are -scalars, returns [code]#x + (y - x) * a#. Otherwise, returns -[code]#x[i] + (y[i] - x[i]) * a[i]# for each element of [code]#x#, [code]#y#, -and [code]#a#. +_Returns:_ The linear blend of [code]#x# and [code]#y#. +When the inputs are scalars, returns [code]#x + (y - x) * a#. +Otherwise, returns [code]#x[i] + (y[i] - x[i]) * a[i]# for each element of +[code]#x#, [code]#y#, and [code]#a#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25203,8 +25221,8 @@ point type_ as defined above. _Preconditions:_ The value of [code]#a# must be in the range [0.0, 1.0]. -_Returns:_ The linear blend of [code]#x# and [code]#y#, computed as -[code]#x[i] + (y[i] - x[i]) * a# for each element of [code]#x# and [code]#y#. +_Returns:_ The linear blend of [code]#x# and [code]#y#, computed as [code]#x[i] ++ (y[i] - x[i]) * a# for each element of [code]#x# and [code]#y#. The return type is [code]#NonScalar# unless [code]#NonScalar# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25254,10 +25272,10 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type, and both must have the same element type and the same number of elements. -_Returns:_ When the inputs are scalars, returns the value -[code]#(x < edge) ? 0.0 : 1.0#. When the inputs are not scalars, returns -the value [code]#(x[i] < edge[i]) ? 0.0 : 1.0# for each element of [code]#x# -and [code]#edge#. +_Returns:_ When the inputs are scalars, returns the value [code]#(x < edge) ? +0.0 : 1.0#. +When the inputs are not scalars, returns the value [code]#(x[i] < edge[i]) ? 0.0 +: 1.0# for each element of [code]#x# and [code]#edge#. The return type is [code]#GenFloat1# unless [code]#GenFloat1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25298,19 +25316,21 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#GenFloat1#; and * If [code]#GenFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenFloat2# and [code]#GenFloat3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. _Preconditions:_ If the inputs are scalar, [code]#edge0# must be less than -[code]#edge1# and none of [code]#edge0#, [code]#edge1#, or [code]#x# may be -NaN. If the inputs are not scalar, each element of [code]#edge0# must be less -than the corresponding element of [code]#edge1# and no element of -[code]#edge0#, [code]#edge1#, or [code]#x# may be NaN. +[code]#edge1# and none of [code]#edge0#, [code]#edge1#, or [code]#x# may be NaN. +If the inputs are not scalar, each element of [code]#edge0# must be less than +the corresponding element of [code]#edge1# and no element of [code]#edge0#, +[code]#edge1#, or [code]#x# may be NaN. _Returns:_ When the inputs are scalars, returns 0.0 if [code]#+x <= edge0+# and 1.0 if [code]#x >= edge1# and performs smooth Hermite interpolation between 0 -and 1 when [code]#edge0 < x < edge1#. This is useful in cases where you would -want a threshold function with a smooth transition. This is equivalent to: +and 1 when [code]#edge0 < x < edge1#. +This is useful in cases where you would want a threshold function with a smooth +transition. +This is equivalent to: [source,role=codebox] ---- @@ -25319,8 +25339,8 @@ t = clamp((x - edge0) / (edge1 - edge0), 0, 1); return t * t * (3 - 2 * t); ---- -When the inputs are not scalars, returns the following value for each element -of [code]#edge0#, [code]#edge1#, and [code]#x#: +When the inputs are not scalars, returns the following value for each element of +[code]#edge0#, [code]#edge1#, and [code]#x#: [source,role=codebox] ---- @@ -25340,8 +25360,8 @@ _Constraints:_ Available only if [code]#NonScalar# is [code]#marray#, point type_ as defined above. _Preconditions:_ The value of [code]#edge0# must be less than [code]#edge1# and -neither [code]#edge0# nor [code]#edge1# may be NaN. No element of [code]#x# -may be NaN. +neither [code]#edge0# nor [code]#edge1# may be NaN. +No element of [code]#x# may be NaN. _Returns:_ The following value for each element of [code]#x#: @@ -25369,8 +25389,9 @@ type_ as defined above. _Returns:_ When the input is scalar, returns 1.0 if [code]#x > 0#, -0.0 if [code]#x == -0.0#, +0.0 if [code]#x == +0.0#, -1.0 if [code]#x < 0#, or 0.0 if -[code]#x# is a NaN. When the input is not scalar, returns these values for -each element of [code]#x#. +[code]#x# is a NaN. +When the input is not scalar, returns these values for each element of +[code]#x#. The return type is [code]#GenFloat# unless [code]#GenFloat# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -25442,8 +25463,8 @@ _Constraints:_ Available only if all of the following conditions are met: ** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# ** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# ** [code]#+__swizzled_vec__+# that is convertible to [code]#vec# -* If [code]#Geo3or4Float1# is [code]#marray#, then [code]#Geo3or4Float2# must - be the same as [code]#Geo3or4Float1#; and +* If [code]#Geo3or4Float1# is [code]#marray#, then [code]#Geo3or4Float2# must be + the same as [code]#Geo3or4Float1#; and * If [code]#Geo3or4Float1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#Geo3or4Float2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# type, and both must have the same element type and @@ -25469,15 +25490,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GeoFloat1# is a _generic geometric type_ as defined above; * If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and -* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GeoFloat2# must also be [code]#vec# or the +* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, + then [code]#GeoFloat2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# type, and both must have the same element type and the same number of elements. _Returns:_ The dot product of [code]#p0# and [code]#p1#. -The return type is [code]#GeoFloat1# if the input types are scalar. Otherwise, -the return type is [code]#GeoFloat1::value_type#. +The return type is [code]#GeoFloat1# if the input types are scalar. +Otherwise, the return type is [code]#GeoFloat1::value_type#. ''' @@ -25492,16 +25513,16 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GeoFloat1# is a _generic geometric type_ as defined above; * If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and -* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GeoFloat2# must also be [code]#vec# or the +* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, + then [code]#GeoFloat2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# type, and both must have the same element type and the same number of elements. -_Returns:_ The distance between [code]#p0# and [code]#p1#. This is calculated -as [code]#length(p0 - p1)#. +_Returns:_ The distance between [code]#p0# and [code]#p1#. +This is calculated as [code]#length(p0 - p1)#. -The return type is [code]#GeoFloat1# if the input types are scalar. Otherwise, -the return type is [code]#GeoFloat1::value_type#. +The return type is [code]#GeoFloat1# if the input types are scalar. +Otherwise, the return type is [code]#GeoFloat1::value_type#. ''' @@ -25514,11 +25535,11 @@ template _Constraints:_ Available only if [code]#GeoFloat# is a _generic geometric type_ as defined above. -_Returns:_ The length of vector [code]#p#, i.e., -[code]#+sqrt(pow(p[0],2) + pow(p[1],2) + ...)+#. +_Returns:_ The length of vector [code]#p#, i.e., [code]#+sqrt(pow(p[0],2) + +pow(p[1],2) + ...)+#. -The return type is [code]#GeoFloat# if the input type is scalar. Otherwise, -the return type is [code]#GeoFloat::value_type#. +The return type is [code]#GeoFloat# if the input type is scalar. +Otherwise, the return type is [code]#GeoFloat::value_type#. ''' @@ -25550,15 +25571,15 @@ _Constraints:_ Available only if all of the following conditions are met: * [code]#GeoFloat1# is a _float geometric type_ as defined above; * If [code]#GeoFloat1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GeoFloat2# must be the same as [code]#GeoFloat1#; and -* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GeoFloat2# must also be [code]#vec# or the +* If [code]#GeoFloat1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, + then [code]#GeoFloat2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# type, and both must have the same number of elements. _Returns:_ The value [code]#fast_length(p0 - p1)#. -The return type is [code]#GeoFloat1# if the input type is scalar. Otherwise, -the return type is [code]#GeoFloat1::value_type#. +The return type is [code]#GeoFloat1# if the input type is scalar. +Otherwise, the return type is [code]#GeoFloat1::value_type#. ''' @@ -25568,14 +25589,14 @@ template /*return-type*/ fast_length(GeoFloat p) ---- -_Constraints:_ Available only if [code]#GeoFloat# is a _float geometric type_ -as defined above. +_Constraints:_ Available only if [code]#GeoFloat# is a _float geometric type_ as +defined above. _Returns:_ The length of vector [code]#p# computed as: [code]#+half_precision::sqrt(pow(p[0],2) + pow(p[1],2) + ...)+#. -The return type is [code]#GeoFloat# if the input type is scalar. Otherwise, -the return type is [code]#GeoFloat::value_type#. +The return type is [code]#GeoFloat# if the input type is scalar. +Otherwise, the return type is [code]#GeoFloat::value_type#. ''' @@ -25585,15 +25606,14 @@ template /*return-type*/ fast_normalize(GeoFloat p) ---- -_Constraints:_ Available only if [code]#GeoFloat# is a _float geometric type_ -as defined above. +_Constraints:_ Available only if [code]#GeoFloat# is a _float geometric type_ as +defined above. _Returns:_ A vector in the same direction as [code]#p# but with a length of 1 -computed as -[code]#+p * half_precision::rsqrt(pow(p[0],2) + pow(p[1],2) + ...)+#. +computed as [code]#+p * half_precision::rsqrt(pow(p[0],2) + pow(p[1],2) + +...)+#. -The result shall be within 8192 ulps error from the infinitely precise result -of +The result shall be within 8192 ulps error from the infinitely precise result of [source,role=codebox] ---- @@ -25691,13 +25711,13 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#(x[i] == y[i])# for each element of [code]#x# and [code]#y#. If -[code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] == +y[i])# for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns the value [code]#((x[i] == y[i]) ? -1 : 0)# for each element of [code]#x# and [code]#y#. @@ -25749,12 +25769,12 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#(x[i] != y[i])# for each element of [code]#x# and [code]#y#. +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] != +y[i])# for each element of [code]#x# and [code]#y#. If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns the value [code]#((x[i] != y[i]) ? -1 : 0)# for each element of [code]#x# and [code]#y#. @@ -25807,15 +25827,15 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#(x[i] > y[i])# for each element of [code]#x# and [code]#y#. If -[code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] > y[i]) ? -1 : 0)# for each element -of [code]#x# and [code]#y#. +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] > +y[i])# for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +returns the value [code]#((x[i] > y[i]) ? -1 : 0)# for each element of [code]#x# +and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -25865,13 +25885,13 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#(x[i] >= y[i])# for each element of [code]#x# and [code]#y#. If -[code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] >= +y[i])# for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns the value [code]#((x[i] >= y[i]) ? -1 : 0)# for each element of [code]#x# and [code]#y#. @@ -25923,15 +25943,15 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#(x[i] < y[i])# for each element of [code]#x# and [code]#y#. If -[code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns the value [code]#((x[i] < y[i]) ? -1 : 0)# for each element of -[code]#x# and [code]#y#. +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] < +y[i])# for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +returns the value [code]#((x[i] < y[i]) ? -1 : 0)# for each element of [code]#x# +and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -25981,13 +26001,13 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#+(x[i] <= y[i])+# for each element of [code]#x# and [code]#y#. If -[code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#+(x[i] <= +y[i])+# for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns the value [code]#+((x[i] <= y[i]) ? -1 : 0)+# for each element of [code]#x# and [code]#y#. @@ -26039,16 +26059,15 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#(x[i] < y[i] || x[i] > y[i])# for each element of [code]#x# and -[code]#y#. If [code]#NonScalar1# is [code]#vec# or the -[code]#+__swizzled_vec__+# type, returns the value -[code]#((x[i] < y[i] || x[i] > y[i]) ? -1 : 0)# for each element of [code]#x# -and [code]#y#. +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#(x[i] < +y[i] || x[i] > y[i])# for each element of [code]#x# and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +returns the value [code]#((x[i] < y[i] || x[i] > y[i]) ? -1 : 0)# for each +element of [code]#x# and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -26097,9 +26116,9 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each -element of [code]#x# only if [code]#x[i]# is a finite value. If -[code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element +of [code]#x# only if [code]#x[i]# is a finite value. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns -1 for each element of [code]#x# if [code]#x[i]# is a finite value and returns 0 otherwise. @@ -26151,11 +26170,11 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each -element of [code]#x# only if [code]#x[i]# has an infinity value. If -[code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, -returns -1 for each element of [code]#x# if [code]#x[i]# has an infinity -value and returns 0 otherwise. +_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element +of [code]#x# only if [code]#x[i]# has an infinity value. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +returns -1 for each element of [code]#x# if [code]#x[i]# has an infinity value +and returns 0 otherwise. The return type depends on [code]#NonScalar#: @@ -26204,9 +26223,9 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each -element of [code]#x# only if [code]#x[i]# has a NaN value. If -[code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element +of [code]#x# only if [code]#x[i]# has a NaN value. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns -1 for each element of [code]#x# if [code]#x[i]# has a NaN value and returns 0 otherwise. @@ -26257,9 +26276,9 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each -element of [code]#x# only if [code]#x[i]# has a normal value. If -[code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element +of [code]#x# only if [code]#x[i]# has a normal value. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns -1 for each element of [code]#x# if [code]#x[i]# has a normal value and returns 0 otherwise. @@ -26313,18 +26332,18 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Effects:_ Tests if each element of [code]#x# and [code]#y# are ordered. _Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#isequal(x[i], x[i]) && isequal(y[i], y[i])# for each element of -[code]#x# and [code]#y#. If [code]#NonScalar1# is [code]#vec# or the -[code]#+__swizzled_vec__+# type, returns the value -[code]#((isequal(x[i], x[i]) && isequal(y[i], y[i]) ? -1 : 0)# for each element -of [code]#x# and [code]#y#. +[code]#isequal(x[i], x[i]) && isequal(y[i], y[i])# for each element of [code]#x# +and [code]#y#. +If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +returns the value [code]#((isequal(x[i], x[i]) && isequal(y[i], y[i]) ? -1 : 0)# +for each element of [code]#x# and [code]#y#. The return type depends on [code]#NonScalar1#: @@ -26376,14 +26395,14 @@ _Constraints:_ Available only if all of the following conditions are met: ** Both [code]#NonScalar1# and [code]#NonScalar2# are [code]#marray#; or ** [code]#NonScalar1# and [code]#NonScalar2# are any combination of [code]#vec# and the [code]#+__swizzled_vec__+# type; -* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements - and the same element type; and +* [code]#NonScalar1# and [code]#NonScalar2# have the same number of elements and + the same element type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. _Effects:_ Tests if each element of [code]#x# and [code]#y# are unordered. -_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value -[code]#isnan(x[i]) || isnan(y[i])# for each element of [code]#x# and [code]#y#. +_Returns:_ If [code]#NonScalar1# is [code]#marray#, the value [code]#isnan(x[i]) +|| isnan(y[i])# for each element of [code]#x# and [code]#y#. If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns the value [code]#((isnan(x[i]) || isnan(y[i]) ? -1 : 0)# for each element of [code]#x# and [code]#y#. @@ -26435,9 +26454,9 @@ _Constraints:_ Available only if all of the following conditions are met: [code]#+__swizzled_vec__+# type; and * The element type is [code]#float#, [code]#double#, or [code]#half#. -_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each -element of [code]#x# only if the sign bit of [code]#x[i]# is set. If -[code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, +_Returns:_ If [code]#NonScalar# is [code]#marray#, returns true for each element +of [code]#x# only if the sign bit of [code]#x[i]# is set. +If [code]#NonScalar# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns -1 for each element of [code]#x# if the sign bit of [code]#x[i]# is set and returns 0 otherwise. @@ -26490,9 +26509,10 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types: * [code]#+__swizzled_vec__+# that is convertible to [code]#vec# _Returns:_ When [code]#x# is [code]#marray#, returns a Boolean telling whether -any element of [code]#x# is true. When [code]#x# is [code]#vec# or the -[code]#+__swizzled_vec__+# type, returns the value 1 if any element in -[code]#x# has its most significant bit set, otherwise returns the value 0. +any element of [code]#x# is true. +When [code]#x# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns +the value 1 if any element in [code]#x# has its most significant bit set, +otherwise returns the value 0. The return type is [code]#bool# if [code]#GenInt# is [code]#marray#. Otherwise, the return type is [code]#int#. @@ -26515,9 +26535,9 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types: * [code]#marray# _Returns:_ When [code]#x# is a scalar, returns a Boolean telling whether the -most significant bit of [code]#x# is set. When [code]#x# is [code]#marray#, -returns a Boolean telling whether the most significant bit of any element -in [code]#x# is set. +most significant bit of [code]#x# is set. +When [code]#x# is [code]#marray#, returns a Boolean telling whether the most +significant bit of any element in [code]#x# is set. ''' @@ -26545,9 +26565,10 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types: * [code]#+__swizzled_vec__+# that is convertible to [code]#vec# _Returns:_ When [code]#x# is [code]#marray#, returns a Boolean telling whether -all elements of [code]#x# are true. When [code]#x# is [code]#vec# or the -[code]#+__swizzled_vec__+# type, returns the value 1 if all elements in -[code]#x# have their most significant bit set, otherwise returns the value 0. +all elements of [code]#x# are true. +When [code]#x# is [code]#vec# or the [code]#+__swizzled_vec__+# type, returns +the value 1 if all elements in [code]#x# have their most significant bit set, +otherwise returns the value 0. The return type is [code]#bool# if [code]#GenInt# is [code]#marray#. Otherwise, the return type is [code]#int#. @@ -26570,9 +26591,9 @@ _Constraints:_ Available only if [code]#GenInt# is one of the following types: * [code]#marray# _Returns:_ When [code]#x# is a scalar, returns a Boolean telling whether the -most significant bit of [code]#x# is set. When [code]#x# is [code]#marray#, -returns a Boolean telling whether the most significant bit of all elements -in [code]#x# are set. +most significant bit of [code]#x# is set. +When [code]#x# is [code]#marray#, returns a Boolean telling whether the most +significant bit of all elements in [code]#x# are set. ''' @@ -26591,22 +26612,23 @@ _Constraints:_ Available only if all of the following conditions are met: defined above; or ** [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where [code]#T# is one of the _vector element types_; -* If [code]#GenType1# is not [code]#vec# or the [code]#+__swizzled_vec__+# - type, then [code]#GenType2# and [code]#GenType3# must be the same as +* If [code]#GenType1# is not [code]#vec# or the [code]#+__swizzled_vec__+# type, + then [code]#GenType2# and [code]#GenType3# must be the same as [code]#GenType1#; and * If [code]#GenType1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then [code]#GenType2# and [code]#GenType3# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and all three must have the same element - type and the same number of elements. + [code]#+__swizzled_vec__+# type, and all three must have the same element type + and the same number of elements. _Returns:_ When the input parameters are scalars, returns a result where each -bit of the result is the corresponding bit of [code]#a# if the corresponding -bit of [code]#c# is 0. Otherwise it is the corresponding bit of [code]#b#. +bit of the result is the corresponding bit of [code]#a# if the corresponding bit +of [code]#c# is 0. +Otherwise it is the corresponding bit of [code]#b#. When the input parameters are not scalars, returns a result for each element where each bit of the result for element [code]#i# is the corresponding bit of -[code]#a[i]# if the corresponding bit of [code]#c[i]# is 0. Otherwise it is -the corresponding bit of [code]#b[i]#. +[code]#a[i]# if the corresponding bit of [code]#c[i]# is 0. +Otherwise it is the corresponding bit of [code]#b[i]#. The return type is [code]#GenType1# unless [code]#GenType1# is the [code]#+__swizzled_vec__+# type, in which case the return type is the @@ -26635,25 +26657,25 @@ _Returns:_ The value [code]#(c ? b : a)#. _Constraints:_ Available only if all of the following conditions are met: * [code]#NonScalar1# is one of the following types: -** [code]#marray#, where [code]#T# is one of the _generic scalar types_ - as defined above; -** [code]#vec#, where [code]#T# is one of the _vector element types_ - as defined above; or +** [code]#marray#, where [code]#T# is one of the _generic scalar types_ as + defined above; +** [code]#vec#, where [code]#T# is one of the _vector element types_ as + defined above; or ** [code]#+__swizzled_vec__+# that is convertible to [code]#vec#, where [code]#T# is one of the _vector element types_; * If [code]#NonScalar1# is [code]#marray#, then: ** [code]#NonScalar2# must be the same as [code]#NonScalar1#; and -** [code]#NonScalar3# must be [code]#marray# with element type [code]#bool# - and the same number of elements as [code]#NonScalar1#; +** [code]#NonScalar3# must be [code]#marray# with element type [code]#bool# and + the same number of elements as [code]#NonScalar1#; * If [code]#NonScalar1# is [code]#vec# or the [code]#+__swizzled_vec__+# type, then: -** [code]#NonScalar2# must also be [code]#vec# or the - [code]#+__swizzled_vec__+# type, and both must have the same element type - and the same number of elements; and -** [code]#NonScalar3# must be [code]#vec# or the [code]#+__swizzled_vec__+# - type with the same number of elements as [code]#NonScalar1#. The element - type of [code]#NonScalar3# must be a signed or unsigned integer with the - same number of bits as the element type of [code]#NonScalar1#. +** [code]#NonScalar2# must also be [code]#vec# or the [code]#+__swizzled_vec__+# + type, and both must have the same element type and the same number of + elements; and +** [code]#NonScalar3# must be [code]#vec# or the [code]#+__swizzled_vec__+# type + with the same number of elements as [code]#NonScalar1#. + The element type of [code]#NonScalar3# must be a signed or unsigned integer + with the same number of bits as the element type of [code]#NonScalar1#. _Returns:_ If [code]#NonScalar1# is [code]#marray#, return the value [code]#(c[i] ? b[i] : a[i])# for each element of [code]#a#, [code]#b#, and